返回列表 回复 发帖

(3dsmax)'Basic Lighting'--基础照明

'Basic Lighting'--基础照明
'Basic Lighting'
by Jelle van Campen po
原文链接:
http://www.3dtotal.com/team/Tutorials_3/lighting_rendering/lighting_rendering01.asp


This is my first little tutorial I'm posting here in my portfolio. I'm going to try explaining you how to get some better rendering results in 3D Studio Max. I'm using the 2008 version, since the others don't work well with Vista, but it should work fine in other versions too. Of course, there are many aspects when it comes to improving your renderings. You can get your models to look better, improve your textures, get better animations, ... but what I'm going to talk about is the lighting of your scene. Although it may sound like an unimportant thing, lighting is a crucial part of your rendering. I suggest we start of immediately.

(这是我以个人的名义发表在3dtotal的第一篇小教程。我将试着向你解释如何在3dsmax中得到更好的渲染效果。我使用2008版,因为其他版本在vista中都不能使用,但是这些步骤在其他版本中也是一样的。当然有很多方式来提高渲染的结果。你可以将模型建的更精细,或是提高你的纹理,或是增强你的动画,但是我将要谈论的是如何照明你的场景。尽管这听上去并不十分重要,但实际上灯光是你渲染的关键所在。我建议我们立即开始。)
As you can see, I've set up a little scene over here. The scene contains a ground plane, a few boxes and some text, to make sure I use all kinds of geometry. This means, there are no hidden elements that could improve the renderings later, making it easier for you to follow along. I'll try mentioning all steps, to make it easy for you. So, after setting up the scene, I immediately hit the render button, and this is what will pop up. Well, actually I moved the camera too, but that won't influence the rendering much either. This means, there are no lights, materials, ...whatsoever in the scene. By default, 3D Studio Max will use an ambient light to light the scene. The thing is... the chances of this light being exactly the light you want for your scene are very small. So, the first things we're going to do is add some lights! I prefer working with omni lights since they give your scene a natural look. While when you're using something like a spot, you'll get a hotspot and a falloff zone, which you don't have in real life. Omni's make your light scatter nicely.
(正如你所看到的,我已经设置好了一个小场景。这个场景包括一个地平面,一些方盒子,一些文字,这样来确保我使用了多种几何体。这意味着,没有任何其他隐藏的元素能在稍后提升渲染结果。为了让你能更容易的跟随我的讲解,我将试着提示所有的步骤。所以在设置完场景之后,我立即点击了渲染按钮。好吧,事实上我还移动了摄像机,但这并不会过多的影响渲染。这就是说,现在场景中没有灯光,材质以及其他的东西。3dsmax默认将使用一盏环境灯照亮场景。这盏灯的效果跟你想要的通常都差很远。所以,我们要做的第一件事就是给场景添加一些灯!我喜欢使用泛光灯因为它们使你的场景看起来更自然。相比之下,当你使用诸如聚光灯之类的东西,你将获得一个灯光焦点和渐变区域,它们在真实的生活里是不存在的。泛光灯使你的灯光发散的更漂亮。)



Okay, this is looking a tad bit different. What have I done here? Well, I added one omni behind the camera (meaning, in front of the scene). I just left the settings to default, since it looked okay in my case.But, depending on your scene you may want to change some of the settings, depending on the look you're after. Eg. in a desert scene, you may want to add a tad bit of a yellowish color to the light. While in an underwater scene you'll want to go for a blue color. I just left the settings as they were over here. But to be honest... it still looks aweful, no? These are the kind of rendering people who work with 3D programs for the first time usually get. When you're outside and look out of the window, looking at something like a house, is it only are only 2 sides of the house lighted? No... or you're house is rather weird. In real life, light can be deflected, meaning the light will diffuse over a large area, also lighting the walls not pointing towards the sun. At the moment, only the polygons pointed towards the light source will be lit. A simple way tosolve this, only using omni lights would be to add a light in the back of the scene. This way, the other sides of our boxes and text will also be lit. Make sure you set the intensity a bit lower then the front omni though, since that will be our primary light source!

(现在看起来有一些不同了。我究竟做了些什么呢?我在摄像机后面(也就是场景前面)添加了一盏泛光灯。一切都是默认设置,因为此时它看起来没什么问题。但是,根据你场景的不同,你也许会想要改变一些设置,这取决于你之后的看法。例如,在一个废弃的场景中,你也许会想给灯光添加一些黄色。而在一个水下的场景中,你会希望变成蓝色。我将这些设置留下来就像它们被覆盖过一样。但是老实说,它仍然看起来很酷,不是吗?这是那些用3d程序渲染的人们第一次得到的东西。当你从室内向窗户外看去的时候,看那些房子,你是否只看到有两面墙被照亮?不,否则你的房子看上去将相当的怪异。在现实生活中,光线会发生散射,这意味着光线能照亮一大片区域,即便被照亮的墙并不是朝向太阳的。在我们的场景里,只有朝向光源的多边形是被照亮的。一个简单的方法来解决这个问题:只需要在场景的背面添加一些泛光灯就可以了。这样,方盒子和文字的其他面都能被照亮了。确保你设置的强度低于在正前方灯的强度,因为那是我们场景的主光源。)



