Manual/PartV/Buffer Shadows

Wikipedia,自由的百科全书

User Manual: Contents | Guidelines | Blender Version 2.37

This needs badly to be edited

Contents

Shadow Buffer 阴影缓存

The lighting schemes analysed up to now produce on the objects only areas which are more or less lit, but no cast- or self-shadowing, and a scene without proper shadowing looses depth and realism.

分析至今的照明方案只能改变物体已经被照亮的区域的亮度,它不能投射或是单独产生阴影,一个没有合理阴影的场景在深度和逼真度方面都将表现的很差。

On the other hand, proper shadow calculation requires a full - and slow - ray tracer.

另一方面,合理的阴影计算需要完全射线追踪,因此需要时间。

For a scan liner, as Blender is, shadows can be computed using a shadow buffer for shadow casting lights. This implies that an 'image', as seen from the Spot Light itself, is 'rendered' and that the distance for each point from the spotlight saved. Any point of the rendered image further than any of those points is then considered to be in shadow.

就像Blender实现那样,对一条扫描线来说,阴影可以通过阴影缓存来计算。这意味着一幅图像将模拟从聚光灯位置看去的效果进行渲染,图像中每个点到聚光灯的位置都将被记录。距离大于这些记录点的地方就认为处于阴影区域。

The shadow buffer stores this data. To keep the algorithm compact, efficient and fast this shadow buffer has a size which is fixed from the beginning and which in Blender can be from 512x512 to 10240x10240. The higher value is the most accurate.

阴影缓存将保存这些数据。为了使算法简捷、高效和快速,阴影缓存从一开始就有固定的尺寸。在Blender中可以在 512x512 到 10240x10240 之间的范围进行选择。最大值也具有最大精确度。

The user can control the algorithm via the bottom buttons in the Spot Panel (Spot Light shadow buttons.).

用户可以通过聚光灯面板的底部按钮对算法进行控制(聚光灯阴影按钮)。

Spot Light shadow buttons.聚光灯阴影按钮
Spot Light shadow buttons.聚光灯阴影按钮

ShadowBuffSize - Numeric Button, from 512 to 10240, defining the shadow buffer size.

阴影缓存大小 - 数字按钮,从 512 到 1024,定义阴影缓存的尺寸。

ClipSta, ClipEnd - To further enhance efficiency the shadow computations are actually performed only in a predefined range of distances from the spot position. This range goes from ClipSta, nearer to the Spot light, to ClipEnd, further away (BSG.LIG.F.S68.112). All objects nearer than ClipSta from the Spot light are never checked for shadows, and are always lit. Objects further than ClipEnd are never checked for light and are always in shadow. To have a realistic shadow ClipSta must be less than the smallest distance between any relevant object of the scene and the spot, and ClipEnd larger than the largest distance.

剪切起始,剪切结束 - 为了增强效率,阴影计算实际上仅仅处理那些距离聚光灯位置在预定义范围的点。这个范围从剪切起始开始,到剪切结束位置,越靠近聚光灯就越远离(BSG.LIG.F.S68.112)。所有比剪切起始近的区域都不计算,直接置于阴影中。为了使阴影效果真实,剪切起始必须小于场景中物体到聚光灯距离的最小值,剪切结束必须大于最大值。

For the best use of the allocated memory and better shadow quality, ClipSta must be as large as possible and ClipEnd as small as possible. This minimizes the volume where shadows will be computed.

为了更有效地使用分配的内存,并且达到更好地阴影效果,剪切起始必须尽可能大,剪切结束必须尽可能小。这就能最大程度地减少需要计算阴影的空间体积。

Samples - To obtain soft shadows the shadow buffer, once computed, is rendered via its own anti-aliasing algorithm which works by averaging the shadow value over a square of a side of a given number of pixels. Samples is the number of pixels. Its default is 3, that is a 3x3 square. Higher values give better anti-aliasing, and a slower computation time.

采样 - 为了获得平滑的阴影,阴影缓存一旦被计算,就将通过它自身的反走样算法进行渲染。该算法通过在一个尺寸(每边包含的象素数量)给定的正方形内对阴影值进行均值计算实现。

Bias - Is the bias used in computing the shadows, again the higher the better, and the slower.

偏移 - 阴影计算中使用偏移时,偏移值越高,计算时间越长。

Soft - Controls the softness of the shadow boundary. The higher the value, the softer and more extended the shadow boundaries will be. Commonly it should be assigned a value which ranges from the same value of the Sample NumButton to double that value.

平滑 - 控制阴影边界的平滑程度。值越高,阴影边界越平滑,阴影延伸的越多。通常该值应该在采样按钮的值及其倍值之间选择。

Halo step - The stepping of the halo sampling for volumetric shadows when volumetric light is on. This will be explained in lighting_volumetric_light.

光晕步长 - 设定当立方体灯光打开时,立方体阴影的光晕采样步长。我们将在lighting_volumetric_light中作进一步解释。

