Search Unity

Baking Lights -> Dynamic Light = Flashbang

Discussion in 'Global Illumination' started by CortiWins, May 14, 2019.

  1. CortiWins

    CortiWins

    Joined:
    Sep 24, 2018
    Posts:
    150
    Hello!
    i'm more than a little confused with baking lightmaps. For some reason, spawning a small light leads to a massive blinding flash effect. ( See image )

    This seems to be related to the "indirect intensity". Setting this to 0 "fixes" the flashbangs, but also deactivates nice things like emissive lighting. A value like 0.001 reduces emissive lighting to nothing but still gives massive flashbang-effects. The lights intensity is fine on nonstatic objects and surfaces.
     

    Attached Files:

  2. thefranke

    thefranke

    Unity Technologies

    Joined:
    Jun 20, 2015
    Posts:
    153
    Hey CortiWins,

    so to get this right: You are baking a scene, and once you bake with this light source the baked results are overly bright, is that correct?

    What light source is that? A point light? Which intensity does the light have? Are you using the HD Render Pipeline?

    Also, remember that the indirect intensity on the light is not the only modifier. In the Lighting window you can set another global indirect intensity modifier in the Lightmap Settings category.

    Cheers
     
  3. CortiWins

    CortiWins

    Joined:
    Sep 24, 2018
    Posts:
    150
    Hello @thefranke ! Thanks for taking the time!

    The light come from the gun, it's part of the particle system. It's set to shine a light on the gun itself and the area around the player. The light is set to a radius of 2 and an intensity of 3. Both screenshots are taken in the same situation within a second of each other.

    The light works fine on meshes that are not static and thus, not lightmapped, or static and set to be not lightmapped. The range and intensity of the light still works as intended on non-static meshes. Only the lightmapped surfaces are going bright. The duration until the brightness fades is dependend on the indirect intensity.

    I'm using the standard renderer. No HDRP, no LWRP.
     
  4. fguinier

    fguinier

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    146
    Hey CortiWins, Are you using prebaked lighting or realtime gi ie enlighten?
     
  5. CortiWins

    CortiWins

    Joined:
    Sep 24, 2018
    Posts:
    150
    Hey @fguinier !

    Realtime Global Illumination: true
    Baked Global Illumination: true
    Lightmappter: Progressive
    Flash on lightmapped surfaces: 4 Seconds

    Realtime Global Illumination: false
    Baked Global Illumination: true
    Lightmappter: Progressive
    Flash on lightmapped surfaces: none

    Realtime Global Illumination: true
    Baked Global Illumination: false
    Lightmappter: Progressive
    Flash on lightmapped surfaces: 4 Seconds

    Between Progressive & Enlighten i had to reduce the intensity of materials significantly because whats fine for progressive is far to bright for Enlighten.

    Realtime Global Illumination: true
    Baked Global Illumination: true
    Lightmappter: Enlighten
    Flash on lightmapped surfaces: 4 Seconds

    Realtime Global Illumination: false
    Baked Global Illumination: true
    Lightmappter: Enlighten
    Flash on lightmapped surfaces: none

    So it seems to be "Realtime Global Illumination" that causes it. Makes the whole architecture blink. The behaviour doesn't look very intended to be honest. Any more settings i could try?
     
  6. fguinier

    fguinier

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    146
    The problem probably come from the low frame rate of enlighten updates. Enlighten by nature compute light update on many frames, thus it is not designed to handle short but intense lights. In your case you could try to optimize you scene so enlighten can iterate faster or more simply just disable the bounces from this particular light.
     
  7. CortiWins

    CortiWins

    Joined:
    Sep 24, 2018
    Posts:
    150
    Ahh, setting the "Indirect multiplier" of these flashing lights to 0.0 removes the flashing surfaces.

    The scene itself is the minimal setup of a black room with an emissive plane, so real world scenes would be more complex than that.