Transparent objects and Blender

Transparency and light refraction within a transparent material are key parameters in order to get a realistic rendering of a material like solid glass. This tutorial doesn't help with getting caustic spots, which is beyond the reach of the actual version of Blender without using an external renderer like Yafaray or Luxrender.

For Blender: 2.50 Alpha 2 or better

1. 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 Render menu. The Shading panel shows an option labeled Ray Tracing you will have to activate in order to use raytracing in your pictures.

2. Setting transparency

. you will find the Alpha parameter whose value ranges from 0. For example. it blends the Diffuse material color with the World menu's World colors (textures included) according to the opacity Alpha value. The second method is a good compromise between results (at a given distance) and computation times.000 (object totally visible). the object will have a mix of only 25% (Alpha x 100 %) of the Diffuse color. Blender can use not less than three different methods to handle transparency:    "World" based transparency Z-Depth based transparency Raytraced transparency Only the latest is considered modern and realistic. Apart from setting any Alpha value in the Transparency panel. such a render will give you a ghostly material.1 "World" based transparency This is the most primitive type of transparency. which will be disappointing if you want to achieve some realistic results. you can define the base color of your object within the Diffuse panel tab thanks to the color picker. for example). Obviously. unless you have no blocking objects in the view behind the transparent surface (some outdoor scenes. which will reduce the ghostly effect. you can somehow cheat even in closed environments by adding a texture to the World.000 (object totally invisible) through 1.250. computation timewise. Basically. In the Transparency panel. you don't have anything else to do to enjoy this method.In the Material menu. 2. and 75% (the complementary part: (1-Alpha) x 100 %) of the World color. Unfortunately. with an opacity Alpha value of 0. but the two others are cheaper. depending of the World settings. just like usual.

as a scanliner. the results are better looking. In order to benefit from this technique. there are blocking objects in the background and their colors DO matter and have to be viewed throuh the front transparent object. With this method. the scanliner will pick the color of the next surface immediately behind it in the Z-buffer and mix it according to the opacity of each materials. . Unfortunately.2 Z-Depth based transparency Unfortunately. For example. Basically. most of time. as show in the following picture. and to activate the Z Transparency button. so it is very easy for it to sort the surfaces from the point of view of the scene. still with an Alpha value of 0.250. the rendered pixel would have a color made from 75% of the color of the object standing behind it and 25% of the Diffuse color of the transparent object. the transparent surfaces seem to lack thickness and density of some sort. when deciding the color of a given pixel from the final rendered image. Blender virtually stores the distances of any surface point from the camera in a depth buffer called the Zbuffer. if it belongs to a transparent surface. and easily take into account multiple transparent surfaces.2. in the Transparency panel. Luckily. you have to make sure that Transparency option is ticked on.

and not anymore the background set in the World menu. the ray will be defelected by the curves of the transparent surface according to its density.3 Raytraced transparency When you look through a glass. This phenomenon is called refraction. But in order to get the image distorsion through the transparent surface. an ashtray.2. a bottle. go back into the Transparency panel and activate the Raytrace button. It currently can only be done using raytracing: a ray in sent from the camera . As for the Z Transparency test case. or any fancy glass object. then showing a slightly different part of the environment. In order to set this behavior. and simulating it would add a lot of realism to the render. you have to set the density of the material. instead of showing what is exactly behind it on the same trajectory. . the glass object will show the objects standing behind it. you will see that the background environment is deformed by the thickness and the curves of the object. when it reaches a transparent surface.

