# [TUT] Advanced Rendering Concepts pt.1

## Recommended Posts

This is meant to be a supplement to my mental ray tutorial, as in you should read it and understand the mental ray renderer before reading this, though some of this information can be applied to other rendering engines.

First, we start with refraction. To know how to create the perfect refraction, you should know exactly what it means. Refraction is the turning or bending of any wave, such as a light or sound wave, when it passes from one medium into another of different optical density. So if, say, an object was travelling in air, then hit a glass pane, it would bend when entering the glass, and bend again when exiting the glass. Seeing as light travels as a wave (of course there are the 'light particle' theorists, but let's assume that the light as wave theory is correct), and everything you see is light being reflected off of a surface, the entire image is distorted when entering a surface. Now, there are many details you must consider when recreating refraction, first off: how smooth is the surface? If the surface is very rough, the image will be very distorted, because when it hits the "hills" on the object, they will influence the angle the light wave is refracter (and reflected). If the surface is very smooth, it will make a clean, straight angle change. But the single most important thing to remember when creating refraction is that different materials have different optical densities, these are called their indices of refraction. When creating a 3D material and editing refractive properties, there is a field for the materials index of refraction. But how do you know what a materials index of refraction is? Well, scientists have calculated them for different materials. To do this, they shot a light beam at an object (as smooth as they could get it), and measure the angle at which it exits the object. I have a handy table for you that shows you the indices of refraction of many materials, common and uncommon.

Vacuum - 1.00000 (exactly)

Air (STP) - 1.00029

Acetone - 1.36

Alcohol - 1.329

Amorphous Selenium - 2.92

Calspar1 - 1.66

Calspar2 - 1.486

Carbon Disulfide - 1.63

Chromium Oxide - 2.705

Copper Oxide - 2.705

Crown Glass -. 1.52

Crystal - 2.00

Diamond - 2.417

Emerald - 1.57

Ethyl Alcohol - 1.36

Flourite - 1.434

Fused Quartz - 1.46

Heaviest Flint Glass - 1.89

Heavy Flint Glass - 1.65

Glass - 1.5

Ice - 1.309

Iodine Crystal - 3.34

Lapis Lazuli - 1.61

Light Flint Glass - 1.575

Liquid Carbon Dioxide - 1.20

Polystyrene - 1.55

Quartz 1 - 1.644

Quartz 2 - 1.553

Ruby - 1.77

Sapphire - 1.77

Sodium Chloride (Salt) 1 - 1.544

Sodium Chloride (Salt) 2 - 1.644

Sugar Solution (30%) - 1.38

Sugar Solution (80%) - 1.49

Topaz - 1.61

Water (20 C) - 1.333

Zinc Crown Glass - 1.517

STP means standard temperature and pressure. For the sake of 3D, we will assume that the environment is always at STP.

Now, this all works perfectly fine for objects of a solid material. But what about when a refractive object is in contact with another refractive object (in example, water in a glass)? You need to consider this, or it will look entirely wrong. To solve this problem, the smart folks at mental imaging created the dialectric material. To use this, open up the material editor and change the material from standard to mental ray (if it doesn't appear, you need to change your rendering engine to mental ray).

You'll be presented with this:

This allows for the ability to create the index of refraction, and the index of the object it is touching (shown as the one with (out) next to it). Here's a good example.

This scene is lit with one area light, with GI and caustics enabled. The cup consists of four parts, The glass, the area where the water touches the glass (which is actually some faces of the glass mesh detached and given a new material), the top of the glass (including meniscus, this is very important when doing liquid in containers), and the cylinder inside. There are three materials, one is "glass-air", which is the glass touching the air. This has the persistance distance changed to 10 (all three of these do, it makes it so it allows light from farther away in the scene), and the index of refraction set at 1.5 The second is water-air, which is the same as glass-air except it has the IOR set at 1.333. The final one is water-glass, it is the most important. Seeing as the whole object is the water, the initial IOR is at 1.333, but seeing as it is touching the glass, the IOR (out) is set to 1.5. In addition, the outside light persistance color swatch is changed from black to white, so it allows much light to go through it. If it were black, it would allow no light to go through it, and it would be a black color.

So that's it for now. A part 2 (on HDRI) will come when I feel up to it.

##### Share on other sites

Moto, you gotta give me private classes please, now i got a lot of free time.

and why would you put a tampon in a glass of water?

## Create an account

Register a new account

×