There we go, one omni added in the back of the scene. I used the default settings once again, only thing I changed is the intensity, I set it from 1 to 0.75. Now we are getting somewhere right? Everything seems to be lit naturally, and we don't have the massive contrast problems we had before. The thing is, it still doesn't look natural at all. All light is divided pretty much equally over the surfaces right now, which is not how it works in reality. In real life, there are areas's the light can't reach, and they will cause shadows. Luckily, shadows are no problem in this age of 3D technology.  
(接下来,一盏泛光灯将被添加到场景背面。我再次使用了默认的设置,惟一修改的是强度值,我将它从1设为0.75。现在我们得到一些正确的结果了吗?每个物体看起来都自然一些了,之前那些强烈对比的问题已经没有了。但是它们还是不够自然。所有的光线在表面分布的都非常平均,实际上并不该是如此。在现实生活中,有一些区域光线并不能到达,它们被成为阴影。幸运的是,在这个数时代的3d技术,阴影并不是什么问题。)


What we need to do now is find the best shadow solving system. As you can see in the screens up here, there are 3 main systems that can be used (mental ray excluded). Shadow Map and Ray Traced both look brilliant, while the Area Shadows looks like it could use some work. What will we choose? You may call me crazy but I'm going for the Area Shadows, to show you what a little bit of tweaking can do. So, access both of your omni lights, check the box in front of "Shadows" and choose "Area Shadows". You may also want to check "Use Global Settings" for both of them. This way you only need to change the settings once in case you want to adapt something later. After that, hit the render button once again and something like this should pop up.

(现在我们需要做的是寻找最好的阴影解决方案。正如你在下图中看到的,主要有3种系统可以被使用(mental除外)。阴影贴图和光线追踪看起来都很不错,而区域阴影看上去能被用于另一些场景中。我们该选择哪种呢?你也许会认为我疯了,但是我仍然会选择区域阴影来进行一些细微的调整。选择你的两盏泛光灯,然后勾选使用阴影,并选择"Area Shadows"(区域阴影)。你也许还希望勾选"Use Global Settings"(使用全局设置)。这样如果稍后你希望进行调整,你可以一次性更改它们。然后再次单击渲染按钮,新的结果将呈现出来。)


Not looking too good is it? But it IS actually the most realistic render we've got until now. The only thing left to do is some tweaking in the settings for the shadow system. What I want you to do is change the shadow integrity to "15", set the quality to "8", change the jitter to "8" and change length and width both to "50". This will cause the shadows to appear more diffused over the surfaces of the objects in your scene.


(看上去并不是太好是吗?但是它的确比我们之前得到的结果要真实许多。剩下要做的是对这个阴影系统进行一些微调。我希望你将阴影强度增加到15,质量设为8,长度和宽度都设为“50”。这将使阴影分散到场景中物体的表面。)


As you can see, everything looks way smoother and even pretty realistic, compared to the first render we got. Using this technique you have a lot of control over the positioning of your lights, intensity, color, and much more, making it quite a good system to use for shadows. To prove it, here is a render of the exact same scene, with the color of the back light changed to a pretty dark blue color, the front light with a near-white-blue color and the material for the text to a purple color.

(正如你所见,对比之前的渲染,每个物体看起来都更平滑,也显得相当真实。使用这个技术你可以对灯光进行很多控制,位置,强度,颜色,更重要的是它提供了生成阴影的一个绝好的系统。要继续提示渲染效果,接下来还有一个相同场景的渲染,不同的是背景灯的颜色改为深蓝,前主光的颜色改为接近白色的蓝色,并给文字赋予了紫色的材质。)


Still looks quite good no? That's basically all you need to know to get your scene well-lit. Of course, you can add more lights, move them, different colors, intensities, ... it'll always look good. But, there are some other lighting solutions I'd like to show you. First of all, a solution to shadows even better than this one, but with less control.

(看起来还是相当的不错,不是吗?这就是你需要了解的关于如何使场景表现的更好的基本知识。当然你可以添加更多的灯,移动它们,更改颜色,强度.....它们看上去将非常的漂亮。但在这里我还将向你展示一些其他的照明解决方案。首先,一个比现在这个更好的阴影解决方案,但是没有那么多控制。)


