Tutorial
The purpose of the Dielectric Material shader is to create transparent materials that are physically accurate. Specifically, the Dielectric Material shader can model accurately situations where objects of different refractivity are adjacent to each other. Refractivity is measured in the real world, and specified in the Dielectric Material shader, by an index of refraction (IOR).
The scene you use in this lesson shows a glass containing water. There are three kinds of transparent materials in the scene:
You apply the Dielectric Material shader to the geometry that represents both glass and water. But instead of considering just the two materials in and of themselves, you take into account the interfaces between transparent materials:
Set up the scene:
Open the file water_glass_start.max from the \tutorials\mental_ray directory in your Autodesk VIZ directory.
The scene shows a water glass resting inside a box (to provide background surfaces), and with a chamfered cylinder standing in the glass. It has been set up to use the mental ray renderer, and the Render Scene dialog is locked to the Camera01 view.
Note: All the files necessary to do the tutorials can be found on the program disc. Before doing the tutorials, copy the \tutorials directory from the disc to your local program installation.
Render the scene:
A material has been applied to the box and the cylinder, but not to the glass or the water in it, so these render as solid colors.
You are going to create transparent materials and apply them to the water and the glass. First, you will inspect the glass and water objects, because these have been set up with the Dielectric Material shader in mind.
Inspect the glass and water components:
On the main toolbar, click Select By Name.
A Select Objects dialog appears.
Three objects are named glass-air, water-air, and water-glass. These are the transparent objects in the scene.
Highlight glass-air, and then click Select.
The water glass is highlighted in the viewports. These three objects are named for their interface with other transparent objects: most of the glass is in contact with air.
Click Select By Name again. Highlight water-glass, and then click Select.
Click Select By Name again. Highlight water-air, and then click Select.
The surface of the water is highlighted. Because water, glass, and air each have different IORs, the scene uses three different objects. You will create materials based on the interfaces between different IORs.
Create a material for the water glass:
Click an unused sample slot to make it active. In the name field, change the material's name to glass-air.
Having the name of materials match the name of objects makes the scene easy to manage.
Click the Material Type button. (This is the button to the right of the name field. By default, its label is “Standard.”)
Choose “mental ray” from the list, and then click OK.
If mental ray does not appear in the list, turn on Renderer in the Compatible With group.
The mental ray material is basically just a holder for shaders. You must assign a shader to the Surface component for the material to be visible in renderings. Assigning shaders to other components is optional.
Click the Surface shader button.
The Material/Map Browser appears again, this time displaying maps and shaders instead of materials.
Choose “Dielectric Material (3dsmax)” from the list, and then click OK.
The shader's Parameters rollout is displayed in the Material Editor.
Note: Despite the name, this is a shader and not a top-level material. The corresponding material is named Glass (see “The Glass Material,” below).
Tip:
You can confirm that the material is now transparent by turning on Background in the Material Editor.
On the Parameters rollout, change the Persistence Distance to 10.0. Leave the other values left at their defaults (1.5 is the IOR of glass).
Click Go To Parent to return to the top level of the mental ray material.
Drag the Surface button to the Photon button.
A Copy (Instance) Map dialog appears. Choose Instance, and then click OK.
While the Surface shader controls how the surface of objects with this material appear, the Photon shader controls how they behave “physically”: that is, when calculating caustics and global illumination. For this scene, we want Surface and Photon characteristics to be identical.
Create a material for the water surface:
In the Material Editor, drag the glass-air sample slot to another sample slot.
In the Name field, change the name of the material to water-air.
Click the Surface shader button to view the Parameters rollout for the Dielectric Material shader.
Change the Index Of Refraction value to 1.333 for water.
Note: Because the shader is instanced, this value changes in the Photon component as well.
Create a material for the water that touches the glass:
In the Material Editor, drag the water-air sample slot to another sample slot.
In the Name field, change the name of the material to water-glass.
Click the Surface shader button to view the Parameters rollout for the Dielectric Material shader.
Change the Index Of Refraction (Out) value to 1.5, for glass. (The first Index Of Refraction value should still be 1.333.)
Change the Outside Light Persistence color from black to white.
This helps ensure that light will be transmitted through the water in the glass. It is a change you need to make only when both transparent objects are “physical” Autodesk VIZ objects.
The Glass material is a top-level container for a Dielectric Material shader assigned to both the Surface and Photon components. It has no other controls. If you were to replace the mental ray materials created in this lesson with Glass materials that had the same settings, the rendering of the water glass would appear identical.
These are the main points of this lesson:
The Dielectric Material shader is a transparent shader that has physically correct refraction.
It is especially useful when two transparent materials are adjacent to each other: for example, water and glass.
Typically, you apply Dielectric Material to both the Surface and Photon components of a mental ray material. The shader can be instanced, as usually the settings should be the same.
The Glass material is a shortcut way to assign Dielectric Material values to both the Surface and Photon components.
The Index Of Refraction value is the IOR of the object to which you apply the material.
The Index Of Refraction (Out) value is the IOR of the transparent object that adjoins the object to which you apply the material.
If a transparent object adjoins two different transparent materials, create different objects for different adjoining materials (glass and air, for example), and apply different Dielectric Material shaders that have the correct combination of IORs, in each case.
If the two transparent objects are both Autodesk VIZ objects, remember to change Outside Light Persistence to white.