- Home /
Is it possible to have a non-static object with a transparent shader material to cast opaque shadows?
Currently, when using the Standard shader in Transparency mode on an object, the shadows it casts are just really dithered / a pile of dots, and this looks quite bad no matter the detail.
Ideally, I'd love to have the shadows fading the same way as changing the Shadow Strength on a Light, but since this seems impossible, I decided to make ALL shadows completely opaque. My workaround is disabling the shadow on my transparent object, and make a duplicate object as a child to it, with another, opaque material, then setting the "cast shadows" property to "Shadows only".
I would just like to know if there's another way to render opaque shadows from transparent items, even better if there's been an update on how to handle transparent shadows. Otherwise I'll just stick to my workaround.
Answer by FortisVenaliter · Feb 10, 2017 at 08:45 PM
Nope, as far as I know, the workaround you mentioned is the best way to do it.
The reason is because shadows utilize a single depth-buffer to calculate, then apply the light's shadow strength afterward. So, with transparent objects, Unity applies dithering to the buffer, which is why it looks like the "pile of dots" to try to simulate the transparency.
Answer by corpsinheretoo · Feb 11, 2017 at 04:26 AM
The image below is of a shard of transparent glass flying through the air and casting a shadow so I know this can work. I think the difference has to do with the shader I am using: double sided glass (fast) from ciconia studios glass shaders Well worth the eight bucks I think.
His problem wasn't that it wasn't casting any shadow, it's that he wanted it to cast a partial shadow.
@FortisVenaliter you right. This should have been a comment and not an answer as I was suggesting a more elegant alternative work-around and not a solution to the actual problem.