Is there one that runs on 3.x?
Make an alpha cutout shader using surface shaders and there ya go, it throws shadows at ya. I’m sure there’s one already for vegetation or somthing, it just won’t be in the particles directory.
Any shader with lighting will cast a shadow when used with particles. Unfortunately, particle shadow casting is wrong and weird-looking right now. I just got word that it’s been fixed for an upcoming release, though.
I did try using the standard cutout but the particle ramp has no effect on it so they pop in and out very abruptly.
If you want to use alpha for opacity and alpha testing, you’ll need to write a custom shader using clip().
Daniel,
I don’t know what clip() is so tried frankensteining by adding #pragma alphatest:0.5 to “particle alpha blended” but it doesn’t even turn the transparency into cutout… any idea ?
clip() is a pixel shader instruction that will discard (not draw at all) the pixel if whatever parameter you give it is negative.
Put clip(-1) in your pixel shader,and voila! You’ve got yourself a pixel shader that will never draw anything.
Here is what I have.
What do I need to ad so it asts shadows ?
Shader "Particles/Cutout" {
Properties {
_TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5)
_MainTex ("Particle Texture", 2D) = "white"
}
SubShader {
Tags { "Queue" = "Transparent" }
Cull Off
Lighting Off
ZWrite On
//Fog { color (0,0,0,0) }
AlphaTest Greater .5
ColorMask RGB
BindChannels {
Bind "Color", color
Bind "Vertex", vertex
Bind "TexCoord", texcoord
}
Pass {
SetTexture [_MainTex] {
constantColor [_TintColor]
combine constant * primary DOUBLE
}
SetTexture [_MainTex] {
combine previous * texture
}
}
}
}