- Home /
How to use Emissive Materials with Global Illumination parameter set to Realtime?
Hello, could we please get reliable information from developers about how should we use realtime emission?
Manual simply states: "Realtime - The emissive light from this material will be added to the realtime global illumination calculations for the scene, so the lighting of nearby objects, even moving objects, will be affected by the emitted light." Sounds pretty easy, right? :)
Wrong, because simple change of material parameters from inspector do nothing. From forum topics I know that we should call some functions from code to set material properties and then some functions to recalculate environment. But it is absolutely unclear which functions exactly? In one topic people say we should use Material.SetColor and then DynamicGI.UpdateEnvironment others say we must use DynamicGI.UpdateMaterials, third person assure that DynamicGI.SetEmissive is only function we need. On the other hand Scripting API on DynamicGI.SetEmissive warn us that subsequent DynamicGI.UpdateMaterials call on any renderer within the system will clear the effects of DynamicGI.SetEmissive... Situation get even more messy considering the fact that all those methods have almost no explanation in Scripting API when should we use them.
And what about LightProbes, should we update them manually after changing emissive material parameters?
Would be very nice to have precise instruction and ideally include this instruction into documentation. Thanks in advance!
Answer by Garrettec · Jul 28, 2017 at 06:56 PM
For those who will seek answer, @kemalakay answered me here.
Short answer is that you should mark your object static, assign a realtime emissive material and use DynamicGI.SetEmissive function to update your emissive property with realtime GI. That is all, this function will take care of LightProbes.