KanikamaGI logo
  • English

How it works

Diffuse lighting

Diffuse lighting in Kanikama is based on the Precomputed Radiance Transfer 1.

Consider a scene where there are green and red point lights in a room. The colors of the lights are (1,0,0) and (0,1,0), respectively, and the brightness of both lights is set to 2.

The following image is the baked lightmap.

Set the color of the two lights to white (1,1,1) and the brightness to 1 and bake the lightmap with only one lit for each.

Two lightmaps are generated from the two lights.

The lightmap with red and green lights turned on can be reproduced by multiplying the two lightmaps by their respective colors and brightness and then summing them up (that is, taking a linear sum).

Note that only the lightmap values are computationally expensive in the right-hand side. If you bake multiple lightmaps in advance, we can dynamically update the lightmap of the scene at runtime by simply changing the colors of the coefficients and summing them up.