For Blender: 2.32 - Version française disponible(fr)

Preliminaries

As well as anything related to raytracing with Blender, because of the supplementary calculus time required by your computer, raytracing is only an option that you should feel free to activate and deactivate. This is done by the mean of the Scene menu (F10 key). The Render tab shows a button labeled Ray you will have to activate in order to use raytracing in your pictures.

scene

Setting transparency

In the Shading menu (F5 key), you can define the color of your object within the Material tab thanks to four components; three of these components are for color (R, G, B resp. stand for Red, Green and Blue), and the last one is a component of transparency (A stands for Alpha). As with the color components, the transparency is set through the use of a slider, its value going from 0.000 (object totally invisible) to 1.000 (object totally visible). In other words, with an Alpha value of 0.250, at the point of observation, the object will have a mix of 75% [(1-Alpha) x 100 %] of the color of the background, and 25% [Alpha x 100 %] only of its own color.

Alpha

Such a render will give you a ghostly material, which will be not enough if you want to achieve the same kind of results as a transparent material, like glass, that has a thickness and a density. In this case, it's the color of the background (defined in the World menu) which will be mixed with the color of the object, and not the colors of the other objects located behind the transparent object. The following picture clearly shows this kind of transparency, which is probably not the one you are after.

SphereAlpha

In order to correct this, we will jump to the Mirror Transp tab and simply activate the Ray Transp button. From now, the sphere will show the objects located behind it, and no more the background from the World menu.

RayTransp

SphereRayTransp

  • Depth

This button lets you set the "depth" of the transparency, that is, the number of transparent surfaces "hidden" behind each other, and that will be effectively rendered as transparent materials. The transparent materials in excess of this treshold will be rendered plain and solid, according to their base shader.

depth

  • Fresnel, Fac

By default, the material is rendered with a transparency level even on all its surface. By increasing the Fresnel value, you can artificially make the material more plain and solid on the outer edges, and using the Fac button, you can intensify the Fresnel effect.

fresnel

Light refraction

You certainly have been surprised when looking through a drinking glass (or any other glass object, with curved surfaces) and when you saw a distortion of the objects located in the background of it. In fact, with transparent objects, like glass, the path of the light is no more linear, but is deviated according to the curvature of the object and its density. This phenomenon is called light refraction. You can simply reproduce it by activating, in the Mirror Transp tab, the Ray Transp button and by giving to the IOR slider (Index of Refraction) a value greater than 1.00 (1.50 in our example picture).

SphereIOR

Of course, choosing the good value for the Index of Refraction is not easy, but you are not condamned to rely only on your artistic choice. There are many documents containing whole lists of materials with their associated IOR, based on the density of the material. One of these lists could be find on the following link: http://www.3d-designer.dk/resource/ior.html (thanks Modron for the link!). Here's a short abstract from it, with some common values.

Air 1.0002926
Alcohol 1.329
Amber 1.546
Amethyst 1.544
Diamond 2.417
Emerald 1.576
Glass 1.51714
Oxygen (gas) 1.000276
Oxygen (liq) 1.221
Plastic 1.460
Plexiglas 1.50
Quartz 1.544
Topaz 1.620
Turquoise 1.610
Water (gas) 1.000261
Water 100'C 1.31819
Water 20'C 1.33335
Water 35'C (Room temp) 1.33157

Shadows of tranparent objects::

Now we will delete the former texture from the ground, and locate the light source elsewhere so that we could watch the shadows of the objects in the foreground. We can see that the two objects, the solid crate as well as the transparent sphere, have solid shadows, while by carefully watching the shadow of a drinking glass, we can easily see that its shadow should be less solid.

NoTraShad

Blender can easily take into account the transparency of the material during the rendering process of the shadow (and even give the shadow a hue according to the color of the object). To do that, you will have to update the shader of the object that should receive the semi-transparent shadow, and leave alone the shader of the object emitting the shadow (this is the only not obvious part of the tutorial). So we have to select the ground of our scene, then to jump to the Shading menu (F5 key) and its Shaders tab. We activate the TraShado button and then we can see the difference between the shadows of our two objects.

TraShad