Search Unity

Bug Lens Flare consumes too much performance on the CPU and GPU

Discussion in 'High Definition Render Pipeline' started by PutridEx, Oct 20, 2021.

  1. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    Lens Flare costs around 0.85 - 1.1ms on the CPU, and around 0.85 on the GPU.
    The CPU cost is reduced to 0.35ms - 0.50ms in a build. GPU cost remains the same.

    Built-in lens flare cost for example is 0.003.
    Although HDRP's lens flare is much better in all regards, feature wise
    It still feels too much of a performance cost for a lens flare.




    Case 1374619
    GTX 1070
    i7-6700HQ

     
    Last edited: Oct 22, 2021
  2. SoufianeKHIAT

    SoufianeKHIAT

    Unity Technologies

    Joined:
    Jan 16, 2020
    Posts:
    7
    Hello,

    Thanks for the feedback, could you tell us more about your test case.
    How many LensFlares? How many elements per flare?
     
  3. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    using the polyCount lens flare asset that comes with the HDRP template (b16).
    - 1 lensFlare, 9 elements.

    Although, originally when i tested this, the CPU cost was always there. Whether the lens flare was showing or not.

    I just tested in my own scene, and there that's not the case. Unless I'm activating the lens flare by looking at the sun, the majority of the performance cost isn't there. Both for the CPU and GPU, even when I'm looking, the CPU cost is lower than previously stated, although the GPU cost is the same.
    the 'always there' issue is there in the HDRP template.


    in my own scene, the GPU cost is around 0.75-0.85, one lens flare and 9 elements. on a laptop GTX 1070.
     
    Last edited: Oct 25, 2021
  4. zhn17

    zhn17

    Joined:
    Jul 30, 2019
    Posts:
    52
    Experiencing the exact same, it's using way too much performance in comparison to the legacy one which could be used more extensively.