- Home /
How does Unity decide whether to rely on baked lightmaps or cast dynamic shadows?
In my game I want to use the baked lightmaps wherever possible (I like the way they look and they're fast) and only use realtime dynamic shadows with things that move. (The character, moving platforms, etc.) Right now, a lot of my static geometry is both baked into the lightmap and generating realtime shadows - when my camera moves close it fades from the lightmap to the dynamic. It looks not-that-great-imo when the character moves close to something and its high-detail shadows pop into view.
So, I can't switch to Lightmap Only because I want dynamic shadows on some things.
I can't turn Cast Shadows off on the static geometry, because then they don't cast shadows when baking lightmaps either.
I tried putting something in the game which went through all the meshes, and if they were static, turned their CastShadows off, but turns out isStatic is an editor-only thing.
Unless someone has better advice, the next thing I'll try is an editor script that turns CastShadows ON or OFF for all the static meshes; and I'll just run that before and after I bake lightmaps, but I'm hoping there's something easier.
If static geometry is using dynamic shadows at close distances to the camera then you are probably using dual-lightmaps. If you want static objects to only have lightmaps then you should use single lightmaps.
Your answer
Follow this Question
Related Questions
Terrain with Baked and Realtime Shadows 0 Answers
Realtime shadow + baked lightmap on iOS is big different from PC 0 Answers
Baking results are looking very poor after using different settings 1 Answer
weird baked lightmap artfacts between gameobjects next to each other (pic provided) 0 Answers
How do I fix these lightmap spots? 0 Answers