Search Unity

CullPerObjectLights Performance

Discussion in 'Editor & General Support' started by TheFallenOne222, Mar 28, 2019.

  1. TheFallenOne222


    Feb 23, 2018
    Hey everyone,

    I'm currently working on a project that has a very large, very dense world. I'm working on optimizing performance at the moment.

    We're on Unity 2018.2 (started on a much earlier version, and have worked our way up, so still on the built-in pipeline, not LWRP or HDRP), and quite a while ago we made the decision to use Deferred rendering, due to the benefits to real time lighting performance.

    Fast-forward to now, and lighting is starting to become a performance issue. Lighting costs for deferred are fine (very low), not concerned there, but even with everything rendering in Deferred (according to the Frame Debugger, there is not a single render occuring in Forward right now - though there may be a couple objects that are culling that would normally render in Forward)... The cost for "CullPerObjectLights" (under RenderForwardOpaque.Prepare) has reached a staggering 70ms per frame cost in the more open areas of the world, even with not a single forward object being rendered.

    I have absolutely no desire for anything to render in Forward, and have done almost everything in my power to ensure everything is following the Deferred rendering pipeline, and yet this cost persists. Is there any way to help reduce this cost? We're in the process of doing further mesh merging in the scene (at the cost of some batching and higher vertex costs) just simply to reduce the number of objects in the scene, hoping it helps resolve some of it.

    Is there any way to fully disable Forward lighting, Forward rendering, or at least turn lighting off on all forward objects so that Unity doesn't try to do a lighting culling pass on it?

    I'm quickly running out of ideas, so any thoughts or direction is greatly appreciated. Thanks in advance. :)