Search Unity

Light Probes vs 1 Realtime light

Discussion in 'Global Illumination' started by NestorAlgieri, Nov 22, 2018.

  1. NestorAlgieri

    NestorAlgieri

    Joined:
    Sep 11, 2011
    Posts:
    299
    Hi. I just recently realized that when light probes are used more draw calls are needed because dynamic objects that use different probes are in different draw calls. I know it's been documented that we should use light probes instead of realtime light. I wonder, if I just use 1 directional light to light the dynamic objects instead of hundreds of probes, which one would in theory be better for mobile. I know it would sacrifice the aesthetics a little as all objects will now have same lighting, but would the performance be better due to less draw calls in theory?
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,791
    Dynamic objects need different draw calls anyway though. (Unless they are dynamically batched, which has very restricting rules).
     
  3. NestorAlgieri

    NestorAlgieri

    Joined:
    Sep 11, 2011
    Posts:
    299
    Hi yes that what I mean. With probes, they end up not being batching, but with realtime lighting they are batched. So I wonder what's worse, many draw calls but no dynamic light calculation, vs 1 draw call from 1 realtime light but with realtime light calculations.
     
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,791
    Are they? I'm not sure that's true?
     
  5. NestorAlgieri

    NestorAlgieri

    Joined:
    Sep 11, 2011
    Posts:
    299
    I used frame debugger to check. The only ones that didn't get dynamic batched are if they are over 300 verts. But the lighting looks horrible because it doesn't match the scene. But yeah, I wonder if drawcalls are worse or dynamic light. I guess I'll have to profile it with a test scene as it doesn't seem like something people talk about.
     
  6. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Performance is scene dependent so you have to profile to find out what works in your case. Will instancing work for you? Since Unity 2018.1, light probes are supported by GPU Instancing.
     
  7. NestorAlgieri

    NestorAlgieri

    Joined:
    Sep 11, 2011
    Posts:
    299
    I wish I could use it. But gles3 performance quite bad compared to gles2 for lower end devices. So with instancing it actually performance worse due to gles3. :(