Square Enix © Goodbye Kansas

Table of Contents

This page provides information on the Caustics rollout in the Render Settings.


Overview


V-Ray supports the rendering of the caustics effects. In order to produce this effect you must have proper caustics generators and caustics receivers in the scene (for more information on how to make an object a caustics generator/receiver read the VRayObjectProperties and Light Attributes documents).

The new Progressive caustics solver uses advanced sampling techniques, and is able to trace as many photons as required without suffering the memory constraints of traditional Photon Mapping techniques.

It is loosely based on two papers: one on Progressive Photon Mapping from Knaus and Zwicker, and another on Metropolis-guided caustics tracing from Šik and Krivánek.

The other method, New Map (Photon Mapping), is a two-pass technique. The first pass consists of shooting particles (photons) from the light sources in the scene, tracing them as they bounce around the scene, and recording the places where the photons hit the object surfaces. The second pass is the final rendering, when the caustics are calculated by using density estimation techniques on the photon hits stored during the first pass.

When the render engine is set to V-Ray GPU, the Caustics rollout is not available.





UI Path: ||Render Settings window|| > GI tab > Caustics rollout



 

Caustics Parameters


On – Turns rendering of caustics on and off .

Multiplier – Controls the strength of the caustics. It is global and applies to all light sources that generate caustics. If you want different multipliers for the different light sources, use local light settings. 

Note: This multiplier is cumulative with the multipliers in the local light settings. Changing multipliers, while useful for artistic purposes, will result in physically-inaccurate scenes.

Search distance units – Determines in what units the Search distance parameter is specified - World units or Pixels. The Progressive mode works only with Pixels.

Search distance (World)/(Pixels) – Radius of search area circle.

The Progressive mode works only in Pixels. The value set initially is automatically reduced by the solver during successive passes by up to a fourth of the initial value. For example, with the default value of 4, the search radius after being reduced becomes 1 pixel, allowing for detail to be resolved with that accuracy. If the initial radius is set to 16, the final radius is 4 pixels making the caustics look blurrier. As of V-Ray 5 update 1, it is recommended to leave the radius at its default value of 4.

For the New map mode, when V-Ray needs to render the caustics effect at a given surface point, it searches for a number photons on that surface in the area surrounding the shaded point (search area). The search area is a circle with its center at the original photon and a radius equal to the value. Smaller values produce sharper, but perhaps noisier caustics; larger values produce smoother but blurrier caustics. For more information, see The Search Distance Parameter example or The Light Caustics Subdivs Parameter example below. 

Max photons  – Maximum number of photons within the search area circle that will be considered when rendering the caustics effect on a surface. Smaller values cause less photons to be used and the caustics will be sharper, but perhaps noisier. Larger values produce smoother but blurrier caustics. The special value of 0 means that V-Ray will use all the photons that it can find inside the search area. See the Max Photon Example below for more information.

Max density – This parameter allows you to limit the resolution (and thus the memory) of the caustics photon map. Whenever V-Ray needs to store a new photon in the caustics photon map, it will first look if there are any other photons within a distance specified by Max density. If there is already a suitable photon in the map, V-Ray will just add the energy of the new photon to the one in the map. Otherwise, V-Ray will store the new photon in the photon map. Using this options allows you to shoot many photons (and thus get smoother results) while keeping the size of the caustics photon map manageable. 


Mode


Mode – Controls the mode of the caustics photon map.

New map – Causes a new photon map to be generated. The new map will overwrite any previous photon map left over from a previous rendering.
From file – V-Ray will not compute the photon map but will load it from a file.
Progressive – Uses advanced sampling techniques and is able to trace as many photons as required without suffering the memory constraints of traditional Photon Mapping techniques.

File – File name with the caustics photon map to be loaded when Mode is set to From file. Click the Browse button to the right to specify the file name.

Save – Saves to file the photon map which is currently in memory. Note that the Don't delete option in the On render end group must be enabled in order to save the photon map in memory. Otherwise, V-Ray will automatically delete the photon map at the end of the rendering process. 



Progressive Mode


The Progressive method doesn't need most of the controls used for traditional New Map mode, so the controls are grayed out. Only the Search distance (Pixels) control and the Multiplier have an effect on the result.

Tips when working with progressive caustics:

Required:

  • Affect Shadows should be disabled in refractive materials if they are used to generate caustics
  • The Affect Channels option should be set to All channels in refractive materials to ensure the Caustics render element contains also the ones fallen behind refraction.
    Not doing so leaves photons fallen behind refractive surfaces inside the Refraction RE, but not inside the Caustics one.
  • If present, the VRaySun's photon emit radius should be set to a value large enough to encompass the relevant parts in the scene

