I know almost nothing about shader coding, so this is basically a challenge or a request for help. In two parts:
is it possible to create a particle system that casts shadows? I assume one would need the proper shader, but I don’t know if billboards cast shadows at all.
is it possible to create an “invisible” material that still casts a shadow?
For a horror scene, I’d like to have some invisible creatures that still have shadows, so the player can spot them and react to their shadows, which gives him the additional challenge of having to guess at their positions giving the light sources in the room (some of them fly or float, so it’s not as simple as looking where the shadow ends).
Unfortunately, it doesn’t seem to play nice with particles - this is a dog engulfed in shadows and flames (mesh itself invisible, with your shader) - unfortunately, where the mesh is, there are strange effects. It distorts on movement, like the old “hall of mirrors” effect that I haven’t really seen since Duke Nukem 3D.
I’m using Unity 3, but I can’t get shadows to work on particle systems, despite the checkboxes being there (and checked). Neither casting nor receiving shadows.
I tried it out, and it needs a dummy Shadow Collector pass. This should work:
Shader "Shadows Only" {
SubShader {
Pass {
Fog {Mode Off}
ColorMask 0
Cull Off
Lighting Off
ZWrite Off
}
// Pass to render object as a shadow collector
Pass {
Name "ShadowCollector"
Tags { "LightMode" = "ShadowCollector" }
Fog {Mode Off}
ZWrite On
ZTest Less
ColorMask 0
}
}
Fallback "VertexLit"
}
As for particle shadows, there are definitely still some bugs. Make sure you’re using a shader that actually supports shadows (i.e. not one of the particle shaders), and you should at least get shadows cast from your system.