Spot Light shadow examples.聚光灯阴影示例
Spot Light shadow examples.聚光灯阴影示例
Note:

For Shadows to be rendered, they must be enabled at a global level. This means that the Shadow Button of the Render Panel in the Scene Context and Render Buttons must be on!

要渲染的阴影必须在世界级别上被激活。也就是说在场景环境中,渲染面板的阴影按钮和渲染按钮必须按下!

Volumetric Light 体积灯光(灯光含有雾的效果)

Relevant to Blender v2.31 Volumetric light is the effect you see in a hazy air, when the light rays become visible because of light scattering which occurs due to mist, fog, dust etc.

与Blender v2.31相关立方体灯光就是当灯光射线因为霁、雾、尘埃等等变得可见时,你在朦胧的空气中看见的效果。

If used carefully it can add much realism to a scene... or kill it.

如果小心地运用,它可以增加场景的逼真度…… 或是毁了它。

The volumetric light in Blender can only be generated for Spot Lights, once the Halo button in the Spot Panel is pressed (Spot Light halo button.).

一旦聚光灯面板的光晕按钮被按下(聚光灯光晕按钮。),Blender中的立方体照明只能由聚光灯产生。

Spot Light halo button.聚光灯光晕按钮
Spot Light halo button.聚光灯光晕按钮

If the test set up shown in Spot Light setup. is created, and the Halo button pressed, the rendered view will be like Halo rendering..

如果创建聚光灯构件中展示的构件,并且光晕按钮被按下,视图渲染的效果将类似于光晕渲染……

Spot Light setup.聚光灯构件
Spot Light setup.聚光灯构件
Halo rendering.光晕渲染
Halo rendering.光晕渲染

The volumetric light effect is rather strong. The intensity of the Halo can be regulated with the HaloInt slider (Halo Intensity Slider.). Lower values corresponding to weaker halos.

