My scene is a large-ish outdoor scene, populated by models whose import settings are mostly setting “Normals” to “None” and a custom vertex-color shader — which uses the PBR Master node — for a flat look. Here it is in Scene View:
All the objects, except the two characters, are static. So, I assume that I should bake the lighting and shadows for performance reasons (This project is for desktop and mobile.)
From the documentation, it seems like setting the Light Mode to Mixed, enabling Baked Global Illumination, and then setting Lighting Mode to Subtractive would get me what I want — “Mixed lights provide baked direct and indirect lighting for static objects. Dynamic objects receive realtime direct lighting and cast shadows on static objects using the main directional light in the scene.”
My questions
Is this a correct assumption? Is there really a performance gain to baking all the lighting and shadows to a texture? Or, for a scene like this, is realtime going to be just fine? (Is there a difference for mobile and desktop.)
I can’t get my shadows to bake when I follow the steps above. After the bake, the general lighting is baked, but the shadows are still realtime. When I disable the scene light, the shadows vanish. My objects are all static. I just can’t figure it out. I’ve tried a bunch of obvious things, but any any obvious things to try would be very much appreciated. Or, am I just going about this the wrong way?
Another way to ask these questions: How can I bake my shadows?! And should I?!
Yes, there should be a huge performance gain (compared to real-time shadows, but probably not a large gain compared to no shadows), but baking such a large scene will use a lot of memory. And there is no way way you will get shadows as sharp as that. You can check the lightmap size in MB when it’s completed. It will add to your program download size.
For baking, objects have to be set to Lightmap Static or Contribute GI (bad name) based on Unity version. Or Mesh Renderer > Lighting > Contribute GI. Lights have to be set to Mixed.
Are you sure baked global Illumination selected ?
Mixed Lighting should be checked else it will not work .
If set then even after turning off main light shadow will be visible which is baked.