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

Is there any way to change emission color at runtime without Realtime GI?

Discussion in 'Global Illumination' started by dgoyette, Jan 9, 2020.

  1. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,193
    I'm in the process of evaluating whether I can ditch Realtime GI, and use Baked lighting instead. So far the trade-offs are manageable, but I've found one disappointing downside: I can no longer use dynamic emission color. My goal is to be able to change emission color at runtime, and have that light nearby objects. My assumption is that this will require Enlighten, but I was wondering if there was anything I'm missing that would allow me to do this without Enlighten.

    Here's an example. I have one emissive cube, and some other static and dynamic cubes in a static room. If the emissive cube is not lightmap static, it looks like this. No emission color on anything nearby:

    upload_2020-1-8_20-53-6.png

    If the emissive cube is lightmap static, then it will make the emission into nearby objects.

    upload_2020-1-8_20-56-39.png

    I can change the emission color at runtime, but it won't affect any nearby objects:

    upload_2020-1-8_20-58-54.png

    This whole area is full of light probes, which is how the emission is getting applied to the dynamic cubes.

    Anyway, I'm pretty sure the answer is that only Realtime GI will allow this to work, but I'm hoping maybe there's some other approach I could take to continue to have dynamic emission without Realtime GI.
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,631
    Well...

    You could place a realtime point light (preferably without shadows) in that cube and always make sure it has the same color as the emission :)

    This will work for the example you posted, but if you have a more complex shape/environment it may not look good enough, but on the flip-side, you can now move the cube + light around and it will still cast light properly.
     
    dgoyette likes this.
  3. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,193
    That's worth trying, thanks for the idea. Most of the emission I'm using isn't too precise, so a vague amount of light is probably good enough.
     
  4. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    Light is additive, you probably can bake the light without the emissive, then bake only the emissive intensity, then blend the non emissive baking with the emissive tinted by the color you need. Now this only work with monochromatic light, and you need as many emissive baking as you there independant monochromatic emissive source, UNLESS the result don't overlap, then you can have multiple bake on a single map, and use a mask to select which part receive which color.