Please note that this documentation space offers information for V-Ray 3.6! For most up-to-date documentation, refer to V-Ray Next for Modo help.

This page provides general information on the light cache GI engine.

 

Page Contents

 

Overview


Light caching (sometimes also called light mapping) is a technique for approximating the global illumination in a scene. This method was developed originally by Chaos Group specifically for the V-Ray renderer. It is very similar to photon mapping, but without many of its limitations.  

The light cache is built by tracing many many eye paths from the camera. Each of the bounces in the path stores the illumination from the rest of the path into a 3d structure, very similar to the photon map. On the other hand, in a sense, it is the exact opposite of the photon map, which traces paths from the lights, and stores the accumulated energy from the beginning of the path into the photon map.  

Although very simple, the light-caching approach has many advantages over the photon map:

  • It is easier to set up. We only have the camera to trace rays from, as opposed to the photon map, which must process each light in the scene and usually requires separate setup for each light.
  • The light-caching approach works efficiently with any lights - including skylight, self-illuminated objects, non-physical lights, photometric lights etc. In contrast, the photon map is limited in the lighting effects it can reproduce - for example, the photon map cannot reproduce the illumination from skylight or from standard omni lights without inverse-square falloff.
  • The light cache produces correct results in corners and around small objects. The photon map, on the other hand, relies on tricky density estimation schemes, which often produce wrong results in these cases, either darkening or brightening those areas.
  • In many cases the light cache can be visualized directly for very fast and smooth previews of the lighting in the scene.


Even with these advantages, light caching is similar in speed to the photon map and can produce approximations to the global lighting in a scene very quickly. In addition, the light cache can be used successfully for adding GI effects to animations.  

Of course, the light cache has some limitations:

  • Like the irradiance map, it is view-dependent and is generated for a particular position of the camera.
  • Like the photon map, the light cache is not adaptive. The illumination is computed at a fixed resolution, which is determined by the user.
  • The light cache does not work very well with bump maps.


The following diagram shows the way the Light Cache is being generated. To get the lighting from the environment V-Ray traces many rays from the camera into the scene. Each bounce of light creates a sample in the light cache that can be used during the rendering. If one ray hits a sample that was created by another ray the tracing is stopped and the information from the sample is read instead. This speeds up the process a lot.



 

Notes


  • For more details on the parameters used for the Light Cache Engine, please see the Light Cache Settings page under GI Render Settings section. 
  • Do not apply perfectly white or very close to white materials to a majority of the objects in the scene, as this will cause excessive render times. This is because the amount of reflected light in the scene will decrease very gradually and the light cache will have to trace longer paths. Also avoid materials that have one of their RGB components set to maximum (255) or above.
  • If you want to use the light cache for animation, you should choose a large enough value for the  Filter size in order to remove the flickering in the GI.
  • There is  no  difference between light caches computed for primary bounces (direct visualization) and for secondary bounces. You can safely use light caches computed in one of these modes for the other.
  • Similar to the photon map, you can get "light leaks" with the light cache around very thin surfaces with substantially different illumination on both sides. Sometimes it may be possible to reduce this effect by assigning different GI Surface ID's in the item shaders of the objects on both sides of the thin surface (see the V-Ray Object Properties); the effect can also be reduced by decreasing the  Sample size  and/or the filtering.