Hi there. I’m learning about Mobile/Particles/Additive shader
Shader "Mobile/Particles/Additive" {
Properties {
_MainTex ("Particle Texture", 2D) = "white" {}
}
Category {
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
Blend SrcAlpha One
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] {
combine texture * primary
}
}
}
}
}
And I don’t really understand the code “combine texture * primary”. What is the primary? Is it the color in depth buffer? How to write this shader by fragment program?
My code is
Shader "PngRecorder/PRParticle" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Tags {"Queue" = "Transparent" "RenderType"="Transparent" }
Pass{
Blend SrcAlpha One
ZWrite Off
CGPROGRAM
#pragma vertex vert_img
#pragma fragment frag
#pragma fragmentoption ARB_precision_hint_fastest
#include "UnityCG.cginc"
uniform sampler2D _MainTex;
fixed4 frag(v2f_img i) : COLOR{
float4 col = tex2D(_MainTex,i.uv);
return col;
}
ENDCG
}
}
FallBack "Diffuse"
}
But it has different effects. What’s the problem ?