From BlenderWiki
Editor's Note: This page is orphaned. It was split into two pages for the current user manual.
[edit] Raytracing Reflections
In the past, Blender used EnvMaps (environmental maps) in order to simulate the reflectiveness of objects. But this could be a complicated method, needing the use of Empties (null objects) and layers when the desired result was a mere reflecting plane. Fortunately, including Raytracing in the renderer simplified the process and made it easier to achieve greater realism.
Note
You need to allow raytracing if you want to benefit from reflections. This is done in the Render Panel of the Scene buttons (F10): activate the Ray button. Raytracing is activated by default in Blender 2.37 and higher.
|
[edit] Understanding the basics
The principle of raytraced reflections is very simple: a ray is fired from the camera and travels through the scene until it encounters an object. If the first object hit by the ray is not reflective, then the ray takes the color of the object. If the object is reflective, then the ray bounces from its current location and travels up to another object, and so on, until a non-reflective object is finally met and gives the whole chain of rays its color. Eventually, the first reflective object inherits the colors of its environment, proportionally to its RayMir value. Obviously, if there are only reflective objects in the scene, then the render could last forever. This is why a mechanism for limiting the travel of a single ray has been set through the Depth value: this parameter sets the maximum number of bounces allowed for a single ray.
[edit] The Ray Mirror buttons
For the reflections to be active at all, you need to activate, initially, the Ray Mirror button. The Mirror Transp Panel. shows parameters available for raytraced reflections, in the first block of settings.
RayMir Sets the amount of reflectiveness of the object. Use a value of 1.00 if you need a perfect mirror, or set RayMir to 0.00 if you don't want any reflection. Depth Sets the maximum number of recursions for a single ray to be reflected. The default Depth of 2 is typically a good value. If your scene contains many reflective objects and/or if the camera zooms in on such a reflective object, you will need to increase this value if you want to see surrounding reflections in the reflection of the reflected object (!). In this case, a Depth of 4 or 5 is typically a good value. Fresnel Sets the power of the Fresnel effect. The Fresnel effect controls how reflective the Material is, depending on the angle between the surface normal and the viewing direction. Typically, the larger the angle, the more reflective a Material becomes (this generally occurs on the outline of the object). Fac A controlling 'factor' to adjust how the blending (between reflective and non-reflective areas) happens.
Note
Please note that in order to get a physically accurate Fresnel effect with the current algorithm, you have to
set Fresnel to 5.0 and Fac to 1.25. Nevertheless, you can play with these values for the sake of artistic freedom, if you feel the need to. |
Still having trouble understanding what the Fresnel effect is?
Let's undertake a small experiment in order to understand what it is really about. After a
rainy day, go out and stand over a puddle of water. You can see the ground through the puddle.
If you kneel just in front of the puddle, your face close to the ground, and look again at a distant
point on the puddle of water, the liquid surface part which is closer to you lets you see the ground,
but if you move your gaze towards the other end of the puddle, then the ground is gradually masked
until all you see is the reflection of the sky. This is the Fresnel effect: having a surface sharing
reflective and non-reflective properties according to the viewing angle and the surface normal.
In the following Demonstration of Fresnel effect with values equal to (from top to bottom) 0.0, 2.5 and 5.0, this behavior is perfectly well demonstrated
for a Material perfectly reflective (RayMir 1.0).
Fresnel 0.0 stands for a perfect mirror Material, while Fresnel 5.0 could stand for a glossy Material (varnished wood, for example?). It's barely noticeable but in the lower picture, the Material is perfectly reflective.
[edit] Colored reflections
By default, an almost perfectly reflective Material like Chrome, or a Mirror object, will reflect the exact colors of its surrounding. But some other equally reflective Materials tint the reflections with their own color. This is the case for well polished copper and gold, for example. In order to replicate this within Blender, you have to set the Mirror Color accordingly. (See BSG.MAT.F.S68.204).
[edit] Raytraced Transparencies
Relevant to Blender v2.37 Transparency and light refraction within a transparent material are key parameters in order to get a realistic rendering of a material like solid glass.
Note
You need to allow raytracing if you want to benefit from transparency.
This is done in the Render Panel of the Scene buttons F10: activate the Ray button. In Blender 2.37 and higher, raytracing is activated by default. |
[edit] Understanding the basics
If you easily followed the explanation of raytraced reflections, you will have no trouble with raytraced transparencies either, because the basics are the same, apart from a few details. A ray is shot from the camera and travels through the scene until it encounters an object. If the first object hit by the ray is non-transparent, then the ray takes the color of the object. If the object is transparent, then the ray continues its travel through it to the next object, and so on, until a non-transparent object is finally encountered which gives the whole chain of rays its color. Eventually, the first transparent object inherits the colors of its background, proportionally to its Alpha value (and the Alpha value of each transparent Material hit in-between). But while the ray travels through the transparent object, it can be deflected from its course according to the Index of Refraction (IOR) of the material. When you actually look through a plain sphere of glass, you will notice that the background is upside-down and distorted: this is all because of the Index of Refraction of glass.
[edit] The Ray Transp buttons
For the transparency to be active at all, you need to activate, initially, the Ray Transp button. The Mirror Transp Panel. shows parameters available for raytraced transparencies, in the second block of settings. You also need to set the Alpha value of the Material to a number less than 1.0 (fully opaque, 0.0 being fully transparent). Please check materials_in_practice_tweaking_materials in order to learn more about this parameter and its usage.
IOR Sets how much a ray travelling through the Material will be refracted, hence producing a distorted image of its background (Influence of the IOR of an Object on the distortion of the background: spheres of Water, Glass and Diamond (top to bottom).). There are different values for typical materials: Air is 1.000 (no refraction), Alcohol is 1.329, Glass is 1.517, Plastic is 1.460, Water is 1.333 and Diamond is 2.417. Depth Sets the maximum number of transparent surfaces a single ray can travel through. There is no typical value. Transparent objects outside the Depth range will be rendered pitch black if viewed through the transparent object that the Depth is set for. In other words: if you notice black spots on the surface of a transparent object, this means that you have to increase its Depth value (this is a common issue with raytracing transparent objects).
Fresnel Sets the power of the Fresnel effect. The Fresnel effect controls how transparent the Material is, depending on the angle between the surface normal and the viewing direction. Typically, the larger the angle, the more opaque a Material becomes (this generally occurs on the outline of the object). Fac A controlling 'factor' to adjust how the blending (between transparent and non-transparent areas) happens.
Note
Please note that in order to get a physically accurate Fresnel effect with the current algorithm, you have to
set Fresnel to 5.0 and Fac to 1.25. Nevertheless, you can play with these values for the sake of artistic freedom, if you feel the need to. If you need more explanation of the Fresnel effect, please refer to materials_ray_mir_buttons, Raytracing Reflections. |
Raytraced transparency tip: casting transparent shadows
By default, the shadows of transparent objects are rendered solid black,
as if the object was not transparent at all. But in reality, the more transparent an object is, the lighter its shadow will be. This could easily be taken into account, but there's nothing more to do with the transparent object settings. You will now have to deal exclusively with the nearby objects that will receive shadows from the transparent object. Select the object which is to receive the transparent shadow (for example, the floor or a wall), toggle into the Shading menu (F5 key) and look at its Shaders Panel. Find and press the TraShado button. That's all there is to it. (See Casting transparent shadows: TraShado 'off' on the left, TraShado 'on' to the right.). The transparent object's shadow is now lighter, according to the Alpha value of the Material. |
Redirects to fix
- Manual/PartIII/Multiple Materials → Tutorials/Multiple Materials
- Manual/PartIII/Ramp Shaders → Manual/Ramp Shaders
- Manual/Raytraced Reflections → Doc:Manual/Materials/Properties/Raytraced Reflections











![[]](/skins/blender/open.png)
