Search Unity

Enlighten GI can't catch up to my muzzle flash lights.

Discussion in 'Global Illumination' started by cubrman, Feb 9, 2019.

  1. cubrman

    cubrman

    Joined:
    Jun 18, 2016
    Posts:
    412
    Basically I have muzzle flash lights that last for roughly 2 frames. Even if I set CPU usage for GI to unlimited, the global illumination light for my muzzle flashes only appears around half a second after the actual muzzle flash. Is there any way to force Enlighten to recompute the light exactly the same frame as my muzzleflash appears?
     
  2. Kuba

    Kuba

    Moderator

    Joined:
    Jan 13, 2009
    Posts:
    416
    Hey @cubrman,

    You should really stick to having Enlighten working asynchronously, as not to affect your framerate. The best advice I can give is to really lower the amount of systems / probe sets that are loaded at the same time and keep the resolution as low as possible. Additionally keep only the big structures as lightmap static and light most things with light probes. That will mean that Enlighten has the smallest amount of work to do and will come up with new results quickly.

    Please note that the resolution parameter is the amount of texels in one dimension, so e.g. increasing it from 1 to 2 will increase the amount of work for Enlighten by a factor of 4.

    Using the DynamicGI.synchronousMode you can force Enlighten to provide a new output each frame, but that will most likely make your game unplayable considering that your update seems to take around 500ms right now. So I'd strongly suggest following the advice above first.

    Cheers,
    Kuba
     
  3. cubrman

    cubrman

    Joined:
    Jun 18, 2016
    Posts:
    412
    Thanks for a detailed response.
     
    Kuba likes this.