Tutorial

Using the Dielectric Material Shader



Your Ad Here

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:

Render the scene:

Inspect the glass and water components:

  1. 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.

  2. 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.

  3. Click Select By Name again. Highlight water-glass, and then click Select.

    The water in the glass is highlighted.

  4. 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.

    Transparent objects in the scene

    1. water-glass (selected)

    2. glass-air

    3. water-air

Create a material for the water glass:

  1. Open the Material Editor.

  2. 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.

  3. Click the Material Type button. (This is the button to the right of the name field. By default, its label is “Standard.”)

    The Material/Map Browser appears.

  4. 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.

  5. Click the Surface shader button.

    The Material/Map Browser appears again, this time displaying maps and shaders instead of materials.

  6. 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.

  7. 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).

  8. Click Go To Parent to return to the top level of the mental ray material.

  9. 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.

Assign the new material:

  1. On the main toolbar, click Select By Name. In the Select Objects dialog, highlight the glass-air object, and then click Select.

  2. In the Material Editor, make sure the new glass-air sample slot is still active, and then click Assign Material To Selection.

Create a material for the water surface:

  1. In the Material Editor, drag the glass-air sample slot to another sample slot.

    This creates a copy of the glass-air material.

  2. In the Name field, change the name of the material to water-air.

  3. Click the Surface shader button to view the Parameters rollout for the Dielectric Material shader.

  4. 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.

Assign the new material:

  1. On the main toolbar, click Select By Name. In the Select Objects dialog, highlight the water-air object, and then click Select.

  2. In the Material Editor, make sure the new water-air sample slot is still active, and then click Assign Material To Selection.

Create a material for the water that touches the glass:

  1. In the Material Editor, drag the water-air sample slot to another sample slot.

  2. In the Name field, change the name of the material to water-glass.

  3. Click the Surface shader button to view the Parameters rollout for the Dielectric Material shader.

  4. Change the Index Of Refraction (Out) value to 1.5, for glass. (The first Index Of Refraction value should still be 1.333.)

  5. Click the Outside Light Persistence color swatch.

    A Color Selector appears.

  6. 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.

    Forgetting to change Outside Light Persistence to white when two transparent objects are adjacent

Assign the new material:

  1. On the main toolbar, click Select By Name. In the Select Objects dialog, highlight the water-glass object, and then click Select.

  2. In the Material Editor, make sure the new water-glass sample slot is still active, and then click Assign Material To Selection.

Render the scene:

  1. Click Render Scene to open the Render Scene dialog.

  2. Go to the Indirect Illumination panel. On the Caustics And Global Illumination rollout, in the Caustics group, turn on Enable to enable caustics.

  3. Click Render.

    The water glass renders with physically correct refraction and caustic light effects.

    Rendering with transparent dielectric materials and caustics

Save your work:

The Glass Material

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.

Summary

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.

Next

Using lume Shaders for Other Water Effects


Comments

Return to Autodesk Index

Your Ad Here