Caustics

In this exercise, you will learn to enable Caustics and fine-tune its effects.

1 Open scene file cognacGlass_start.mb

Render the scene to see the initial results using Maya Software Rendering. This is a simple scene consisting of a glass and a Spot Light. The glass and its contents have refractive materials, and the Spot Light caits Raytraced Shadows. You can see that the shadows cast by the glass are properly colored and transparent, but the image lacks the "hot spots" usually seen when light shines through glass.

Initial render using Maya Software Renderer

Initial render using Maya Software Renderer

2 Enable Caustics

" Open the Render Globals window and change your selected renderer to mental ray.

- In the mental ray tab of the Render Globals, go to the Quality Presets setting and select the PreviewCaustics preset.

n Scroll to the Ray Tracing section and increase the Raytrace settings:

Set Refractions to 6. This is the number of times the ray must go through a transparent surface before it stops.

Set Max Trace Depth to 8 (Reflection rays + Refraction rays).

n Scroll to the Caustics and Global Illumination section and note that Caustics are now enabled.

Increase Max Refraction Photons and Max Photon Depth to 6.

The photon goes through 6 transparent surfaces before hitting a diffuse surface (the wall) and stopping. Therefore, the default value of 5 would not produce proper results.

° Scroll to the Translation section of the Render Globals, and set Export Verbosity to Progress Messages so that you can check Maya's Output Window for progress messages when you render.

3 Turn on photon emission

In order to use Caustics, at least one of the light sources in your scene must emit photons. Each photon emitted by the light source is traced through the scene until it either hits a diffuse surface or until it has been reflected or transmitted a maximum number of times as indicated by the photon trace depth. The Caustic Photon Map holds just those photons that have been specularly reflected or refracted, before hitting a diffuse surface where they are stored.

Note: It is also possible to use custom mental ray shaders as photon emitters.

" In the Hypershade's Lights tab, select spotLightShapel and open the Attribute Editor.

n Scroll to the mental ray attribute section and turn on Emit Photons in the Caustics and Global Illumination subsection.

" Photon Intensity is the amount of light distributed by the light source. Each photon will carry a fraction of the light source energy and distribute it into the scene.

Leave Photon Intensity at the default (8000) for now.

The number of Caustic Photons emitted by the light source will determine the quality of the generated Caustics. More photons produce higher quality results, but also increase memory usage. A suggested workflow is to use the default number of photons or less while tuning your image, to produce quick, low-quality Caustics. You can increase the number of photons to produce higher quality images.

Leave Caustic Photons at the default number (10000) for now.

r- Exponent acts like decay; the intensity increases as the value decreases. The default value of 2 simulates quadratic (realistic) decay. Leave this setting at the default value for now.

The Physical option will not be used.

▼J Caustic and Global Illumination f/ IE mil Fhotonsi

Photon Color

Photon Intensity 8000.000

Exponent |2.000

r Physical

Caustic Photons 10000

Global Ilium Photons 110000

Caustic and Global Illumination light attributes

4 Test render the scene

You should now see Caustic effects around the glass, but the brightness and quality will not be very good; the Caustic effects will be spotty. Further tuning is needed to improve the appearance of Caustics.

Initial results of render with Caustics

Fine-tuning Caustics

» You may find that the Caustic effects are not bright enough. Raising or lowering the Photon Intensity of your light source will increase or decrease the brightness of your Caustics.

Open the Attribute Editor for the light and, in the Caustics and Global Illumination section, change the Photon Intensity value until you have better results.

" Try a setting of 25000.

In the mental ray tab of the Render Globals, scroll to the Caustics and Global Illumination section.

The appearance of Caustics can be fine-tuned using the Caustic Accuracy and Radius settings.

" Radius controls the maximum distance at which mental ray considers photons.

For example, to specify that only photons within 1 scene unit away should be used, set Radius to 1. When Radius is left at the default value of 0, the reriderer will itself calculate an appropriate radius based on your scene size. However, this default result is not always acceptable, as in this case. Increasing the Radius will generally decrease noise but give a more blurred result. To decrease noise without blurring details, it would be necessary to increase the number of Caustic photons emitted by your light source.

Increase Radius in small increments and test render until you have acceptable results. Try a setting of 1.5 or 2.

" Accuracy controls how many photons are considered during rendering. The default is 64; larger numbers make the Caustics smoother. For example, to specify that at most 100 photons should be used to compute the Caustic brightness, set Accuracy to 100.

Increase Accuracy in small increments and test render until you have acceptable results. Try a setting of 100.

Caustic Radius 2.000, Accuracy 100, Photon Intensity 25000

n Changing the Caustic Filter Type to Cone can produce smoother results.

In the mental ray tab of the Render Globals, scroll to the Caustics and Global Illumination section and change Caustic Filter to Cone.

Results using Cone filter

To further increase the quality of Caustic effects, you can increase the amount of emitted photons. This will slow down your rendering time, but improve image quality.

In the Caustics and Global Illumination attributes for your light, increase Caustic Photons. Try a setting of 20000.

20000 Caustic Photons, Accuracy 200, Radius 1.5

n Further improvements to Caustics generally require experimentation with the light's Energy, Caustic Photons and Exponent values, as well as the Render Globals' Caustic Accuracy and Radius values.

The scene file cognacGlass_finished.mb has the finished results of this exercise.

0 0

Post a comment

  • Receive news updates via email from this site