I have a semitransparent object that needs to cast shadows based on its transparency (the more opaque a part is, the stronger the shadow must be). For what I’ve read, the only way to implement this in Unity is with dithering (Rendering 12), but it looks awful. Is there any other solution?
Nope.
Well, yes. You could implement your own lights & shaders and manually render out your own shadow maps using a shadow mapping technique that does support transparency* and use that instead of anything built into Unity.
* Note, these are all terrible too, just in different ways.
Or you can try something like this which does a better job at blurring the shadow maps:
Or you can fake it with a projection of some kind.
Would a light cookie work?
Also, how does the light cookie work for directional lights? I want to do some calculations but I’m not sure about the maths behind the projection.
Thank you.
Could, except it’ll also cast onto the object your trying to get a shadow from. Shadows may not cast onto transparent objects, but light cookies do.
Honestly, no idea. I’ve always skipped using light cookies and implemented it myself manually in the shader so I have control over those kinds of questions. ![]()