Custom Materials for 3DS MAX

pt.4

 

In the last segment I talked about controlling the way light is reflected off of a surface in a MAX scene. Of course light can also be absorbed, or it can pass through a surface. In this section I will talk about how to use transparency maps and refraction; these settings control how light passes through a surface.

 

Transparency, Translucence, and Refraction

There are two different types of materials that light can pass through, transparent materials, and translucent materials. As a simple example think of glass. Window glass is transparent, allowing light to pass directly through it, and allowing us to see clearly through it. Frosted glass is translucent; it allows light to pass through, but not clearly enough for us to be able to see through. The reason frosted glass is translucent is because of the way that light gets refracted when it passes through. Refraction is the bending of light as it passes through a material. Refraction can be witnessed by looking at a spoon in a cup of coffee. As light waves pass through the liquid they are slowed down and bent. Since the light waves bend when they pass both into and back out of the liquid the part of the spoon we see below the surface appears bent.

This coffee looks a little weak; it probably came from Denny's.

 

Transparency and Refraction Maps

Transparency maps, like the other maps you have been using, are set in the same way using the Maps roll-out in the Material Editor. A transparency map can be either a bitmap or a procedural map. (Maps like Noise and Dent that have extensive attributes and controls such as size and strength are procedural maps.) But why do you need to use transparency maps when you have an opacity spinner? For window glass you could just set the opacity spinner to 2 or 3, making your material almost totally transparent, or you could set it at 75 or 80 for a frosted glass look. Those approaches would work, but the opacity map allows more control than that and is versatile enough to be used in other ways too.

First consider the glass...

In this picture you can tell that the glass is a glass, and the candle holder looks passable as frosted glass. The opacity of both objects was controlled using the opacity spinner, and they both have a raytrace reflection map.

These objects are not very convincing. We can assume that since one object is transparent and highly reflective it is probably glass. If someone told me that the other object was frosted glass I could believe that; I would also believe someone who told me that it was made of plastic or glazed ceramic. If the person viewing your scene has to guess or be told what is in it then you haven't done your job as a 3D artist.

Adding a reflection map and controlling material opacity with the opacity spinner didn't have acceptable results. However, when refraction maps and opacity maps are applied to the materials a more believable glass is achieved. In the first image the frosted glass material has an opacity of 85% and no refraction. This leaves the tile surface visible through the candle holder undistorted and equally visible throughout.

As you can see here both glass materials look much more believable. A refraction map was applied to each material based on its "index of refraction" or IOR.. An opacity map was also assigned to the frosted glass material.

In the new image both the clear glass and the frosted glass were assigned refraction maps and IOR settings based on the material. The frosted glass has also been given an opacity map. I used the procedural map for Falloff and set it to Light/Shadow; this makes the material appear more transparent in lighted areas and less transparent in shadowed areas. . The materials appear far more believable now.

Now many of you are thinking, "Okay, that explains a few things, but what does that bit about 'IOR' mean?"

Remember the explanation of refraction and the bent spoon? When light passes through a material it gets bent; that is what refraction is. The "index of refraction" refers to how much the light gets bent as it passes through a material. Different materials cause light to bend differently depending on material density. The more dense the material, the more slowly light travels while passing through it, and the more it is refracted. Below is a list of the IOR values for some common materials.

Material IOR Value
Vacuum 1.0 (exactly)
Air 1.0003
Water 1.333
Glass 1.5 to 1.7
Diamond 2.419

This list is copied from the MAX Online Reference. Other materials are listed there too.

For the clear glass I used the minimum IOR listed for glass; for the frosted glass I actually bumped the IOR up to 1.8. Adjusting the IOR value is most often done through the Extended Parameters roll-out.

This is the IOR spinner. The value here is 1.5, the minimum refractive index for glass.

 

Using Refraction Maps

