一、Properties
_MyColor ("Some Color", Color) = (1,1,1,1)
_MyVector ("Some Vector", Vector) = (0,0,0,0)
_MyFloat ("My float", Float) = 0.5
_MyTexture ("Texture", 2D) = "white" {}
_MyCubemap ("Cubemap", CUBE) = "" {}
二、Tags
Possible values for LightMode tag are:
- Always: Always rendered; no lighting is applied.
- ForwardBase: Used in Forward rendering, ambient, main directional light, vertex/SH lights and lightmaps are applied.
- ForwardAdd: Used in Forward rendering; additive per-pixel lights are applied, one pass per light.
- Deferred: Used in Deferred Shading; renders g-buffer.
- ShadowCaster: Renders object depth into the shadowmap or a depth texture.
- PrepassBase: Used in legacy Deferred Lighting, renders normals and specular exponent.
- PrepassFinal: Used in legacy Deferred Lighting, renders final color by combining textures, lighting and emission.
- Vertex: Used in legacy Vertex Lit rendering when object is not lightmapped; all vertex lights are applied.
- VertexLMRGBM: Used in legacy Vertex Lit rendering when object is lightmapped; on platforms where lightmap is RGBM encoded (PC & console).
- VertexLM: Used in legacy Vertex Lit rendering when object is lightmapped; on platforms where lightmap is double-LDR encoded (mobile platforms).
Possible values for LightMode tag are:
- SoftVegetation: Render this pass only if Soft Vegetation is on in Quality Settings.
Possible values for Queue tag are:
-
Background
- this render queue is rendered before any others. You’d typically use this for things that really need to be in the background. -
Geometry
(default) - this is used for most objects. Opaque geometry uses this queue. -
AlphaTest
- alpha tested geometry uses this queue. It’s a separate queue fromGeometry
one since it’s more efficient to render alpha-tested objects after all solid ones are drawn. -
Transparent
- this render queue is rendered after Geometry andAlphaTest
, in back-to-front order. Anything alpha-blended (i.e. shaders that don’t write to depth buffer) should go here (glass, particle effects). -
Overlay
- this render queue is meant for overlay effects. Anything rendered last should go here (e.g. lens flares). -
Possible values for RenderType tag are:
- Opaque: most of the shaders (Normal, Self Illuminated, Reflective, terrain shaders).
- Transparent: most semitransparent shaders (Transparent, Particle, Font, terrain additive pass shaders).
- TransparentCutout: masked transparency shaders (Transparent Cutout, two pass vegetation shaders).
- Background: Skybox shaders.
- Overlay: GUITexture, Halo, Flare shaders.
- TreeOpaque: terrain engine tree bark.
- TreeTransparentCutout: terrain engine tree leaves.
- TreeBillboard: terrain engine billboarded trees.
- Grass: terrain engine grass.
- GrassBillboard: terrain engine billboarded grass.
DisableBatching tag
True:(always disables batching for this shader)
False: (does not disable batching; this is default)
LODFading”:(disable batching when LOD fading is active; mostly used on trees).
ForceNoShadowCasting tag
If ForceNoShadowCasting
tag is given and has a value of “True”, then an object that is rendered using this subshader will never cast
shadows. This is mostly useful when you are using shader replacement on transparent objects and you do not wont to inherit a shadow
pass from another subshader.
IgnoreProjector tag
if ignoreProjector