Shader "Custom/ParticlesTest"
{
Properties {
_IlluminCol ("Self-Illumination color (RGB)", Color) = (1,1,1,1)
_MainTex ("Particle Texture", 2D) = "white" {}
_Cutoff ("Base Alpha cutoff", Range (0,.9)) = .5
}
Category {
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" }
//Alpha混合
Blend SrcAlpha OneMinusSrcAlpha
//Alpha测试
AlphaTest GEqual [_Cutoff]
Cull Off Lighting Off ZWrite Off Fog { Color (0,0,0,0) }
BindChannels {
Bind "Color", color
Bind "Vertex", vertex
Bind "TexCoord", texcoord
}
SubShader {
Pass {
SetTexture [_MainTex] {
constantColor [_IlluminCol]
//combine rgb, alpha
//combine 纹理的rgb与constant的rgb相乘, 纹理的alpha与constant的alpha相乘
combine texture * constant, texture * constant
}
}
}
}
}
效果