From BlenderWiki

Jump to: navigation, search
Blender 2.37a+

Glass and other transparent materials are very easy to create if you use Raytracing. With Raytracing you get realistic reflections and refractions. Two effects are still missing, you would have to use Yafray for them (or fake them):

  1. Caustics (e.g. the brighter spots behind a glass)
  2. Dispersion (color dependent refraction, e.g. rainbow colors)

[edit] Model the Glass

The model of a wine glass

At first you have to model the body of the glass (example). If you want hollow glass (like drinking glasses) you have to model the inside and the outside. Make sure the normals are pointing in the right directions, they have to point consistently outside, i.e. away from the glass surface. With Ctrl N you can Recalculate Normals Outside if necessary.


[edit] Choose the right material settings

We are going to make basic, simple, clear glass. So the material settings are quite simple:

Material settings for clear glass

Give the material lots of Specularity, turn Ray Mirror and Ray Transp on. The IOR (Index of Refraction) controls how much the glass refracts light. A value of 1.55 is quite good for common glass.

The Ray Transp Depth sets the maximum number of transparent surfaces a single ray can travel through (+1). So two glasses in a row have 8 surfaces, the Depth has to be 7. For an explanation of the other values see Reflections and Transparencies.

[edit] Turn Raytracing on

Depending on your Blender version Raytracing is enabled by default in the Render panel in the Scene context (F10). If it's not, turn it on.

Use Ray Shadow lamps.

[edit] Build an environment

Some glass. Raytracing Shadows.

Give your glass something to reflect and refract. If you have a pitch black surrounding, your glass will be practically invisible. Load an image in your world texture! Turn on TraShadow for the material that receives the shadows.

As you can see in the first example (Some glass), the shadows are not very realistic, they are much to bright. These kind of shadows would be good though for very thin glass, like lightbulbs.

You will get better shadows with dupliverted spots and buffered shadows, a technique described in the section Buffer Shadows / Faked Area Light (Glass with buffered Shadows). An additional lamp in the foot of the glass is necessary to brighten the too dark shadows there (Lightsetup with dupliverted Spots).

Lightsetup with dupliverted Spots. An additional Lamp in the foot of each glass brightens that shadow.

It's more difficult to set it up, but well worth the effort.

Glass with buffered Shadows.