0
Completed

How can I make a particle add(soft) shader?

wavebbs 7 years ago updated 7 years ago 3

How can I add this code in the shader ?

Code: Select all

#ifdef SOFTPARTICLES_ON
float sceneZ = LinearEyeDepth (SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos)));
float partZ = i.projPos.z;
float fade = saturate (_InvFade * (sceneZ-partZ));
i.color.a *= fade;
#endif



I want add soft particle code on my shader like unity3d shader "Particles/Additive"

Answer

Answer
Completed

Multiply the color with the depth blend node. The input of the depth blend node is the fade distance, which defaults to 1 meter

Answer
Completed

Multiply the color with the depth blend node. The input of the depth blend node is the fade distance, which defaults to 1 meter

Thank you, I found it,but it dosen't has macro "SOFTPARTICLES_ON" ,so I can't control it by Unity3d->qualitysetting->soft particles button . How could I fixed it ? :)

Thank you, I found it,but it dosen't has macro "SOFTPARTICLES_ON" ,so I can't control it by Unity3d->qualitysetting->soft particles button . How could I fixed it ? :)