Manual/PartIII/Reflections and Transparencies
Wikipedia,自由的百科全书
Contents |
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. 在过去,Blender使用环境映射来仿真物体的影子。但是这可能是一个复杂的方法,当想要一个纯粹的反射平面时,需要借助于辅助对象(null/empty objects)和层。幸运的是,引入了光线跟踪的渲染器简化了这个处理过程并且使得更容易获得更大的真实感。
| Note: 注意 |
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.
光线反射的原理是很简单的:我们可以将反射物体想象为一面镜子或者一个比较光滑的金属平面,我们从摄象头发出了一缕光线,它穿过了屏幕,只到它遇到一个物体为至,如果它遇到的第一个物体为不反射物体,那么它将在此消失并且带上这个物体的颜色,如果它遇到的是一个反射物体,那么它将在此发生反射,只到它遇到一个不反射物体为至,反射物体将会继承它周围环境的颜色(就如同一个镜子一样),而物体反射能力的大小由raymir的值来控制,如果屏幕上全是反射物体,那么反射将会永远进行下去,而我们的电脑却是承受不了这样的循环的,因此我们通过设置depth的大小来控制一缕光线最大的反射次数.
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.
如果我们想让我们所做的反射设置生效的话,那么首先我们要做的就是按下ray mirror按钮,这样我们的材质才会有反射的效果出现. 对于其它的几项参数设置: fresnel:主要是设置fresnel反射的大小(天知道是什么反射,不过下面有图片来显示不同值的效果). fac:主要设置的是反射区域和不反射区域在渲染时的过渡效果.
| 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.
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).
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. |
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.
对于光线折射的原理和光线的反射原理是差不多一样的,我们可以将折射物体想象为一个玻璃或者水,只是将反射改为了折射而已,最大的不同在于,折射物体的颜色是其背景的颜色,这主要是通过设置材质中的alpha来控制的,其中通过ior来设置折射的大小,depth来设置折射次数,其它和反射一样.
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 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! |
|




