概念说明:Unity Shader-渲染队列,ZTest,ZWrite,Early-Z
shader代码
Shader "Fan/Particles/Alpha Blended" {
Properties {
_MainTex ("Particle Texture", 2D) = "white" {}
[Enum(Off,0,On,1)]_ZWrite("ZWrite",int) = 0
[Enum(UnityEngine.Rendering.CompareFunction)]_ZTest("ZTest",int) = 0
}
Category {
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
Blend SrcAlpha OneMinusSrcAlpha
Cull Off Lighting Off ZWrite Off Fog { Color (0,0,0,0) }
ZWrite[_ZWrite]
ZTest[_ZTest]
BindChannels {
Bind "Color", color
Bind "Vertex", vertex
Bind "TexCoord", texcoord
}
SubShader {
Pass {
SetTexture [_MainTex] {
combine texture * primary
}
}
}
}
}
框出修改内容.png
网友评论