Hi guys and girls!
I have indoor scene with baked Realtime GI. Also there is lightmapped emissive object(TV Screen) with “Prioritize Illumination” enabled. VideoPlayer component sets Emissive chanel of Standard Shader material from the source video. Every frame renderer updated with next line:
RendererExtensions.UpdateGIMaterials(MyRenderer);
So everything around starts blinking like it’s real TV screen. Also it matters what on the pixels of screen. So if I fill left side of screen with green and right with red, object at left side will be lighten with green and on the right with red color. Realtime area light from texture!!! Ambilight! Just look how it works:
So what is the trouble? As for me the light is too dark:
I want to make light brighter and add brightness to HDR emissive color picker. But it makes screen overbrighten:
I know that middle value could be suitable in this situation, but I have also other scenes, where it does not. Anyway I have goal now!
So I tried to search for some workarounds. At first I’ve tried next method:
MyRenderer.material.SetColor("_EmissionColor", brightHDRColor);
RendererExtensions.UpdateGIMaterials(MyRenderer);
MyRenderer.material.SetColor("_EmissionColor", defaultHDRColor);
A made that in Update(), LateUpdate() and in Coroutine but that doesn’t worked. Color applied only from default color.
Then I’ve found a way to set emissive for a renderer:
DynamicGI.SetEmissive(MyRenderer, brightHDRColor);
Look! This way closer than anything, but there is one issue…
This operation statically sets GI emissive color for Renderer instead of material and shader outputs. Should work for static light sources. But I have a dynamic video with a complex realtime baked emission map:
I’m lost and out of ideas. Does anyone know how Unity Engine works internally and is there any way to set emissive brightness for GI separately from rendering surface?