Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

10x more draw calls with Mixed Lighting on static objects

Discussion in 'Global Illumination' started by Acissathar, Feb 6, 2019.

  1. Acissathar

    Acissathar

    Joined:
    Jun 24, 2011
    Posts:
    628
    Hi all,

    I feel like I might be misunderstanding how mixed lights are supposed to be working based on what I've read and experimented with.

    The house I have is completely static, every object in or a part of the house is marked as static (double checked Lightmap static is checked as well) with the only dynamic object being the character.

    When the lights are set to baked, I get roughly 3-400 draw calls. When I set them to mixed, then regenerate lighting, I get 3k-4k draw calls as if everything is being treated as dynamic in real time lighting.

    Shouldn't I be getting something only slight above the baked lighting since everything should be baked except for the character object?

    I'm in 2019b1 and using Progressive GPU.

    Here is my lighting tab:

     
  2. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    762
    Hey! Which render path are you using for your project? Is it forward or deferred?

    In the forward rendering path, each realtime/mixed light will cause an object to be rendered twice. So if your scene contains a lot of lights, this might be the reason why you are seeing a spike in drawcalls.

    Try switching to deferred render path (either in graphics settings, or by overriding the option in the camera settings), and see if that helps.
     
    emont and Acissathar like this.
  3. uy3d

    uy3d

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    187
    Depending on the selected light mode and light settings, the static objects will still be rendered into shadowmaps, so that will also increase the number of draw calls.
     
    Acissathar likes this.
  4. Acissathar

    Acissathar

    Joined:
    Jun 24, 2011
    Posts:
    628
    Currently in deferred where I'm seeing the large increase.


    Which light settings specifically? Is there a group of settings to just bake the static object shadows and only have the dynamic object have a constantly updated shadow? The lights inside the house are never changing, so the shadows for the static objects should remain the same.

    I've noticed that with actual Baked lights I'm not even seeing any shadows, and when using Mixed, the shadows appear.


    Thanks!
     
  5. uy3d

    uy3d

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    187
    This is controlled by the light modes, you can drill down into details from the documentation here:
    https://docs.unity3d.com/Manual/LightModes.html
    Static geometry can cast shadows on dynamics either through "distance shadowmask" mode, or just "shadowmask", but then you'll need to set up probes to catch the occlusion.
     
    Acissathar likes this.
  6. Acissathar

    Acissathar

    Joined:
    Jun 24, 2011
    Posts:
    628
    The distance shadowmask turned out to be my big hang up. Combined with the large shadow distance, everything was basically being treated like a dynamic object.
     
unityunity