Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

EnlightenRuntimeManager Update framerate spikes

Discussion in 'Global Illumination' started by SanityIsOverrated, Mar 25, 2017.

  1. SanityIsOverrated

    SanityIsOverrated

    Joined:
    Dec 22, 2013
    Posts:
    31
    Hello there,

    we hope for some insights regarding our performance issues.

    We have an underwater scenery of static geometry (Terrain, rocks) and non-static objects (harvestable resources, but a lot of it is rendered with gpu instancing). We want to have a Day/Night cycle and thus we have a directional light that rotates in the sky.
    With the moving directional light, performance got really erratic. It happens only in a standalone build. I have attached the profiler to the standalone build and found huge spikes every 0.1s (which is the update rate of the directional light), that are caused by Enlighten. framerate_spikes.jpg
    If the light is not moving, performance is smooth.
    framerate_light_not_moving.jpg

    It's a bit disappointing that we cannot update indirect lighting in realtime, but it suffices if the light from the sun is a direct light only. Howoever, it seems our understanding of pre-computed GI is lacking. The documentation says
    on https://docs.unity3d.com/Manual/GlobalIllumination.html
    Shouldn't turning Bounce Intensity to zero exclude it from the GI calculations? But that does not get rid of the framerate spikes.

    Does anyone know how to setup a light with direct light only? Or better even a solution to the Enlighten performance issue?

    Best,
    SanityIsOverrated
     
    hippocoder likes this.
  2. SanityIsOverrated

    SanityIsOverrated

    Joined:
    Dec 22, 2013
    Posts:
    31
    I built a basic test scene with some static geometry and a rotating directional light that does show the same issue. The baseline fps is much better for the simple scene, but the framerate spikes appear all the same.

    It seems that the recalculation of the indirect light takes between 10-30 ms depending on the scene complexity. Might well be the case, but it is hard to manage a steady framerate with this.
    We don't actually care about the indirect light being accurate, for the purpose of the day/night cycle a single direct only light should be fine. This should be possible with a Bounce intensity of 0. I'm coming to the conclusion this is a bug.
    If I change the type of the light to a spot light, there is a warning in the inspector about realtime indirect bounce light not being supported for spot and point lights. This warning disappears if I set the Bounce intensity to zero. There is no framerate problem for this type of light that produces direct light only.

    I filed this as a bug 897482.
    Any chance someone from the unity team is seeing this post? I fear the bugreport gets buried under the pile, but to me this is a fundamental feature not working correctly.
     
  3. SillyBilly

    SillyBilly

    Joined:
    Jul 5, 2011
    Posts:
    62
    You chaps ever get any further with this? We're having the same problem and assumed the same (that setting the bounce intensity to zero would have prevented tampering with the GI calculations) but still getting these same spikes on builds on all platforms. :(

    A bit odd as surely this means it is impossible to achieve any kind of day/ night cycle without major performance issues outside of the editor. We're using 2017.1p1 and it's still an issue.
     
  4. SanityIsOverrated

    SanityIsOverrated

    Joined:
    Dec 22, 2013
    Posts:
    31
    Hello,

    yes, we got a workaround from Unity QA in answer to our bug report.
    A month later, we got another response, I presume from a developer at Unity:
    We're actually still using the first workaround... :S

    Best,
    SanityIsOverrated
    NIGHTBOX
     
    HaBe likes this.