As you can see, the amount of light in the scene had significantly increased. This is because I added a skylight on top of the scene (hovering in the center of the world, and a bit above the scene). After doing that, I checked "Cast Shadows" and used 20 Rays per Sample and a ray Bias of 0.005. This gives for a nice overall lighting of your scene as you can see. Also, depending on the Rays per Sample you use, the solution will overall be way better than the solution you get using omnis. The only problem is, that you're shadows won't show up that well anymore and that all objects will already have some kind of "lightness" to them. You can decrease the intensity, but the surfaces will always be lighted a tad bit. It does look way better though!
(如下图所示,场景中的光线被明显加强了。这是因为我在场景的顶部添加了一盏天光。然后我选中了投射阴影,并使用20 Rays per Sample ,光线偏移设为0.005。这样我获得了一个非常明亮的场景。同样的,根据你所使用的每采样光线值,这个方案总体上能提供比使用泛光灯更好的效果。惟一的问题是阴影不是那么明显了,所有的物体看上去都有相同的亮度。你可以降低灯光强度,但物体表面仍然会偏亮。尽管如此,它仍然得到了更好的效果。)



In this render, I turned off our omni lights and as you can see the scene looks pretty good. It is equally lit everywhere and shows shadows where needed. It doesn't use any of the information of our previous lights though. In some renders, this may be the look you're looking for. Up to now, I've been telling you we were working on the lighting, but actually we have been working on the opposite all the time: the shadows. Of course, these 2 things are actually the same, since shadows are created by light. But, we only made the dark spots look right for now. Another thing 3D Max will allow us to do, is to calculate how the light will be scattered all over the surfaces. This process is called radiosity. I'll show you a quick example of it.

(在这个渲染中,我关闭了泛光灯,但是你可以看出场景看上去更漂亮了。它很公平的展示出了每个地方,并且在需要的地方显示了阴影。这并不需要我们早先提到的知识。在一些渲染中,这可能就是你一直所寻找的效果。直到现在,我一直都在教你通过灯光进行工作,但是事实上我们还有另一种相反的工作方法:阴影。当然这两种方式本质上是一样的,因为阴影也是通过光线创造的。但是,在这里我仅仅放置了一盏较暗的聚光灯。其他的事情3dsmax将会替我们解决:解算光线是如何散射到所有其他的物体表面。这个过程叫做光能辐射。我将给你展示一个简单的例子。)



Here is a render where I used radiosity. To be honest, it's not pure radiosity. I turned off the skylight, turned the omni lights back on and made 3D Max calculate the scene's radiosity. This can be done by going to "Rendering" -> "Advanced Lighting" -> "Radiosity". There, you can specify the quality and perform the calculations. I chose to go with the default: 85%. You may be wondering... "You said Radiosity is a solution for the lighting distribution, not a shadow system, then why am I seeing shadows?" Well, I kept the shadow settings for the omni light activated. This means, we are using both a system for lighting distribution and one for shadow calculation at once, making this probably the most accurate shadows we can get in this scene. Of course, you can still improve the quality, by adapting the settings for both solvers.


(下图是我使用光能传递渲染的。严格的说这还不是真正的光能传递。我关闭了天光,打开了后面的泛光灯,然后让3dsmax解算场景的辐射。你可以通过选择主菜单"Rendering" -> "Advanced Lighting" -> "Radiosity"来实现。你可以指定质“量并执行解算。我选择使用默认的值:85%。你也许会很奇怪,你会说:光能传递是灯光的解决方案,不是一个阴影系统”,那么为什么我们会看到阴影呢?好了,我保持泛光灯的阴影设置是激活的。这就是说,我们使用了一个系统进行灯光解算,同时还有一个阴影的解算。这样我们将得到这个场景更精确的阴影。当然你可以通过调整这两个解算器的设置来继续提升质量。)

Here, I changed the radiosity quality to 98% and changed the shadow quality to 15. As you can see, it's just a minor improvement, and when you are looking for a decent render speed, you don't want to go for this. But it may just give your scene that extra bit of detail you are looking for. Those are pretty much the basics of getting your scene well lit in 3D Studio Max. Of course, these same principals can be used for any kind of scenes. You'll just need to adjust the settings accordingly to get everything to look right. Also, when you are making test renders, you may want to reduce the quality of the solutions, inorder to be able to render frequently at a decent speed. For your final render, you'd best go with the best settings your computer can handle.
(这里,我将光能传递的质量设置为98%,阴影质量设为15。你可以看出结果只有较小的提升,当你追求较高的渲染速度时,你不必要这样做。但这将给你的场景增加你所寻求的额外的细节。这些是在3dsmax里制作场景的相当基础的知识。当然这些原则你也可以用于任何其他的场景。你只需要调整设置一般让每个物体都合适的表现。同样,当你进行测试渲染时,你需要降低渲染质量,以便能以较快的速度更频繁的渲染。而对于最终渲染,你最好使用你的计算机能承受的最高质量设置。)

场景文件下载
来源:译文3D网

[ 本帖最后由 火柴盒 于 2008-4-21 14:58 编辑 ]
附件: 您所在的用户组无法下载或查看附件
返回列表