10 hours ago, afraidofdark said:
One of my question remained unanswered. How modern engines does this ? Is there a paper, tutorial or a chapter from a book that explains ue4's light cache or Unitiy's light probe ? Before implementing anything I like to know about this.
Here are some options how to store directional ambient light, any of them can be called 'probe':
One color for each side of a cube, so 6 directions and you interpolate the 3 values fitting a given normal. (Known as Valves ambient cube used in HL2)
Spherical Harmonics. The number of bands you use define the detail, 2 or 3 bands (12 / 27 floats) is enough for ambient diffuse.
Cube maps. Enough details for reflections (used a lot for IBL / PBR today). Lowest LOD == ambient cube.
Dual paraboloid maps (or two sphere maps). Same as cube maps, but needs only 2 textures instead 6.
Independent of the data format you choose there remains the question how to apply it to a given sample position. some options:
Bounding volume set manually by artist, e.g. a sphere or box with a soft border: You find all affecting volumes per sample and accumulate their contribution.
Uniform grid / multiresolution grids: You interpolate the 8 closest probes. E.g. UE4 light cache.
Voroni Tetrahedronilaztion: You interpolate closest 4 probes (similar to interpolating 3 triangle vertices by barycentric coords for the 2D case). AFAIK Unity uses this.
Also the automatic methods often require manual tuning, e.g. a cut off plane to prevent light leaks through a wall to a neighbouring room.
Notice a directionless ambient light used in Quake does not support bump mapping. The 'get ambient from floor' trick works well only for objects near the ground.
There are probably hundrets of papers talking about details.