Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Batching with deferred Rendering/RealtimeLighting

Discussion in 'General Graphics' started by flogel, Apr 5, 2019.

  1. flogel


    Aug 10, 2018
    I recently switched a project of mine from forward to deferred rendering, because I want to use more complex features like realtime shadows and realtime gi. I spend a good time on optimizing the project, while still not using these features and learned a lot about saving drawcalls and so on, but with deferred and those realtime effects, it seems the rules change quite a bit! I really want to understand more about batching and game developement limits in general and many questions are hardly answered anywhere. So maybe some of you know more about these technical rules, that work under the hood of unity and would help me out here!


    1. How many drawcalls are ok in general? (platform pc) I know less are better, but i don't really have anything for comparison- Are 500 bad? Still ok?? (Vr applications for example recommend around 100 i think)

    2. In the profiler under the rendering tab, you can see setPass calls, drawcalls and batched drawcalls. Should i take more care for setpasscalls than drawcalls? Atleast on setpasscalls, i can understand if they go up or down, for example when i activate objects in my scene. Drawcalls in comparison skyrocket the number in some cases by 50 up (and i have no idea why or if thats just normal?) Also do drawcalls and batched drawcalls talk about the same drawcalls? Or are both together the total number of drawcalls in my scene?

    3. Does it make more sense to write a custom surfaceshader with less shaderoptions than using the normal standard shader? I read the standard one produces more things, that are not needed.

    4. In the Gamewindow, Shadowcaster are indivually counted, while in the Framedebugger, you can see, that atleast in my scene, they get batched into a few batches. Now which number can i trust more? Wouldnt the stats then reduce too, if the shadowcaster get batched into one object?

    5. In which way are Realtimeshadows influence batching?

    6. Also realtime GI seems to break batching to some extent (The batch error is "different light probes" which disappears, if i deactivate realtime gi). Is there a way to reduce this?

    7. And at last, if realtime Shadows/Gi break batching this bad, is there even a way to save performance? Many games i see today use realtime shadows and gi, and i cant imagine that they just ignore batching-

    I hope somebody has some answers to these questions. It's really harsh to know, that on screen it looks ok, but that under the hood everythings messed up, as well as this might lead to performance issues, once i add more assets..