Keep up-to-date with Free tutorials!!


Sign up to our twice-monthly newsletter today for the latest tutorials, interviews and product information.

Sign me up to receive third-party emails from 3dtotal's partners, too!

- Latest news
- Exclusive Shop Offers
- Preview early content
- Plus much more


Not Ready to take that step? OK, Why not just Subscribe to the RSS Feed

submit tutorial
1 | 2
Diamond Caustics

| Your Rating:
rating star fullrating star fullrating star fullrating star nonerating star none
(Score 3 out of 5 after 4 Votes)
| Comments 1
Date Added: 9th December 2009
Software used:
Rendering a diamond as photo-realistically as possible is a 3D challenge. Light doesn't just bounce off an object; it enters it, bends, changes color, bounces back and looses intensity. To achieve all this requires the use of Caustics to handle this refraction of light as it passes through a diamond and onto its supporting surface. Also, to more accurately re-create the physical behavior of light in the diamond requires the use of a dielectric material. And just to add that touch of realism which indirect illumination creates, Global Illumination and Final Gather also need to be used.

Model and Scene Set-Up

The diamond was modeled separately from a gem cutter diagram and then imported into a scene resembling a photographic studio - the virtual set.

To better appreciate the Caustics effect, the diamond is first set-up and rendered using a standard light and transparent material using Mental Ray. It is lit by a high backlight casting a Depth Map Shadow onto the floor.

The diamond uses a Phong material for hard specular highlights and is set to be mostly transparent. The results are convincing - it looks like a diamond - but can be improved. I started by applying a dielectric material to the diamond.

The Dielectric_material

A dielectric material accurately simulates transparent objects such as glass, water and diamond. The word dielectric refers to any material that is a poor conductor of electricity. Unlike a material with a high transparency setting, it also uses Fresnel reflection and Beers law of light absorption. Fresnel reflection controls the amount of specularity of a surface according to the camera angle: the more perpendicular the surface is to the camera the more reflective the surface becomes. Beers law states that light is absorbed exponentially as it travels through a material. So light that has entered our diamond will be less bright as it exists.

There are six attributes to control the dielectric material: Col, Ior, Col_out, Ior_out, Ignore_normals and Phong_coef. Col is more than just the color of the material, it also controls "...the fraction of light which is left after traversing one unit of material. Thus 0.9 means that 10% of the light is absorbed per unit length of the material." (Maya Help manual). This is where Beers law is used and affects how much light can pass through the medium. Ior is Index of Refraction of the dielectric material. As light enters a medium denser than air, it bends. IoR affectively controls the density of the medium. Water has an IoR of 1.333 (4/3), Glass an IoR of 1.5 to 1.7, and Diamond an IoR of 2.419.

The Col and Ior attributes control how the light is behaving at either end of the object. When two dielectric materials are adjacent to each other then the Col_out and Ior_out are used to specify the respective values of the outside dielectric material. For example, a glass object would have an Ior of 1.5 and an Ior_out of 1.0 because air is on the outside of the glass. If the glass object were immersed in water, the Ior_out would be changed to 1.33.

If your object is well model, Ignore_normals can be left off. Whether a ray of light is entering or exiting an object can be determined by the direction of the object's normals. The dielectric material will use the normals of the surface to distinguish the medium on either side of the interface. For a dielectric-air interface the normals point into the air. For a dielectric-dielectric interface the normals point into a dielectric material which is outside. To use the dielectric material the model normals must be oriented correctly unless the ignore_normals parameter is set to true.

Phong_coef can also be turn off. It is used to generate fake highlights of an area light source. The Phong Coefficient will take care of how sharp or blurry the light rays will appear on a surface: higher values produce sharp highlights and lower values glossy, or more blurry highlights.

Diamond Material Set-up

Col is left at the default Value of 0.98. It can be adjusted latter if we want add a little color to the diamond. The IoR is simply looked up in an IoR index. For the diamond it is set to 2.419. As the diamond is sitting in air, the Col_out and Ior_out are left at their default value for air. An initial render produces the following result.

It's black! This is because in the Render Global Settings, Raytracing is turned on, but Refractions are set to 1. Light needs to enter and exit the diamond, so refractions happen twice. The Refractions are now set to 2. Also, since raytracing is in effect, the shadow is replaced with a raytraced shadow.

Starting to look like a diamond. Before entering into the caustics, the overall lighting of the scene can be improved. The diamond will be lit using the indirect light of Global Illumination and Final Gather. The surrounding environment is also going to have DGS materials to better control the indirect illumination.

Environment Materials and Photon Materials Set-up

All the objects in the scene need new materials. DGS materials will be used for the backdrop, reflector board, and room environment. Each of the objects in the scene also needs their own equivalent photon shader to control the Global Illumination and latter receive the caustics.

The Backdrop is a painted white wall. Acrylic based paint is usually a rough matte surface with most of the light reflected being diffuse. The backdrop material's Diffuse Value is therefore set to 0.85, with Hue and Saturation set to 0.0 as it is a white wall. Glossy and Specular are set to 0.0 as the wall is being used to scatter the light.

The Reflector Board is being used to catch the bouncing light and used to illuminate the sphere like a large soft light. Its Diffuse is set to a Value of 1.0 and Glossy and Specular are set to 0.0.

The Room Environment absorbs most of the light. Diffuse is reduced to 0.1, and Glossy and Specular are set to 0. Some light is reflected so that a Photon Map can be generated and we avoid the annoying "no photons stored after emitting 10000 photons" warning. This warning results when photons travel into infinite space, or are completely absorbed by a material and their reflection is not caught at least once.

Both the Backdrop and Room Environment need a photon material. To assign the DGS_material_photon, scroll to the Custom Shaders section of each material and select the add texture button next to the Photon Shader field. From the Photonic Materials group, choose DGS_material_photon. Ensure that both the photon material and material settings match. Turn on Opaque in the Flag section for all the materials (except the diamond), as it will speed up render times.

Lastly, the diamond needs its equivalent photon material. In the Photon Shader field of the diamond material link a dielectric_material_photon shader. Ensure that both the material and photon material settings are the same.

The next step is to set-up the lights to emit photons. These photons will be used to create both the Global Illumination and later the Caustics.

continued on next page >

Related Tutorials

Photon Illumination of DGS Materials in Mental Ray for Maya

by Philippe Le Miere
published on 2009-12-09

Keywords: photon, illumination, materials, mental, ray,

rating star fullrating star fullrating star fullrating star fullrating star full (2)
Comments 0 Views 63326

Human Skin - the Mental Ray Subsurface Scattering Fast Skin shader

by Philippe Le Miere
published on 2009-12-09

Keywords: character, face, human, skin,

rating star fullrating star fullrating star fullrating star fullrating star none (19)
Comments 1 Views 175863

Global Illumination and Final Gather in Mental Ray for Maya

by Philippe Le Miere
published on 2009-12-09

Keywords: global, illumination, gi, final, gather, maya,

rating star fullrating star fullrating star fullrating star fullrating star full (4)
Comments 0 Views 77131

Know the Basics: ZBrush – part five: KeyShot lighting and materials

by Gregory Stoffel
published on 2017-02-20

Keywords: ZBrush, Tutorial, Basics, Beginner, 3D, KeyShot, Lighting, Materials

rating star fullrating star fullrating star fullrating star nonerating star none (2)
Comments 0 Views 5014
Readers Comments (Newest on Top)
Ceruleandragon on Fri, 10 August 2012 5:49pm
Your tutorial is outstanding! Thank you.
Add Your Comment..