Refraction mapping is a lot like reflection mapping. MAX provides many different ways to set up refraction. Using Reflect/Refract maps, Thin Wall Refraction maps, or Raytrace maps each produce different effects and have different uses. By now you should be used to selecting maps and scrolling through roll-out menus. At the left are the three maps you will be most likely to use for refraction mapping. Raytrace refraction is time consuming just like raytrace reflections. Max must calculate the direction of the light and the alignment of all the faces in the scene and then extrapolate what light gets refracted where. Thin Wall Refraction bases its effects on thickness set up in a spinner window. This map is especially good for things like drinking glasses, window panes, and other thin walled objects. It also renders more quickly than raytraced refraction. A Reflect/Refract map is the quick and dirty way to set up refraction (or reflection). This map will calculate its effect based on whether it is applied as a reflection map or a refraction map and will render very quickly compared to other options. Reflect/Refract is the refraction map I used for the corrected glass materials above. Both the Reflect/Refract and Thin Wall Refraction maps allow you to adjust the IOR setting from inside the map parameters as an alternative to using the IOR spinner in the Extended Parameters roll-out.

Now since I have recieved a lot of E-mails and questions about things I have covered and not covered in these tutorials so far, I'm going to take a moment here to answer one of the more frequent questions. As I pointed out, Raytrace maps can be used for both reflection and refraction. The maps are assigned, the parameters set, the strengths adjusted in the Maps rollout, and pow! You get mirror like reflections and deep refractions. A lot of people have asked what the differences are between using a Raytrace map and using a Raytrace material. The same raytracing engine (calculation program) is used in both cases. The most significant difference you are likely to notice is rendering time. Most of the time Standard materials with Raytrace maps will render more quickly than Raytrace materials. The trade off is that Raytrace materials more closely simulate the natural world interactions between light and objects.

The sphere on the left is a Standard material with a Raytrace map for refraction. The sphere on the right is a Raytrace material. Both materials have the same IOR of 1.5.

The mapped sphere rendered in 1 minute; the material sphere took 4 minutes.

The differences between the two materials do not appear all that noticable. The Raytrace material displays a more accurate interpreataion of the colors in the scene. It also provides a more accurate shadow when Raytrace shadows are used. (Raytrace shadows are set up in lighting parameters.) The Raytrace material has far more parameters to adjust than the Raytrace map, and can be tricky to get used to since Specular and Diffuse colors behave in a different way than they would on Standard materials.

The simplest answer to the question, "What is the difference between using a Raytrace mapped material and a Raytrace material?" is that the effects of a Raytrace material more accurately represent the natural world but are likely to cost you rendering time.

My advice is that unless you really need that added realism and accuracy in your reflections and refraction go ahead and use mapping on Standard materials. Keep experimenting with both methods of reflection and refraction and test out what works best for your purposes, but remember that in most situations (on a professional level at least) you will have to keep a balance between what looks good and what is time and cost efficient.

 

A Closing Note On Light And Refraction In MAX

While 3D Studio MAX is a very powerfull and versatile tool I think that the core program has some shortcomings. Most of these can be overcome with plug-in apllications or by exporting MAX scenes into other programs for lighting and rendering. Still, I think it's worth noting (having said so much about material/light interaction) that lighting in MAX seems rather limited.

I have just explained some of the basics of how to handle refraction in MAX using maps and materials. Refraction is determined by materials. The more dense a material the more light is slowed and bent as it passes through that material. The surface of a material determines what direction the light will be refracted in. Refraction is also related to the wavelength of light but MAX doesn't really simulate the physics and natural behaviours of light. To achieve truely accurate or realistic lighting we either have to buy plugins or fake the effects.The behavior of light in the natural world is an important thing to understand if you are going for photorealism in your renderings, especially for those of you who may be perfectionist types (and what artist isn't?) on a budget. If you want to read up on the simple physics of light in more detail and learn some ways to simulate it in MAX click here.

 

It's time to take a break once again and give your eyes and brains a chance to relax. Make it a short break though because there is a page 2 waiting. There's more to know about opacity maps and it's important.

Contiue to page 2