Sorry in advance for this lame question but I’m a non-programming artist.
I have been pouring over all the info in the Unity forum including all of the ShaderLab stuff in the wiki but can’t quite get a handle on this specific issue.
I thought that I had a clue about using a shadow collector call from a CGPROGRAM. But, of course, VertexLit already has both the shadow collector and shadow caster code. I tried messing with that but to no avail. After reading more of Aras’ posts, it seems like vertex lighting might be too simple for shadow receiving. I am now wondering if I can just add an extra emission variable to the Diffuse shader so I can brighten things up. It might not be as cheap as the VertexLit shader but it will allow me to illuminate certain materials and really cut down on my need for extra lighting. My goal is to add brightness to an object via the emission slider so I don’t have to use an alpha map for illumination. The slider would also allow me to change the object’s brightness as I change the scene’s lighting. Sorry, I’m rambling… Basically, VertexLit gives me the exact look and control that I want but needs to accept shadows.
Please let me know if you can point me in the right direction.
:roll:
Yes, your best bet is to add illumination to Diffuse (or use one of Self-Illuminating shaders if that suits you).
VertexLit is vertex lit, and by definition it can’t receive shadows (shadows need pixel lit shaders).
The “shadow collector” pass is not for receiving shadows. It’s the pass to collect shadows into a screenspace buffer that is used by directional light when cascaded shadow maps are used. Whew, that was a long sentence.