LightsprintSDK 2021.08.08
Illumination

Directional lightmaps / vertex colors

While building lightmaps, Lightsprint gathers information about light directions. This information is optionally returned in two formats.

  1. Directional component is stored as 3 separated lightmaps or vertex buffers built as if surface normals are modified in 3 different directions. Result is compatible with Unreal Engine 3 directional lightmaps. 3 lightmaps are sufficient for rendering, but together with standard non-directional lightmap (=fourth direction), all 4 lightmaps can be used for even higher precision.
  2. Directional component of lightmap or vertex buffer is stored separately from irradiance component. See Bent normals for details on directional component.

Global illumination lightmaps

Global illumination lightmaps are precomputed with infinite light bounces, color bleeding and physically correct penumbra shadows from area lights. For mostly static scenes, precomputed GI lightmaps make very good sense.

Global illumination usually contains sharp shadow edges, so it's not practical to store it per vertex in vertex buffer (result would be too blurry).

Ambient maps, per-vertex ambient

Ambient maps and per-vertex ambient contain indirect component of illumination with infinite light bounces, color bleeding and indirect shadows; it's complete global illumination except for first light bounce.

In scenarios with mixed static / dynamic objects, it's often advantageous to compute indirect illumination only and mix it with realtime rendered direct illumination with direct shadows.

Per-pixel or per-vertex?
Unlike global illumination, indirect illumination doesn't contain sharp shadow edges, so it's usually practical to store it per-vertex in vertex color buffer. Per-vertex ambient is slightly less precise in some situations, but it usually takes much less memory, so it's worth considering in memory restricted environments. In realtime scenarios, per-vertex ambient is preferred for higher speed over ambient maps.

Ability to generate ambient maps or per vertex ambient is fundamental for realtime global illumination. To render realtime global illumination, start with renderer with direct illumination and shadows and add ambient map or per vertex ambient computed by Lightsprint. Realtime per-vertex ambient is preferred for much higher speed.

Environment maps

Environment maps store light incoming from all directions to single point in space. They are usually used to approximate light incoming to dynamic object.
Environment maps may be processed so that single environment map lookup returns light incoming from single direction (specular environment map) or from whole hemisphere (diffuse environment map).

See Environment map for more details.

Other

Outside most widely used global illumination lightmaps, per vertex ambient, ambient maps and environment maps, Lightsprint supports many other illumination types suitable for specific situations. Depending on parameters you pass to lighting calculation process, you can get direct only lighting, mix of independently enabled direct and indirect lighting from many light source types etc, with result stored in texture or vertex buffer, with optional directional component.

Data structures

Lightsprint can store object's illumination in

Calculation

Calculation of illumination is realtime or non-realtime process, depending on parameters set. Environment maps are always computed in realtime speeds.

See data structures (links above) for more details on calculation.

Use in renderer

See data structures (links above) for more details on use in renderer.