- Home /
How to make shadows react to a mesh with holes
I'm working on a apocalyptic game and to fit the setting, I have some boarded windows, well right now the shadows aren't reacting, and lighting isn't being cast into the rooms. (See screenshot) I'd like to have the shadows of the boards all visible, and have the light shine into the room. How can I achieve this? Thanks.
Answer by flaviusxvii · Sep 03, 2014 at 10:24 PM
I think the problem is that you have a texture with transparent parts, but the mesh itself is solid, and if the shader drawing the mesh isn't set up to not write depth values for the transparent parts, the shadow engine will see it as solid (it has depth) and cast a shadow for that part, even though the texture is transparent.
You can make a shader that takes the transparency into account, or you can make the mesh more detailed so that the transparent parts really don't have any mesh to them.
This will help with writing a shader. http://docs.unity3d.com/Manual/SL-AlphaTest.html
That can't be the problem, because it is a model with the holes into it. If I pull the boards out of the windows, the shadows work on the ground. Just not casting into the house.