Raytraced Mirror Reflections
Mode: All Modes
Panel: Shading/Material Context → Mirror Transp
Raytracing can be used to make a material reflect its surroundings, like a mirror. 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.
You need to enable raytracing in your scene settings if you want to use raytraced reflections. This is done in the Scene/Render context → Render Panel. Raytracing is enabled by default in Blender 2.37 and higher.
The Mir setting on the Material panel is the color of the light reflected back. Usually, for normal mirrors, use White. However, some mirrors color the reflection, so you can change the color by clicking on the swatch on that panel. The Mirror Transp panel determines how and whether the mirror actually is active and reflects things. If you set RayMir to something >0, then the mirror is active. The reflection will be the tinted the color you set on the Material panel.
- Ray Mirror
- Enables and disables raytraced reflections
- 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.
- 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).
- A controlling 'factor' to adjust how the blending (between reflective and non-reflective areas) happens.
- In paint, a high-gloss finish is very smooth and shiny. A flat, or low gloss disperses the light and gives a very blurry reflection. Also, uneven or waxed-but-grainy surfaces (such as car paint) are not perfect and therefore slightly need a Gloss < 1.0. In the example to the right, the left mirror has a Gloss of 0.98, the middle is Gloss = 1.0, and the right one has Gloss of 0.90. Use this setting to make a realistic reflection, all the way up to a completely foggy mirror. You can also use this value to mimic depth of field in mirrors.
- The amount a reflection is stretched in the tangent direction. If the tangent shading option is on, Blender automatically renders blurry reflections as anisotropic reflections.
- When Tangent is switched on, the Aniso slider controls the strength of this anisotropic reflection, with a range of 1.0 (default) being fully anisotropic and 0.0 being fully circular, as is when tangent shading on the material is switched off. Anisotropic raytraced reflection uses the same tangent vectors as for tangent shading, so you can modify the angle and layout the same way, with the auto-generated tangents, or based on the mesh's UV co-ordinates.
- The number of samples to average to arrive at the pixel's final color. More samples will give a smoother result, but the greater the number of samples, the slower the render speed.
- The threshold for adaptive sampling. Sampling is skipped when no more samples are deemed necessary, by checking the statistical variance of the samples so far for that pixel against the threshold. Raising the threshold will make the adaptive sampler skip more often, however the reflections could become noisier.
- Sets the maximum number of bounces 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.
- Max Distance
- The number of blender units away from camera (Z-Depth) beyond which to stop calculating the actual reflection and to simply use the fade-out method. In the example, there is a mirror behind the camera, 10 blender units from the middle mirror. The top reflection of Suzy is actually a reflection of the reflection off the back mirror. The front mirror has Max Distance set to 20, so, as you can see, it is starting to fade to sky color.
- Ray-End Fade Out
- For objects that recede away from the camera, further than Max Distance set above, you can have the mirror effect fade out, which reduces compute time. A large reflecting pond, at the far side, just fades out to be the sky color. You have two choices:
- Fade to Sky color - Uses the sky color in the world settings
- Fade to Material color - uses the material color
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. In the example above, the middle mirror has the mirror color set as shown to the right.
Let's undertake a small experiment in order to understand what Fresnel 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 Demonstration of Fresnel effect with values equal to (from top to bottom) 0.0, 2.5 and 5.0, this behavior is demonstrated for a perfectly reflective Material (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.
For more information, including other examples and in-depth discussion, please visit:
(note: all three links are broken)
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.
Environment Maps (EnvMaps) can also be used to simulate reflective materials. Environment maps are more complicated to set up, have many limitations and are much less accurate, particularly on non-planar surfaces. However, Environment maps can be a lot faster to render and support extra features like filtering the reflection map to fake blurred reflections.