立方体照明效果更明显。光晕亮度可以通过光晕亮度滑块调节(光晕亮度滑块。

Halo Intensity Slider.光晕亮度滑块
Halo Intensity Slider.光晕亮度滑块

The result is interesting. We have volumetric light, but we lack volumetric shadow! The halo passes through the sphere, yet a shadow is cast.

结果很有趣。我们有了立方体照明,但是缺少立方体阴影!光晕移过球体,阴影才会产生。

This is due to the fact that the Halo occurs in the whole Spot Light cone unless we tell Blender to do otherwise.

这是因为光晕位于聚光灯照明的整个圆锥体中,除非我们告诉Blender不这么做。

The cone needs to be sampled to get volumetric shadow, and the sampling occurs with a step defined by the HaloStep NumButton (Halo Step NumButton.).

圆锥体需要被采样,以获得立方体阴影。采样步长由光晕步长数字按钮设定(光晕步长数字按钮。)。

The default value of 0 means no sampling at all, hence the lack of volumetric shadow. A value of 1 gives finer stepping, and hence better results, but with a slower rendering time (Halo with volumetric shadow, Halo Step = 1), while a higher value gives worse results with faster rendering (Halo with volumetric shadow, Halo Step = 12).

缺省值0意味着没有采样,因此就没有立方体阴影。值为1是一个不错的步长,因此阴影效果也不错,但是渲染时间较长(伴随光晕的立方体阴影,光晕步长 = 1)。步长值越大,渲染效果越差,但渲染越快(伴随光晕的立方体阴影,光晕步长 = 12)。

Halo Step NumButton.光晕步长数字按钮
Halo Step NumButton.光晕步长数字按钮
Halo with volumetric shadow, Halo Step = 1伴随光晕的立方体阴影,光晕步长 = 1
Halo with volumetric shadow, Halo Step = 1伴随光晕的立方体阴影,光晕步长 = 1
Halo with volumetric shadow, Halo Step = 12伴随光晕的立方体阴影,光晕步长 = 12
Halo with volumetric shadow, Halo Step = 12伴随光晕的立方体阴影,光晕步长 = 12
HaloStep values 光晕步长值:

A value of 8 is usually a good compromise between speed and accuracy.

通常8是一个不错的兼顾速度和效果的折衷值。

Tweaking Buffer Shadows 微调缓存阴影

Relevant to Blender v2.31

与Blender v2.31相关

Ok, now you've got the basics. Now we can really talk of light. We will work on a single example, more complex than a plain 'sphere over a plane' setup, to see what we can achieve in realistic lighting with Blender.

好了,我们有了基础知识了。现在我们真正可以谈灯光了。我们将试验一个简单的例子,比'平面上的球体'稍微复杂一点。让我们看看通过Blender我们可以得到怎样的真实照明。

We will resort to the setup in Light tweaking setup..

我们回到照明微调设置。中的构件。

The simian figure is Cornelius, Suzanne's baby brother.

这只猴子名叫科尼利厄斯,苏珊娜的弟弟。

He has a somewhat shiny light brown material (R=0.8, G=0.704 B=0.584, Ref=0.7, Spec=0.444, Hard=10 - Yes, not very monkey-like, but we are talking of lights, not of materials!) and stands on a blue plane (R=0.275, G=0.5, B=1.0, Ref=0.8, Spec=0.5, Hard=50). For now he's lit by a single spot (Energy=1.0, R=G=B=1.0, SpotSi=45.0, SpotBl=0.15, ClipSta=0.1, ClipEnd=100, Samples=3, Soft=3, Bias=1.0, BufSize=512).

他披着明亮的褐色材料(R=0.8, G=0.704 B=0.584, Ref=0.7, Spec=0.444, Hard=10 - 是的,不太像猴子,但是我们讨论的是灯光,不是材料!) 并且站在一块蓝色的平面上(R=0.275, G=0.5, B=1.0, Ref=0.8, Spec=0.5, Hard=50)。现在他被一盏聚光灯照亮(Energy=1.0, R=G=B=1.0, 聚光灯Si=45.0, 聚光灯Bl=0.15, 剪切开始=0.1, 剪切结束=100, 采样=3, 平滑=3, 偏移=1.0, 缓存大小=512)。

Light tweaking setup.照明微调构件
Light tweaking setup.照明微调构件

A rendering of Cornelius in this setup, with OSA=8 and Shadows enabled, gives the result in Simple Light Spot set up.. The result is ugly.

OSA=8并且激活阴影时科尼利厄斯的渲染,效果见简单聚光灯照明构件。。结果很难看。

You have very black, unrealistic shadows on Cornelius, and the shadow cast by Cornelius himself is unacceptable.

科尼利厄斯的阴影太黑,也不真实,并且科尼利厄斯自己产生的阴影是无法接受的。

Simple Light Spot set up.简单聚光灯照明构件
Simple Light Spot set up.简单聚光灯照明构件

The first tweak is on ClipSta and ClipEnd, if they are adjusted so as to encompass the scene as tightly as possible (ClipSta=5, ClipEnd=21) the results get definitely better, at least for projected shadow. Cornelius's own shadow is still too dark (Single Spot Light set up with appropriate Clipping.).

首先调整剪切起始剪切结束,如果它们被调整到尽可能紧凑地将场景包围的程度(剪切起始=5, 剪切结束=21),效果肯定更好。至少对于投影阴影而言。科尼利厄斯自身的阴影仍然太黑(适当地剪裁单聚光灯照明构件。)。

Single Spot Light set up with appropriate Clipping.适当地剪裁单聚光灯照明构件
Single Spot Light set up with appropriate Clipping.适当地剪裁单聚光灯照明构件

To set good values for the Clipping data here is a useful trick: 针对剪裁数据的设置,这里有一个诀窍:

Any object in Blender can act as a Camera in the 3D view. Hence you can select the Spot Light and switch to a view from it by pressing CTRL-NUM0. What you would see, in shaded mode, is shown in Spot Light Clipping tweak. Left: ClipSta too high; Centre: Good; Right: ClipEnd too low..

Blender中的任何物体在三维视图中都是一台摄像机。因此你可以选择聚光灯,并且通过CTRL-NUM0切换到物体摄像机视图。在阴影模式下你将会看见聚光灯照明调节。左:剪切起始值过大;中:不错;右:剪切结束值太小。

All stuff nearer to the Spot than ClipSta and further from the spot than ClipEnd is not shown at all. Hence you can fine tune these values by verifying that all shadow casting objects are visible.

所有距离聚光灯比剪切起始值小的,以及大于剪切结束值的空间都不显示。因此,你可以通过精确地调节这些值使所有物体的阴影可见。

Spot Light Clipping tweak. Left: ClipSta too high; Centre: Good; Right: ClipEnd too low.聚光灯照明调节。左:剪切起始值过大;中:不错;右:剪切结束值太小
Spot Light Clipping tweak. Left: ClipSta too high; Centre: Good; Right: ClipEnd too low.聚光灯照明调节。左:剪切起始值过大;中:不错;右:剪切结束值太小

What is still really lacking is the physical phenomenon of diffusion. A lit body sheds light from itself, hence shadows are not completely black because some light leaks in from neighbouring lit regions.

我们还没有实现漫反射的物理现象。光源从自身发射光线,因此阴影不是完全黑色的,因为一些光线会从临近照亮区域漏过来。

This light diffusion is correctly accounted for in a Ray Tracer, and in Blender too, via the Radiosity Engine. But there are set-ups which can fake this phenomenon in an acceptable fashion.

漫反射在射线追踪时将被正确地计算,在Blender中还要使用光能辐射引擎。但是有构件可以在一定程度上虚拟这种现象。

We will analyse these, from simplest to more complex.

我们将由浅入深地分析这些组件。

Three point light 三点灯照明法

The three point light set-up is a classical, very simple scheme to achieve a scene with softer lighting. Our Spot Light is the main, or Key, Light of the scene, the one casting shadow. We will add two more lights to fake diffusion.

三点照明组件在获得平滑光照场景的方法中是经典的,也很简单。我们的聚光灯照明是场景的主要(或者说是关键)的投射阴影的灯光。我们会另外增加两个灯光来模拟漫反射。

The next light needed is called the Back Light. It is placed behind Cornelius (Back Light set up.).

亮一个需要的灯光称为背灯光。它置于科尼利厄斯身后(背灯光组件。)。

This illuminates the hidden side of our character, and allows us to separate the foreground of our picture from the background, adding an overall sense of depth. Usually the Back Light is as strong as the Key Light, if not stronger. Here we used an Energy 1 Lamp Light (Key Light only (left) Back Light only (centre) and both (right).).

它照亮了我们主角的隐藏边,并且在加上全局的深度感觉之后,让我们可以区分图片的前景和背景。通常背灯光不强于主灯光时,和主灯光的亮度相同,、这里我们需要一个亮度为1的灯光(只有关键灯光(左)只有背灯光(中)两者都有(右)。)。

Back Light set up.背灯光组件
Back Light set up.背灯光组件
Key Light only (left) Back Light only (centre) and both (right).只有关键灯光(左)只有背灯光(中)两者都有(右)
Key Light only (left) Back Light only (centre) and both (right).只有关键灯光(左)只有背灯光(中)两者都有(右)

The result is already far better. Finally, the third light is the Fill Light. The Fill light's aim is to light up the shadows on the front of Cornelius. We will place the Fill Light exactly at the location of the camera, with an Energy lower than the lower of Key and Back Lights (Fill Light set up.). For this example an Energy=0.75 has been chosen (Key and Back Light only (left) Fill Light only (centre) and all three (right).). 效果已经好很多了。最后,第三盏灯光时填充灯光。填充灯光的目的时照亮科尼利厄斯身前的阴影。我们将填充灯光准确地放置在照相机所在位置,能量低于主灯光和背灯光的最低者(填充灯光组件。)。这个示例中已经选择了一盏能量=0.75的灯光(只有关键灯光和背灯光(左)只有填充灯光(中)三者都有(右)。)。

Fill Light set up.填充灯光组件
Fill Light set up.填充灯光组件
Key and Back Light only (left) Fill Light only (centre) and all three (right).只有关键灯光和背灯光(左)只有填充灯光(中)三者都有(右)
Key and Back Light only (left) Fill Light only (centre) and all three (right).只有关键灯光和背灯光(左)只有填充灯光(中)三者都有(右)

The Fill light makes visible parts of the model which are completely in darkness with the Key and Back light only.

在仅有主灯光和背灯光时完全处于阴影中的模型部分,在有填充灯光时也变得可见了。

Color leakage 颜色泄漏:

The three-point set up can be further enhanced with the addition of a fourth light, especially when a bright coloured floor is present, like in this case.

通过增加第四个灯光,三点照明组件可以被进一步增强。特别类似这种情况中的有一块明亮的着色地板时。

If there is a bright coloured floor our eye expects the floor to diffuse part of the light all around, and that some of this light impinges on the model.

如果的有一块明亮的着色地板,我们的眼睛就会希望地板漫反射部分光线,而且这些光线最终会作用在模型上。

To fake this effect we place a second spot exactly specular to the Key Light with respect to the floor. This means that - if the floor is horizontal and a z=0, as it is in our example, and the Key light is in point (x=-5, y=-5, z=10), then the floor diffuse light is to be placed in (x=-5, y=-5, z=-10), pointing upward (Floor Diffuse Light set up.).

为了模拟这种效果,我们放置第二个聚光灯在主灯光通过地面的准确镜面反射的路线上。这意味着如果地板是水平的,z=0(正如我们的例子所示的那样),并且主灯光在坐标(x=-5, y=-5, z=10)处,那么地板漫反射光线将被放置在(x=-5, y=-5, z=-10)处,方向朝上(地板漫反射光线组件。)。

Floor Diffuse Light set up.地板漫反射光线组件
Floor Diffuse Light set up.地板漫反射光线组件

The energy for this light should be lower than that of the Key Light (here it is 0.8) and its colour should match the colour of the floor (here R=0.25, G=0.5, B=1.0). The result is shown in Four Light set up..

该灯光的能量应该小于主灯光(此处为0.8)并且颜色应该匹配地板的颜色(这里R=0.25, G=0.5, B=1.0)。结果如所示四灯光组件

Four Light set up.四灯光组件
Four Light set up.四灯光组件

Please note that we used a Spot light and not a lamp, so it would be completely blocked by the floor (shadowed) unless we set this spot shadeless by pressing the appropriate button.

请注意我们使用的是聚光灯而非灯,所以它将被地板完全封闭(阴影化),除非我们通过按下相应的按钮将该聚光灯设置为无阴影模式。

Indeed we could have used a Lamp but if the floor is shiny the light it sheds is more reflected than diffused. Reflected light, physically is itself a cone coming from the specular source.

实际上如果地板可以发光并且它投射的光强于漫反射的光,我们就可以只设置一盏灯。

You can further enhance the effect by making the Spot cast shadows and by setting its ClipStart value high enough so that the plane casts no shadow, or by making it affect only its layer and placing the floor on another layer.

如果要进一步增强这个效果,你可以通过使聚光灯投射阴影,并且设置其剪切起始值足够大以至于平面不投射阴影;或是使聚光灯效果只作用于其所在层而地板处于另一层。

Three point light - Outdoor 三点灯照明法--室外照明效果

By using a Spot light as a key light the previous method is sadly bound to indoor settings or, at maximum, outdoor settings at night time. This is because the Key light is at a finite distance, its rays spread and the floor is not evenly illuminated.

通过将聚光灯用作主灯光,前面介绍的方法效果只局限于室内,或者最多影响到黑夜时的室外。这是因为主灯光在无限远处,它的射线四处发散,而不仅仅作用于地板。

If we were outdoor on a clear sunny day all the floor would be evenly lit, and shadows would be cast.

如果我们身处一个晴空万里的室外,所有地板都将被照亮且有阴影。

To have a uniform illumination all over the floor a Sun light is good. And if we add a Hemi light for faking the light coming from all points of the sky (as in BSG.LIG.F.S68.111) we can achieve a nice outdoor light... but we have no shadows!

为了使所有地板的照明效果一致,应该设置一个日光。如果我们增加一个半光来模拟从天空散射来的光线(如BSG.LIG.F.S68.111),我们就可以得到一个较好的室外照明了……但是我们没有阴影!

The setup of the Key light (the Sun, R=1.0, G=0.95, B=0.9, Energy=1.0) and the Fill/Back Light (both represented by the Hemi, R=0.8, G=0.9,B=1.0, Energy=0.4) is shown in Sun and Hemi light for outdoor set up. and the relevant rendering in Sun and Hemi light for outdoor rendering.

主灯光的设置(太阳R=1.0, G=0.95, B=0.9, Energy=1.0)和填充灯光/背灯光(都用半光表示,R=0.8, G=0.9,B=1.0, 能量=0.4)如室外时日光和半光照明所示,相关的渲染如室外时日光和半光渲染所示。

Sun and Hemi light for outdoor  set up.室外时日光和半光组件
Sun and Hemi light for outdoor set up.室外时日光和半光组件
Sun and Hemi light for outdoor rendering.室外时日光和半光渲染
Sun and Hemi light for outdoor rendering.室外时日光和半光渲染

The lack of shadow makes Cornelius appear as if he were floating in space. To have a shadow let's place a Spot coincident with the Sun and with the same direction. Let's make this spot a Shadow Only Spot (with the appropriate button). If Energy is lowered to 0.9 and all other settings are kept at the values used in the previous example (BufSize=512, Samples=3, Soft=3, Bias=1, ClipSta=5, ClipEnd=21) the result is the one of Outdoor rendering. (center).

缺少阴影使得科尼利厄斯看上去象漂浮在天空一样。为了产生阴影让我们放置一盏与日光方向一致的聚光灯。我们使它只在一点上产生阴影(当然要设置相应的按钮状态)。如果能量低于0.9,并且所有其它设置保持与前面例子中的一致(缓存大小=512, 采样=3, 平滑=3, 偏移=1, 剪切起始=5, 剪切结束=21),则结果就如室外渲染。(中)所示。

Outdoor rendering.室外渲染
Outdoor rendering.室外渲染

The shadow is a bit blocky because Cornelius has many fine details and the BufSize is too small, and the Samples value is to low to correctly take them into account. If BufSize is raised to 2560, Samples to 6 and Bias to 3.0 the result is the one in Outdoor rendering. (right). Much smoother.

阴影有些斑驳,这是因为科尼利厄斯有许多精致的细节而且缓存大小太小,采样过低不能将这些细节正确地显现。如果缓存大小增加到2560,采样值为6,偏移为3.0,结果就如室外渲染。(右)所示。更细腻了。

Pseudo-Area Light 模仿-面光源照明效果

The concept of Light coming from a point is an approximation. No real world light source is dimensionless. All light is shed by surfaces, not by points.

来源于一点的照明概念其实是一种近似。真实世界里光源都是有维度的。所有光线都是从表面投射,而不是从点。

This has a couple of interesting implications, mainly on shadows: <itemizedlist mark='opencircle'>

  • Sharp shadows do not exist: shadows have blurry

edges.

这里有两个有趣的含意,主要针对阴影:<详记标记='开圆'>*锐化阴影不存在:阴影的边界都是模糊的。

  • Shadow edge blurriness depends on the relative

positions and sizes of the light, the shadow casting object and the object receiving the shadow.

模糊阴影边界依赖于灯光之于投射阴影的物体和接收阴影的物体的相对位置和尺寸。

The first of these issues is approximated with the 'Soft' setting of the Spot light, but the second is not. To have a clearer understanding of this point imagine a tall thin pole in the middle of a flat plain illuminated by the Sun.

第一个问题是聚光灯的'平滑'设置。为了使自己有个更清晰的理解,请想象在一个宽广的平原上有一个被日光照射的狭长的深洞。

The Sun is not a point, it has a dimension and, for us Earthlings, it is half of a degree wide. If you look at the shadow you will notice that it is very sharp at the base of the pole and that it grows blurrier as you go toward the shadow of the tip. If the pole is tall and thin enough its shadow will vanish.

太阳不是一个电,它有维度,并且对我们地球上的物体来说,它的宽度为半度。如果你注意阴影,就会注意到在洞底它很锐化,但是越接近洞口,它就越模糊。如果洞足够狭窄足够深,阴影还会最终消失。

To better grasp this concept have a look at Area light and its shadow.. The Sun sheds light, the middle object completely obstructs the Sun's rays only in the dark blue region. For a point in the light blue region the Sun is partially visible, hence each of these areas is partially lit.

为了更好地掌握这个概念,看看区域照明及其阴影。。太阳投射光线,中间的物体完全阻挡了在深蓝色区域内的太阳光。对一个处在亮蓝色区域内的点,太阳是部分可见的,因此这些区域都被部分照亮。

Area light and its shadow.区域照明及其阴影
Area light and its shadow.区域照明及其阴影

The light blue region is a partial shadow region where illumination drops smoothly from full light to full shadow. It is also evident, from Area light and its shadow. than that this transition region is smaller next to the shadow casting object and grow larger far away from it. Furthermore, if the shadow casting object is smaller than the light casting object (and if the light casting object is the Sun this is often the case) there is a distance beyond which only partial shadow remains Area light and its shadow 2.

亮蓝色区域是一个部分阴影区域,照明从完全照亮柔和地过渡到完全阴影。我们也能很清楚地看到这个过渡区域在靠近阴影投射物体物体时较短,远离时较长。进一步说,如果阴影投射物体的尺寸小于灯光投射物体(灯光投射物体是太阳的话通常就是这种情况),就会有相当一块处于部分阴影的区域区域照明及其阴影2

Area light and its shadow 2区域照明及其阴影2
Area light and its shadow 2区域照明及其阴影2

In Blender, if we place a single Spot at a fixed distance from a first plane and look at the shadow cast at a second plane as this second plane gets further away we notice that the shadow gets larger but not softer (Spot light and its shadow).

在Blender中,如果我们在距离第一个平面固定位置处放置一盏聚光灯,在第二个平面上远离第一个平面的过程中并且观察投射在其之上的阴影时,我们就会注意到阴影区域变大变柔和了(聚光灯和它的阴影。)。

Spot light and its shadow聚光灯和它的阴影
Spot light and its shadow聚光灯和它的阴影

To fake an area light with Blender we can use several Spots, as if we were sampling the area casting light with a discrete number of point lights.

为了使用Blender模拟一个区域照明,我们使用多个聚光灯,就好像我们使用一个离散序列的点光源投射光线。

This can either be achieved by placing several Spots by hand, or by using Blender's DupliVert feature (special_modelling_dupliverts), which is more efficient.

这也可以通过手动放置几个聚光灯或是使用Blender的垂直复制功能(special_modelling_dupliverts),它更加高效。

Add a Mesh Grid 4x4. Where the spot is, be sure normals are pointing down, by letting Blender show the Normals and eventually flipping them, as explained in mesh_modelling_editmode_basic (Grid setup).

添加一个4x4的网格。确保聚光灯所在的位置的法线方向向下,通过使Blender显示法线并最终翻转他们,如mesh_modelling_editmode_basic中阐述的(网格设置)。

Parent the Spot to the Grid, select the Grid and in the Object Context Anim Settings Panel (F7) press DupliVert and Rot.

将聚光灯附着在网格上,选择网格,并且在对象上下文动画设置面板(F7)中按下垂直复制旋转

Rot is not strictly necessary but will help you in positioning the Area Light later on. You will have a set of Spots as in Spot light and its dupliverts.

旋转不是必须的但是有助于定位之后的区域灯光。你将拥有一系列的聚光灯,如聚光灯及其垂直复制所示。

Grid setup 网格设置
Grid setup 网格设置
Spot light and its dupliverts聚光灯及其垂直复制
Spot light and its dupliverts聚光灯及其垂直复制

Then decrease the Energy of the Spot. If for a single Spot you used a certain energy, now you must subdivide that energy among all the duplicates. Here we have 16 spots, so each should be allotted 1/16 of Energy (that is Energy=0.0625). The same two renderings of above, with this new hacked area light will yield the results in Fake area light with multiple spots..

降低聚光灯的能量。如果对单个聚光灯你使用某个能量,现在你必须将其按照复制份数进行均匀分割。我们现在有16盏聚光灯,所以每盏应该具有1/16的能量(也就是说能量=0.0625)。运用这个新的被切割的区域灯光,之前的两个相同的渲染的效果将如使用多盏聚光灯模拟区域灯光

The result is far from that expected, because the Spot light sampling of the Area light is too coarse. On the other hand, a finer sampling would yield a higher number of duplicated Spots and to unacceptable rendering times.

结果与期望的相差很远,因为聚光灯对区域照明的采样过于粗糙了。从另一方面说,一个更加精确的采样应该产生更多的复制聚光灯,但是渲染时间就变得无法接受了。

Fake area light with multiple spots.使用多盏聚光灯模拟区域灯光
Fake area light with multiple spots.使用多盏聚光灯模拟区域灯光

A much better result can be attained by softening the spots, that is setting SpotBl=0.45, Sample=12, Soft=24 and Bias=1.5 (Fake area light with multiple soft spots.).

通过平滑聚光灯可以得到更好的效果,比方说聚光灯Bl=0.45,采样=12,平滑=24并且偏移=1.5(使用多盏平滑聚光灯模拟区域灯光。)。

Fake area light with multiple soft spots.使用多盏平滑聚光灯模拟区域灯光
Fake area light with multiple soft spots.使用多盏平滑聚光灯模拟区域灯光

Finally, Cornelius under Area Light. shows what happens to Cornelius once the Key Light is substituted with 65 duplicated Spots of Energy=0.0154 in a circular pattern. Please note how the shadow softly goes from sharp next to the feet to softer and softer as it gets further away from him. This is the correct physical behavior. 最后,区域灯光下的科尼利厄斯展示了一旦主灯光被排列为圆的65个能量为0.0154的复制聚光灯取代时的效果。请注意阴影是如何平滑地从靠近脚部时的锐化向远离模型时的平滑过渡的。这就是正确的物理行为。

Cornelius under Area Light.区域灯光下的科尼利厄斯
Cornelius under Area Light.区域灯光下的科尼利厄斯

Pseudo-Global Illumination 模仿-全局照明效果

The above techniques work well when there is a single, or at least a finite number of lights, casting distinct shadows.

上面描述的技巧在只有一盏灯光,或是无限盏灯光时可以投射清晰的阴影。

The only exceptions are the outdoor setting, where the Hemi Light fakes the light cast by the sky, and the Area Light, where multiple spots fake a light source of finite extension.

唯一的例外时室外设置,此时使用半光模拟来自天空的光线和区域灯光(使用多盏聚光灯模拟来自无限远处的光源)。

The first of these two is very close to nice outdoor lighting, were it not for the fact that the Hemi Light casts no shadows and hence you don't have realistic results.

如果不是因为半光不会投射阴影的话,前者接近真正的室外照明。因此你无法获得真实的效果。

To obtain a really nice outdoor setting, especially for cloudy daylight, you need light coming from all directions of the sky, yet casting shadows!

为了获得真实的室外设置,特别是有云的白天,你需要来自天空中所有方向的光线,同时还能投射阴影。

This can be obtained by applying a technique very similar to the one used for the Area Light setup, but using half a sphere as a parent mesh. This is usually referred to as "Global Illumination".

这可以通过阴影一个类似于区域照明设置的技巧来实现,但是要使用一个球体作为父网格。我们通常称之为“全局照明”。

You can either use a UVsphere or an IcoSphere, the latter has vertices evenly distributed whereas the former has a great concentration of vertices at poles. Using an IcoSphere hence yields a more 'uniform' illumination, all the points of the sky radiating an equal intensity; a UVsphere casts much more light from the pole(s).

你可以使用UV球或是Ico球,后者有均匀分布的顶点,前者顶点集中在洞上。使用Ico球会产生一个更加'一致'的照明,天空中的所有点都投射相同能量的光线;UV球从洞内投射多得多的光线。

Personally I recommend the IcoSphere. 我个人推荐使用Ico球。

Let's prepare a setup, comprising a plane and some solids, as in Global Illumination scene.. We will use simple shapes to better appreciate the results.

让我们准备一个场景,包括一个平面,一些实体,如全局照明场景。。我们将使用简单的形状来实现更逼真的效果。

Global Illumination scene.全局照明场景
Global Illumination scene.全局照明场景

Switch to top view and add an IcoSphere, a subdivision level 2 IcoSphere is usually enough, a level 3 one yields even smoother results. Scale the IcoSphere so that it completely, and loosely, contains the whole scene. Switch to front view and, in EditMode, delete the lower half of the IcoSphere (Sky dome.). This will be our "Sky Dome" where the spots will be parented and dupliverted.

切换到顶视图添加一个Ico球,一个二级的Ico球通常就足够了,一个三级的Ico球可以给出更加平滑的效果。缩放Ico球使其完全地但是松散地包含包含整个场景。切换到前视图和编辑模式,删除Ico球的下半部分(天空顶)。这就是我们的天空顶,聚光灯将附着其上并被垂直复制。

Sky dome.天空顶
Sky dome.天空顶

Again in Top View add a Spot Light, parent it to the half IcoSphere (CTRL-P) and press the DupliVert and Rot buttons exactly as in the previous example.

再回到顶视图,添加一盏聚光灯,设置它的母体为半Ico球(CTRL-P),和之前的示例一样,按下垂直复制旋转按钮。

The result, in FrontView, is the one in Sky dome with duplicated spots..

结果就如前视图中所示使用复制聚光灯的天空顶。

Sky dome with duplicated spots.使用复制聚光灯的天空顶
Sky dome with duplicated spots.使用复制聚光灯的天空顶

This is not what we want, since all spots point outwards and the scene is not lit. This is due to the fact that the IcoSphere normals point outward.

所有聚光灯都朝外而且场景没有被点亮,这不是我们想要的效果。原因是Ico球法线朝外。

It is possible to invert their directions by selecting all vertices in Edit Mode and by pressing the Flip Normals button in the Mesh Tools Panel of the Editing (F9) Context (Flipping normals.).

可以通过在编辑模式中选择所有顶点,按下编辑(F9)上下文网格工具面板中的翻转法线按钮反转它们的法线方向(翻转法线。)。

Flipping normals.翻转法线
Flipping normals.翻转法线

This leads to the new configuration in Correct sky dome and dupliverted Spot Lights..

这就引出了正确的天空顶和垂直复制聚光灯照明中的新设置。

Correct sky dome and dupliverted Spot Lights.正确的天空顶和垂直复制聚光灯照明
Correct sky dome and dupliverted Spot Lights.正确的天空顶和垂直复制聚光灯照明

To obtain good results select the original Spot Light and change its parameters to a wide angle with soft boundaries (SpotSi=70.0; SpotBl=0.5); with suitable ClipSta and ClipEnd values; in this case 5 and 30, respectively, in any case appropriate values to encompass the whole scene; increase samples to 6 and softness to 12. Decrease energy to 0.1; remember you are using many spots, so each must be weak. (Spot Light setup.).

为了获得好的效果,选择原始聚光灯,改变它的参数为宽角度平滑边界(聚光灯Si=70.0;聚光灯Bl=0.5);选用合适的剪切起始剪切结束值(此处分别为5和30,肯定可以包括整个场景);增加采样值为6,平滑值为12。降低能量为0.1;记住你正在使用许多聚光灯,因此单盏照明应该微弱一些。(Spot Light setup.聚光灯照明设置。).

Spot Light setup.聚光灯照明设置
Spot Light setup.聚光灯照明设置

Now you can make the rendering. If some materials are given and a world set, the result should be that of Spot Light setup.. Note the soft shadows and the 'omnidirectional' lighting. Even better results can be achieved with a level 3 IcoSphere.

现在你可以开始渲染了。如果给定一些材料和世界设置,结果将如聚光灯照明设置。。注意平滑阴影和全方向照明。使用一个三级Ico球甚至能够得到更好的效果。

Spot Light setup.聚光灯照明设置
Spot Light setup.聚光灯照明设置

This Global Illumination technique effectively substitutes, at a very high computational cost, the Hemi for the above outdoor setting.

依赖很高的计算代价,这个全局照明技巧可以有效地替代前面提到的室外设置中的半光。

It is possible to add a directional light component by faking the Sun either via a single spot or with an Area Light.

通过一盏聚光灯或是区域照明模拟太阳,我们有可能为场景添加一个方向性的光。

An alternative possibility is to make the IcoSphere 'less uniform' by subdividing one of its faces a number of times, as is done for one of the rear faces in Making spots denser in an area.. This is done by selecting one face and pressing the Subdivide button, again in the Mesh Tools Panel of the Editing (F9) Context. Then de-select all, re-select the single inner small face and subdivide it again, and so on.

另一种方法是通过将其一个面切分成若干份,使Ico球'不那么一致',就像使一块区域内的聚光更强烈中的背面那样。方式是选择一个面,再一次在编辑上下文的网格工具面板中按下切分按钮。取消所有物体的选中,重新选择一个内部面并切分,依此类推。

Making spots denser in an area.使一块区域内的聚光更强烈
Making spots denser in an area.使一块区域内的聚光更强烈

The result is a very soft directional light together with a global illumination sky dome or, briefly, an anisotropic sky dome (Anisotropic skydome render.).

结果是一束很平滑的方向广伴随一个全局照明的天空顶,或者简单地说,一个各向异性的天空顶(各向异性天空顶渲染。)。

This is quite good for cloudy conditions, but not so good for clear sunny days. For really clear days, it is better to keep the sky dome separate from the Sun light, so as to be able to use different colours for each.

对于多云的环境而言这种设置效果很好,但是对于晴朗的天空则不然。对于真正干净的天空,最好保持天空顶独立于太阳光,这样就能使它们具有不同的颜色了。

Anisotropic skydome render.各向异性天空顶渲染
Anisotropic skydome render.各向异性天空顶渲染
Previous: Manual/PartV/Ray Shadows射线阴影 Contents Next: Manual/PartVI
Personal tools