No lightmap with mixed light

Simple scene:

  1. A floor
  2. A sphere above it
  3. A directional light

The floor and the sphere has the “Lightmap static” enabled.
*

  1. Case A: The “Mode” property of the light is set to “Baked”.
    As per the docs, we now have only lightmap on the two objects. This works perfectly whereever I go with my camera.

  2. Case B: The “Mode” property of the light is set to “Realtime”.
    As per the docs, we now have only realtime shadow that is visible only within a given distance. So I have to approach the objects and look at them closely enough to see the realtime shadows. Despite they are marked as “Lightmap static”, Unity renders realtime shadows for them.

  3. Case C: The “Mode” property of the light is set to “Mixed”.
    Here my problems come. As per the docs, this way a single light is able to take care of both static and dynamic objects shadows. However if I use this option, the shadow of my static objects is only visible from a close distance. Why? I realized that actually it renders only the realtime shadows for the static objects too.

To be honest I don’t really understand this approach. Let’s say I have a few buildings on a terrain and a character that I control from a 3rd person camera.

My questions

  1. How can I set up my scene, to see both the cheap static lightmap on the ground even from greater distances and the more expensive shadows of the dynamic objects that are close to the camera?

  2. Is it possible with a single directional light?

  3. Why is it called mixed, if it’s not using the baked lightmap, but the dynamic shadow map only?

I really appreciate your help. I might seem to be a beginner and you are totally right, so I hope the solution is just a few easily understandable sentence. :slight_smile:

1- The key you are looking for is “subtractive” lighting mode which can be reached from the lighting settings → mixed lighting section. This mode will allow the lights marked as mixed to provide baked shadows to static object while still providing a real-time shadows to non static objects.

2- Of course.

3- Well it’s a bit confusing since there are 2 places to change the lighting mode from (the light itself and the lighting settings). By default shadow mask mode is already selected which means the mixed lights will provide only run time shadows to both static and non static objects in addition to baked indirect illumination (hence this is why it’s called mixed) and by the way shadows are result of direct lighting calculations not the other way around.

Hope this answers your questions :slight_smile:

Oh my god. Firas4d, you saved me scene. Was messing around with lighting for days now and after hours of baking this is the setting that fixed everything!
Thanks 4 that! :slight_smile: