- Home /
How do I exclude objects from shadow casting across layers?
I'm making a spaceship combat game where the player (and camera) is in the cockpit of their ship. The cockpit needs to be self shadowing, but I don't want other ships that fly by to cast shadows onto it because it makes the shadowmap too large, which creates visual artifacts. However, I also want the external spaceships to self-shadow.
Can I exclude the external ships from casting shadows upon the cockpit while still having them be self shadowed? I have them on separate layers with one directional light for each, but they are getting mixed into each other's shadow map extents. Can this be fixed?
Answer by andeeee · Feb 19, 2010 at 01:24 PM
Are you using the culling mask for the light, or is this not doing what you want?
Well, you inspired me to look at the docs on culling masks, and even though I was using layers and lights for this situation, it looks like what I need to do is have two cameras. The first renders the cockpit alone, not the external ships. The second renders everything else. I'm 99% sure this will enable me to cast exactly the shadows I want on the cockpit. I upvoted your answer for motivating me to read the docs more closely. :)
Your answer
Follow this Question
Related Questions
How to get pixelated shadows? 0 Answers
Shadow Maps - prevent updates 0 Answers
Getting depth value from Shadow map in shader 0 Answers
Accessing a shadowmap and using it in C# script to turn off colliders? 0 Answers
Shadows being received by non-shadow collectors that are depth culled by a shadow collector. 1 Answer