Movatterモバイル変換


[0]ホーム

URL:


Version:Unity 6.2 (6000.2)
    • Supported
    • Legacy
    Language:English

    Unity Manual

    LOD directive in ShaderLab reference
    UsePass directive in ShaderLab reference

    SubShader tags in ShaderLab reference

    This page contains information on using aTags block in yourShaderLabUnity’s language for defining the structure of Shader objects.More info
    See inGlossary
    code to assign tags to a SubShader.

    For information on defining SubShader, seeShaderLab: defining a SubShader. For information on how aShaderA program that runs on the GPU.More info
    See inGlossary
    object works, and the relationship between Shader objects, SubShaders and Passes, seeShader objectsAn instance of the Shader class, a Shader object is container for shader programs and GPU instructions, and information that tells Unity how to use them. Use them with materials to determine the appearance of your scene.More info
    See inGlossary
    .

    Render pipeline compatibility

    Feature nameUniversalRender PipelineA series of operations that take the contents of a Scene, and displays them on a screen. Unity lets you choose from pre-built render pipelines, or write your own.More info
    See inGlossary
    (URP)
    High Definition Render Pipeline (HDRP)Custom SRPBuilt-in Render Pipeline
    ShaderLab: SubShader Tags blockYesYesYesYes
    ShaderLab: RenderPipeline SubShader tagYesYesNoNo
    ShaderLab: Queue SubShader tagYesYes

    Yes

    Note: in a custom SRP, you can define your own rendering order and choose whether or not to use render queues. For more information, see DrawingSettings and SortingCriteria.
    Yes
    ShaderLab: RenderType SubShader tagYesYesYesYes
    ShaderLab: DisableBatching SubShader tagYesYesYesYes
    ShaderLab: ForceNoShadowCasting SubShader tagYesYes

    This disables regular shadows, but has no effect on contact shadows.
    YesYes
    ShaderLab: CanUseSpriteAtlas SubShader tagYesYesYesYes
    ShaderLab: PreviewType SubShader tagYesYesYesYes

    Syntax

    SignatureFunction
    Tags { “[name1]” = “[value1]” “[name2]” = “[value2]”}Applies the given tags to the SubShader.

    You can define as many tags as you like.

    RenderPipeline tag

    SignatureFunction
    “RenderPipeline” = “[name]”Tells Unity whether this SubShader is compatible with URP or HDRP.
    ParameterValueFunction
    [name]UniversalPipelineThis SubShader is compatible with URP only.
    HDRenderPipelineThis SubShader is compatible with HDRP only.
    (any other value, or not declared)This SubShader is not compatible with URP or HDRP.

    Queue tag

    SignatureFunction
    “Queue” = “[queue name]”Use the named render queue.
    “Queue” = “[queue name] + [offset]”Use an unnamed queue, at a given offset from the named queue.

    An example of when this is useful is in the case of transparent water, which you should draw after opaque objects but before transparent objects.
    SignatureValueFunction
    [queue name]BackgroundSpecifies the Background render queue.
    GeometrySpecifies the Geometry render queue.
    AlphaTestSpecifies the AlphaTest render queue.
    TransparentSpecifies the Transparent render queue.
    OverlaySpecifies the Overlay render queue.
    [offset]integerSpecifies the index at which Unity renders the unnamed queue, relative to the named queue.

    RenderType tag

    SignatureFunction
    “RenderType” = “[renderType]”Set the RenderType value for this SubShader.
    SignatureValueFunction
    [renderType]StringThere are no set values for this parameter. To identify the RenderType value for any SubShader that you want to replace, open its shader source file.

    TheRenderType SubShader tags for Unity’s legacy built-in shaders are listed on theshader replacement page.

    You can also create your own values for your custom SubShaders.

    ForceNoShadowCasting tag

    SignatureFunction
    “ForceNoShadowCasting” = “[state]”Whether to prevent shadow casting (and sometimes receiving) for all geometry that uses this SubShader.
    SignatureValueFunction
    [state]TrueUnity prevents the geometry in this SubShader from casting shadows.

    In the Built in Render Pipeline, with the Forward or Legacy Vertex Lit rendering paths, Unity also prevents the geometry in this SubShader from receiving shadows.

    In HDRP, this does not prevent the geometry from casting contact shadows.
    FalseUnity does not prevent the geometry in this SubShader from casting or receiving shadows. This is the default value.

    DisableBatching tag

    SignatureFunction
    “DisableBatching” = “[state]”Whether Unity preventsDynamic BatchingAn automatic Unity process which attempts to render multiple meshes as if they were a single mesh for optimized graphics performance. The technique transforms all of the GameObject vertices on the CPU and groups many similar vertices together.More info
    See inGlossary
    for all geometry that uses this SubShader.
    SignatureValueFunction
    [state]TrueUnity prevents Dynamic Batching for geometry that uses this SubShader.
    FalseUnity does not prevent Dynamic Batching for geometry that uses this SubShader. This is the default value.
    LODFadingUnity prevents Dynamic Batching for all geometry that is part of aLODGroup with a Fade Mode value that is not None. Otherwise, Unity does not prevent Dynamic Batching.

    IgnoreProjector tag

    SignatureFunction
    “IgnoreProjector” = “[state]”Whether Unity ignores Projectors when rendering this geometry.
    SignatureValueFunction
    [state]TrueUnity ignores Projectors when rendering this geometry.
    FalseUnity does not ignore Projectors when rendering this geometry. This is the default value.

    PreviewType tag

    ThePreviewType SubShader Tag tells the Unity Editor how to display a material that uses this SubShader in the MaterialInspectorA Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit the values.More info
    See inGlossary
    .

    SignatureFunction
    “PreviewType” = “[shape]”Which shape the Unity Editor uses to display a preview of a material that uses this SubShader.
    SignatureValueFunction
    [shape]SphereDisplay the material on a sphere. This is the default value.
    PlaneDisplay the material on a plane.
    SkyboxA special type of Material used to represent skies. Usually six-sided.More info
    See inGlossary
    Display the material on a skybox.

    Additional resources

    LOD directive in ShaderLab reference
    UsePass directive in ShaderLab reference
    Copyright ©2005-2025 Unity Technologies. All rights reserved. Built from 6000.2.16f1 (db195639cfa8). Built on: 2025-11-28.

    [8]ページ先頭

    ©2009-2025 Movatter.jp