Jump to 3. but two values are very useful and should be known by any serious 3D enthusiast: 1. the first one being just an approximation.3 Fresnel. Fac By default.52 for glass and 1.000 in order to witness the refraction phenomenon. 2.3. the number of transparent surfaces stacked behind each other along the ray direction. 2.3.1 IOR Setting the density is as simple as increasing the value of the IOR slider beyond 1. according to their base shader. faster to compute. that is. The first depends on scanline calculations. nothing prevent you from mixing the two methods within a single scene.2 Depth This button lets you set the "depth" of the transparency. and using the Blend button. while the second depends on raytracing calculations. for more information on this. . From upper left to bottom right: Depth values of 1. though! Obviously. the material is rendered with a transparency level even on all its surface. you can fine-tune the Fresnel effect. from the actual point of view of the scene. Behavior is quite close to Fresnel effect applied to reflective materials.1 Light refraction.3. The second is the most physically accurate method. 2. The transparent materials in excess of this threshold will be rendered plain and solid. 4 and 10 2. you can artificially make the material more plain and solid on the outer edges. By increasing the Fresnel value.You will notice that the ZTransp and Ray Transp buttons are mutually exclusive. in order to optimize calculation times where realism would not be noticeable enough. and that will be effectively rendered as transparent materials. hereafter.33 for water.

546 * Amethyst 1.2 Shadows cast by transparent objects Now we delete the texture of the ground and give the lamp a different orientation. based on the density of the material. We can notice that all the objects (cube. you have to adjust the . but is deflected according to the curvature of the object and its density. Blender can easily take into account the transparency of the material in order to cast more or less solid shadows (and even provide the shadow a hue depending of the color of the transparent surface). we will see that they should be lighter. In fact. for example.0002926 * Alcohol 1.610 * Water (gas) 1.000261 * Water 100'C 1.33157 3. and you will find the proper answers hereafter.620 * Turquoise 1. etc. you will most probably come to some more questions about its usage. choosing the good values for the Index of Refraction is not easy. This phenomenon is called light refraction. 3.50 * Quartz 1.) have solid shadows. Of course. and then setting the IOR slider (Index of Refraction) with a density value greater than 1.329 * Amber 1. spheres.51714 * Oxygen (gas) 1. In Blender.00. with transparent objects. in order to be able to see shadows in the foreground.576 * Glass 1. with curved surfaces) and when you saw for the first time a distortion of the objects located in the background of it. Hints to know about Even if you know have a fair basic knowledge of transparency.000276 * Oxygen (liq) 1. the path of the light is no more linear.544 * Diamond 2. glasses. like glass.221 * Plastic 1.1 Light refraction You certainly have been surprised when looking through a drinking glass (or any other glass object.3.33335 * Water 35'C (Room temp) 1.544 * Topaz 1. while if we carefully look at the shadows of a real glass on a table.460 * Plexiglas 1. Here's a short abstract from them. you can simply reproduce it by activating the Raytrace option in the Transparency panel.31819 * Water 20'C 1.417 * Emerald 1. with some common values. but there are many documents containing whole lists of materials with their associated IOR. * Air 1. For this.

and not the shader of the object emitting the shadow: this is the only tricky step of this tutorial. In order to conclude on this topic. frosted or smoked glasses. you can settle blurry refrections for transparent objects. For example.850. 3.4 Colored glass . Then acitvate the Receive Transparent tick option and notice how the shadows look different now. in the Shadow panel. Without and with the option Receive Transparent activated 3. let's select the ground of the scene. with the proper shaders. and go to the Material menu. This property is very interesting for the simulation of depolished. in the following picture.3 Blurry refractions The very same way blurry reflections has been implemented. the Gloss value has been set at 0.shader of the object receiving the shadow. The other properties (Samples and Threshold) work the same as for the blurred reflections tutorial.

From top left to bottom right. while the colors of the background are dominant.750 and 1. The values close to 1.000 makes the base color of the material to be dominant. This is the case for vases. Try to give to the material a classic "bottle green" color: The result is not satisfactory. Filter values of 0.000 .A lot of the glass objects in our surroundings are colored. 0. because the hue is very feint.000 makes the background colors to be dominant. 0. you will have to use the Filter parameter. In order to achieve the illusion of colored glass.500. bottles or any fancy glass objects.250. while the values close to 0.

Sign up to vote on this title
UsefulNot useful