In this lesson, you will learn how to configure emissive materials to act as effective light sources that contribute correctly to your scene's Global Illumination (GI) calculations.
When you use an emissive material to light a scene, Unity’s lighting engine must decide how much light "bounces" off that object to illuminate the surroundings. Simply cranking up the Emission Intensity in the standard shader is often not enough for high-fidelity GI, as the engine treats geometry differently depending on its static flags.
Configuring Static Lighting
For an emissive object to contribute to baked lightmaps, you must first ensure the GameObject is marked as Static in the Inspector. Once marked, you must navigate to the Mesh Renderer component and ensure the Contribute Global Illumination setting is enabled.
In the material settings, you must specifically set the Global Illumination property to Baked. This tells the Progressive CPU Lightmapper to treat your emissive surface as a light emitter rather than just a bright texture.
Performance Optimization
Because emissive surfaces are computationally expensive to calculate for GI, avoid large, complex meshes with high-intensity emissions. If you have an emissive texture, use the Falloff settings to ensure the light doesn't bleed unnecessarily into distant geometry.
// Example: Dynamically updating emissive intensity via script
// Ensure the material has 'Enable Keyword _EMISSION' set for performance.
material.EnableKeyword("_EMISSION");
material.SetColor("_EmissionColor", color * intensity);
DynamicGI.SetEmissive(renderer, color * intensity);
When using DynamicGI.SetEmissive, you are forcing the GI system to update the lightmap data for that object during runtime. Use this sparingly, as frequent updates can cause significant spikes in CPU usage. For most environment props, rely on the static baking process to pre-calculate the bounce light, allowing you to achieve rich, realistic lighting without the overhead of real-time point lights.
Key Takeaway: Always pair "Static" geometry flags with "Baked" GI material settings to ensure your emissive surfaces contribute to lightmaps efficiently without incurring the heavy cost of real-time light simulation.