Optional:

  • It is strongly recommended to set time limit when rendering with Progressive Caustics, rather than relying on Noise Threshold value only.
  • Set a higher Progressive Min subdivs value
    A higher Min subdivs value (16, 24, even higher.) in the Progressive Image sampler settings means there is a longer phase of fixed sampling with no adaptation to the photon casting, so the screen coverage of samples remains more consistent, allowing for quicker filling of, for example, big flat areas or long thin lines.
    The later phase of rendering, with adaptation, reduces noise to ensure Noise threshold is respected.

Managing Expectations:

  • The progressive caustic solver is fire and forget
    This means that it can be turned on in any scene and expected to trace photons on any specular or refractive surface.
    It doesn't, however, mean that doing so will result in an image converged to perfection within a short time.
    The approach, novel as it is, is still photon-map based, and judgement should be used to ensure quick, noise and frustration-free results.
  • It renders with the beauty
    The solver does render alongside a beauty pass, storing caustics in the appropriate Render Element (see requirements tips above), but that may not be the best solution as far as performance is concerned.
    It's suggested to consider preparing a dedicated caustic rendering pass if the photon tracing is particularly extensive, and/or if sequences are to be rendered. That way, it is possible to optimize the caustics calculation separately from the requirements of the beauty pass.


Advantages:

  • setup is minimal;

  • each cast photon is more useful than those in traditional Photon Mapping;
  • the number of photons castable is only limited by time, not memory;
  • they can resolve tiny caustic details, compared to the scene size;
  • they can resolve caustic details also when a camera is very zoomed in on them;
  • statistics about the photon tracing can be found in the VFB2 stats panel;
  • works in IPR mode


Limitations:

  • they require the Progressive image sampler;
  • the image sampler often requires Progressive Min subdivs values much higher than 1;
  • it's non-deterministic, meaning that there could be somewhat unpredictable render times, and also differences in the visual results when rendering the same frame twice (not suitable for animations);
  • currently doesn't work with distributed rendering;
  • Depending on the scene, the performance might not scale linearly with the number of threads/cores, resulting in inefficient CPU utilization.

On Render End


Don't delete – When enabled, V-Ray keeps the photon map in memory after the scene rendering has finished. Otherwise the map is deleted and the memory it takes is freed. This option can be especially useful if you want to compute the photon map for a particular scene only once and then reuse it for further rendering.

Auto save – When enabled, V-Ray automatically saves the caustics photon map to the file specified in the Auto save file field when rendering is complete.

Auto save file – Specifies the file to which the caustics photon map is saved when Auto save is enabled. Click the Browse button to the right to specify the file name.





Example: Search Distance


For this example, the Caustics Multiplier is 80 (Light Attributes) and the rest of the parameters are at their default values. The light used in the scene is VRaySun. The Caustics method is set to Progressive. The Multiplier is set to 15. Note that the Search Distance is in pixels.


Search Distance is 1

Search Distance is 10

Search Distance is 20

1
20





Here the caustics mode is New Map. For this image, the light's Caustics Multiplier parameter in Light Attributes is set to 80 and the rest of the parameters are at their default values.  As seen from the images, the larger Search distance produces blurrier caustics. The scene units are centimeters.


Search Distance is 1 World units

Search Distance is 5 World units

Search Distance is 10 World units

1
10

Search Distance is 1 pixel

Search Distance is 5 pixels

Search Distance is 10 pixels

1
10





Example: The Light Caustics Subdivs Parameter


In this example the Caustics Multiplier parameter in Light Attributes is set to 80. The other parameters are at their default values. As can be seen, the larger number of subdivs produces grainier caustics effects. The Caustics mode is New Map.


Caustics Subdivs is 300

Caustics Subdivs is 1000

Caustics Subdivs is 2000

Caustics Subdivs is 4000

300
4000




Example: The Max Photons Parameter


In this example the Caustics Multiplier parameter in Light Attributes is set to 80 and the rest of the parameters are at their default values. VRaySun is used in this scene. As can be seen, the larger value of the Max photons parameter causes the caustics to appear much smoother. The Caustics mode used is New Map.


Max Photons is 10

Max Photons is 60

Max Photons is 100

Max Photons is 200

Max Photons is 300

10
300




Example: VRaySun Photon Emit Radius


This example shows how a light's photon emit radius affects the caustics effect. Here we use a VRaySun to light the scene.  The Caustics Multiplier parameter in Light Attributes is set to 80 and the rest of the parameters are at their default values. The Caustics mode is New Map.


Photon Emit Radius is 5

Photon Emit Radius is 10

Photon Emit Radius is 20

Photon Emit Radius is 40

Photon Emit Radius is 50

5
50




Notes


  • To write and load *.vrpmap files per frame, use %04d frame formatting token.
  • Caustics also depend on the individual light settings (see Light Attributes).
  • For accurate caustic calculations, disable the VRayMtl's Affect Shadows parameter when using caustics. Simultaneous usage of both Caustics and Affect Shadows can be used for artistic purposes but will not produce a physically correct result.