There are three main areas to cover when setting up the lights: applying a Physical Light Shader, converting the point light to a Mental Ray Area Light, and turning on Emit Photons.
Since the diamond is using a physically accurate dielectric material, a Physical Light shader is applied to the main light. This shader simulates the natural fall off, or decay of a light. To attach the Physical Light node, select the light and scroll down to the Mental Ray section, Custom Shaders section. Click on the add texture button next to the Light Shader field. A Create Render Node window will appear. Scroll down to the Lights section and select the Physical_light node. The Attribute Editor will switch to display the Physical_light settings. The default values are fine.
Area lights emit light from within a space defined by its shape. This produces a more accurate model for the light and softens the effect of raytraced shadows. To convert the Point Light into an Area Light, select the light again, and scroll down to the Area Light section in the Mental Ray section. Check Area Light. The default Rectangle Type and Sampling is used. Low Level is initially set to 3 to speed up rendering of shadows, but set back to 0 when final rendering. Also, area lights have direction, and need to be rotated to point at the object.
To enable Photon Emission, turn of Emit Photons in the Light's Caustics and Global Illumination section of the Mental Ray section. Default values are used initially and then adjusted after test rendering.
The scene is now set up and ready to render. The last step is to turn on the Global Illumination and Final Gather. Turning Final Gather Rays down to 100 and rendering with the rest of the settings at their default value produces the following:
Now, real diamonds cast light into their shadow – they are transparent objects and don't block all the light. Also, because light is being refracted, some of it gets focused into one spot like a lens. It's these ‘bright shadows' we call caustics that are missing from the picture.
Caustics are a light effect and the result of specular light transmission. It calculates light that remains focused, unlike Global Illumination which calculates how light diffuses. Caustics are usually seen as light patterns on a diffuse surface created by transparent mediums such as water and glass.
Like Global Illumination, Caustics use a photon map. Photons emitted from a light source are stored in the photon map and used to calculate the effect. Photons have already been turned on in the previous setup of Global Illumination – saving an extra step. Rendering with Caustics turned on, and at their default value produces.
Render times have increased, but when adding caustics to a scene, it is easier to visualize after indirect illumination has been taken into account. Notice the bright spots being cast onto the ground, and how internally the diamond is brighter. The next step is to improve the caustic effect.
Fine Tuning the Caustics
There are two places that the caustics can be improved, adjusting the photons emitted by the light and controlling the caustics in the Render Global Settings.
The brightness of the caustics can be controlled by the Photon Intensity setting in the light's Caustics and Global Illumination section.
Here the Photon Intensity has been decreased to 4,000. Note that this setting is now controlling the brightness of both the global illumination and caustics.
The Exponent value, below Photon Intensity is left at the default of 2. This is because a Light Shader is being used and the value of two is the natural decay of light.
Caustic Photons is the number of photons emitted by the light to create the caustic effect and stored in the photon map. The higher the value the better the quality, but the render times are longer. Setting it to 50,000 photons produced the following result – but took much longer to render.
There are now more light patterns and the results are sharper than the first render.
There are four Caustic settings in the Render Global Settings that can be used to improve quality and efficiency: Caustic Accuracy, Caustic Radius, Caustic Filter Type and Caustic Filter Kernel.
Caustic Accuracy controls the number of photons used to estimate the caustic brightness. Generally the default of 64 is fine and values above 100 will smooth the photons. Reducing the Accuracy to 1 though, can be a way of visualizing how the photons are behaving.
Here the Accuracy has been set to 1 (with the number of photons reduced back to 10,000 to get a quicker render). It can be seen here how the photons are being refracted onto the surrounding surface.
Caustic Radius controls the maximum distance at which photons are consider for caustics. Left at its default of 0, the radius is automatically calculated and is usually the best setting.
The Caustic Filter Type controls the sharpness of the caustics. There are two settings Box and Cone. Box will make caustics look sharper and Cone makes caustics look smoother. The resulting difference can be subtle and I have a preference for the Cone filter.
The Caustic Filter Kernel is the last of the settings and specifies the size of the filter applied to caustic photons. The default of 1.1 is fine in most cases.
To improve the final render quality:
- Global Illumination and Caustic Photons from the light were both increased to 80,000
- Photon Intensity was also increased to 6,000 to brighten the scene
- The Max Reflection\Refraction Photons was increased to 6
- And Max Photon Depth was increased to 10
- Global Illumin and Caustic Accuracy was increased to 120
- The Number of Samples was increased to Min = 0 and Max = 2
- Multi-pixel Filtering set to Gauss
- Jitter turned on in Sample Options
- Raytracing increased to 10 for Reflections/Refractions and 20 for Max Trace Depth
Just for fun I set the Col of the diamond material to blue – not sure if there is such as thing as a blue diamond though.
The individual files for this tutorial are available for download:
Scenes were modeled and rendered using Maya 6
The caustics details were partly based on an article at Interstation3d
The dielectric material details were partly based on an article at Matty3d
Jeremy Birn's, "Digital Lighting and Rendering” has more information about the Fresnel Effect (Fresnel Reflections)
The Maya Help manual is copyright of Alias