You copied the Doc URL to your clipboard.

Setting up a scene with Enlighten

This section provides some general tips on how best to set up a scene with Enlighten in Unity.

Turning off lightmap baking

For real-time feedback on your lighting, and to enable a faster iteration time, set up your scene as if you are only using real-time global illumination. Do this even if you only plan on using baked light maps. An advantage of setting up a scene for only real-time global illumination is that for more powerful target platforms you can enable real-time lighting, whereas for less powerful target platforms you can use baked light maps.

When you are happy with your lighting, you can turn on light map baking for all the required lights. Enlighten is responsible for both the real-time lighting and the light map baking, so the baked light maps match the real-time rendered results, with differences only visible in soft shadows and area lights.

Setting the Enlighten light map resolution

The most important metric to optimize for is the Enlighten light map resolution. In a simulated real-world scene, with human sized characters, you typically set the texture resolution to be one pixel per meter. Smaller scale details are best handled with screen space ambient occlusion.

Optimizing the precompute

The UV Charts visualization mode is usually the best view mode to use for setting up a scene for Enlighten in Unity. Meshes are only rendered in this mode when a pre-compute is started. However, the packing is the first stage in the precompute and Unity updates the results when a stage is finished.

The packing stage is quick to compute. If it takes a long time for meshes to appear in the UV Charts render mode, then the resolution might be too high. To test whether the resolution is too high, decrease the resolution and then rerun the precompute. The precompute is triggered automatically, unless you have deactivated it.

When you have adjusted the resolution to your requirements, wait for the pre-compute to finish. If you notice lighting artifacts such as light leaking, use the UV Charts render mode again. Enlighten does not split input charts, and charts that go through a wall can leak. A typical example is a floor mesh that spans multiple rooms and only has one chart. In such cases, consider creating smaller charts by splitting and separating the input UVs.

Adjusting the scene elements

When the precompute has completed, you can add lights and get instant feedback about the overall scene appearance. This is not limited to light sources and their position.

You can also change material properties, such as surface color, texture, or emissive settings.

With Enlighten, any surfaces can be set up to emit light and can therefore be turned into an area light. These area lights have the benefit of having no associated render cost because all their lighting is done by Enlighten. This can be useful for lower-end mobile devices, where the number of dynamic light sources is very limited. Use the Important GI checkbox in the object panel for emissive surfaces, especially if they are small, because this ensures that the clusters for these surfaces are not merged with other clusters.

Lighting small objects with light probes

Consider lighting smaller objects in your scene using light probes instead of light maps. To use light probes, do not click the Lightmap static box.

Typically, smaller objects do not contribute much to the global illumination and setting them to be probe lit removes them from the pre-compute stage, making the pre-compute faster.

Smaller objects are often also more difficult to generate UVs for. You can also merge the meshes of smaller objects with larger objects, such as the TV and the wall in the example that is used throughout  Precompute.

Was this page helpful? Yes No