This is the documentation for Enlighten.

Lightmap lighting models


Enlighten can produce output representing indirect lighting information in several different ways. This section describes the different options, and the memory and performance trade-offs involved.

Irradiance only

The simplest and least expensive option (in terms of both memory and computation time) is to generate irradiance only. In this case, the output is a single texture of RGB intensity values representing the amount of indirect light arriving at the surface. This output is only suitable for lighting very simple geometry; because there is no directional information, the indirect lighting does not vary when the normal of the shaded pixels changes. This means that normal maps and complicated geometry that have been projected onto a target appear "flat". The Cornell Box is an example of an asset which only requires irradiance, because it has no target projection or normal maps.

Irradiance-only may be useful in a few special cases (for instance, distant LODs in a large world), but in practice most game assets need extra information.

Irradiance + fixed directional information

When Enlighten precomputes its irradiance data, the solution includes the sense of which direction is "forwards". In other words, the irradiance result is the correct indirect lighting value for any geometry which faces in the same direction as the radiosity normal used in the precompute. Often, all that is required is that the lighting varies as the pixel normal moves away from this dominant direction. For example, this is enough to make normal maps and detailed projected geometry visible.

One simple way of doing this is to treat the incoming irradiance as a hemispherical light coming in along the radiosity normal (so that geometry facing in other directions is shaded progressively darker). In order to do this, the only extra information needed is the normal direction that was used to precompute the irradiance data initially. For this reason, the Enlighten precompute generates a .dds texture (for use on PC) containing this radiosity normal information.

Additionally, the fourth component of this texture is used to store a "skylight factor". This represents the proportion of the incoming irradiance light which comes from the environment map. In GeoRadiosity, the Irradiance + Skylight renderer mode uses this factor to add in an appropriate amount of skylight shading for geometry facing away from the main irradiance normal. In practice, particularly for outdoor scenes, good lighting results can be obtained just using dynamic irradiance and this fixed data, without having to generate extra dynamic directional information. See also Irradiance with skylight.

Directional irradiance

Higher quality lighting results can be achieved with dynamic directional information. The cheaper option here is "Directional Irradiance"; optionally, the irradiance solver can generate an extra texture which contains the dominant direction of the incoming light. The GeoRadiosity Directional irradiance renderer mode then treats the incoming irradiance as a hemispherical light centred around this direction. (Compare this to the previous option, where the direction of the hemispherical light source is fixed.)

The Directional Irradiance renderer mode also implements indirect specular lighting; a dynamic directionality texture is enough extra data to produce a reasonable result.

Colour-separated directional irradiance

Standard "Directional Irradiance" generates a single extra texture containing the dominant direction of the incoming light based on luminance. Whilst this is a cheap option it can fall short when the colour of the incoming light varies strongly with direction. Take the example in the screenshots below where red, green and blue indirect lighting of comparable luminance is being used to shade a normal-mapped surface using "Directional Irradiance". Notice how in the left image the colour of the indirect lighting on the the circular raised areas does not vary with surface normal. In contrast to this, the right image shows the same scene rendered with "Colour-separated Directional Irradiance" which uses a separate directional texture to encode the dominant direction for each component of the incoming light. This option uses three times the memory required for standard "Directional Irradiance" and takes on average approximately 1.5 times longer for Enlighten to compute at runtime but the visual quality can be much improved in certain lighting scenarios. The Directional Irradiance with Colour Separation renderer mode in GeoRadiosity implements this technique. The indirect specular lighting in this mode is computed by averaging the dominant directions for each colour component before using the method employed by the standard Directional Irradiance render mode for a single direction.

Directional irradiance (left) vs Colour-separated directional irradiance (right).