Blender灯光和渲染第七章.doc_第1页
Blender灯光和渲染第七章.doc_第2页
Blender灯光和渲染第七章.doc_第3页
Blender灯光和渲染第七章.doc_第4页
Blender灯光和渲染第七章.doc_第5页
已阅读5页,还剩32页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Indoor Lighting: Finishing Materials 室内灯光:完成材质Now that weve created a custom UV map for our wine bottle, we can finish texturing our scene. Because our wine bottle is made up of numerous materials with different qualitites, its important to know how we can set up our material so Blender will render it properly. Were also going to take a look at: 现在,我们创建了瓶的自定义UV贴图。我们能够完成我们的场景纹理。因为我们的瓶子是由许多不同的材质组成的,它是很重要的对于我们怎么设置材质让Blender 适当的渲染。我们将看看: Exporting our UV map as a file type which Blender can read导出我们的UV贴图作为一个Blender能够读取的文件类型 Adding our UV map to the wine bottle mesh 添加我们的UV贴图给葡萄酒瓶网格 Adding materials for the rest of the objects in our scene 为场景的其余物体添加材质 Tweaking the final render 调整最终渲染Setting up project folders 建立项目文件夹One thing we havent talked about yet is the concept of project folders. As we start dealing with more and more complicated scenes, it will be essential to create a project folder to organize all of our project assets. These include, but certainly arent limited to:我们还没有开始谈论项目文件夹的概念,当我们将开始处理越来越复杂的场景,它是必须的创建项目文件夹来组织我们的所有项目资源。包括但不限于: Blend files Blend文件 Reference images 参考图像 Textures 纹理 Scripts (if applicable) 脚本(如果是应用程序) Renders 渲染An easy way to organize these files is by their file type. For example, we can set up a project folder for our current scene.一个简单的方法是通过它们的文件类型组织它们。例如,我们能够为我们当前的场景建立项目文件夹。1. Create a new folder and name it indoor_lighting.创建一个新的文件夹并命名为indoor_lighting.2. Open our newly created folder and create four new folders again, naming them images, references, scenes, and renders. We will use these folders to organize our project assets.打开新创建的文件夹并创建四个新的文件夹,分别命名为images, references, scenes, 和renders.我们将使用这些文件夹组织我们的项目资源。3. Move our working.blend file into the scenes folderthis folder will contain all Blender files we make over the course of this project.移动我们的working.blend文件到场景文件夹这个文件夹包含我们这个课程所有的Blender文件。Now that we have a project folder set up, we can go ahead and start to work more on our materials and textures!现在我们建立了一个项目文件夹,我们可以开始我们的材质和纹理工作!Exporting our UV map 导出我们的UV贴图Before we can bring our UV map into Blender, we need to save it as a file Blender can read. Blender supports all major file types, so were going to play it safe and use the .png file type. Lets open up our UV map again in GIMP.在我们在Blender使用UV贴图前,我们需要保存它为Blender能够读取的文件格式。Blender支持我们所有的主要文件类型,所以我们使用可靠的PNG格式文件。让我们再次在GIMP打开UV贴图。To save our texture as a .png:要保存我们的纹理为PNG格式:1. Go to File | Save As. 选择File | Save As2. Find the images folder we created earlier, inside our project folder.找到在我们project文件夹里面的图像文件夹3. Save the file as bottle_label.png.保存文件名为bottle_label.pngMake sure you type .png at the endone of the nice things about GIMP is that you can dictate the file type simply by typing it into the filename.确保你的文件后缀名为PNGGIMP一个优点是你只需要在文件名输入文件类型就可以保存为该文件类型。Creating materials using Blenders Compositor 使用Blender 合成器创建材质Blenders Node Compositor is extremely useful for adding additional layers of dimension and effects to both our scene as well as our materials. Were going to take a look at how to use the Compositor to create the material for our wine bottle. Blender节点合成器对于为场景和材质添加额外的层和效果是非常有用的。我们将看看如何使用合成器来创建我们的酒瓶材质。Creating a glass material 创建一个玻璃材质Open up our scene in Blender and select the wine bottle. Were first going to add our UV texture and then deal with other aspect of the material later such as the glass material of the bottle.在Blender中打开我们的场景并选择酒瓶。我们首先添加我们的UV纹理并给其它的像玻璃材质给它。1. Under the Material menu, create a new material. 在Material菜单下,创建一个新的材质。2. Name it wine_bottle. 命名为wine_bottle.Were going to use Blenders Node Compositor to combine the different materials found on our wine bottle. Remember when we changed our window layout to edit our wine bottles UV coordinates? Were going to do the same thing here, but will choose the Compositing layout instead. Go ahead and change the layout now that our wine bottle has the material applied to it.我们将继续使用Blender的节点合成器来连接我们的酒瓶的不同材质。记得什么时候我们将改变窗口布局来编辑酒瓶的UV布局?By default, Blender doesnt enable materials to be controlled by the Compositorwell have to do that manually. To use Blenders Node Compositor to manage our mesh, click the node toggle button found between the material name and the list that dictates how the material is linked to our object (by default, Blender sets this to Data). 默认,Blender没有激活合成器控制材质我们将手动设置。要使用Blender节点合成器管理我们的网格,点击节点切换(toggle button)按钮在材质名和列表切换,列表是显示材质是如何连接到我们的物体(Blender设置默认设置是Data).Well notice that when we press this button, Blender automatically adds some nodes to the Compositor windowthese will serve as a starting point for our node network or the network of linked nodes that define our material. 我们注意到当我们按下这个按钮,Blender自动添加一些节点到合成器窗口这将启动我们的节点网络(node network )或默认的节点连接网络。Were going to need to create two separate materials to use for our wine bottle materialone is a glass material, and the other is the label material. Lets start with the glass material. We already have a Material node in our node network, which we will use to create our glass material. Under the Material node, press the New button to create another material.我们将创建两个单独的材质为我们的葡萄酒瓶材质-一个是玻璃材质,另一个是标签材质。让我们首先开始创建玻璃材质 。在我们的节点网络我们已经有一个材质(Material)节点,我们将用来创建我们的玻璃材质。在材质(Material )下,按新建(New)按钮来创建另一个材质。Rename this material glass. When a Material node is selected, we can adjust the settings under the Material menu to the right to edit that particular materials properties.重命名这个材质为glass. 当一个材质节点被选择,我们能够调整材质(Material )菜单下编辑特定的材质属性。Despite the Material node we have selected, the Material menu will always show the name of the material applied to our objectin our case, the wine_bottle material. Be sure you have the desired Material node selected when you start editing these values. 虽然我们的材质节点被选择,材质菜单总是显示我们应用给我们物体的名字在我们的例子是wine_bottle。 当你开始编辑这些值时确保你想要编辑的材质节点被选择。With our glass Material node selected: 选择我们的玻璃材质节点:1. Activate the Transparency values. 激活Transparency的值 2. Change the algorithm from Z Transparency to Raytrace. 将Z Transparency 算法改为RaytraceMost commercial-grade glass has an index of refraction, or IOR, of 1.55. Because we want a realistic result, we can go ahead and use that value in Blenders IOR parameter.太多数的商业玻璃釉一个折射指数,或IOR,1.55. 因为我们想要一个真实的结果,我们可以使用Blender的IOR参数。 Realistic, though, is a relative term. Blender cant render raytraced transparency in the Compositor in the same way it does in a normal render, and as a result, it has to be faked. Although the result wont look bad, we can apply some tricks to hide those shortcomings later on. 真实,这是一个相对的概念,在一个正常的渲染Blender不能够使用同样的方法在合成器渲染raytraced透明,做为结果,它是一个伪真实。虽然结果看起来不坏,我们稍后能够应用一些技巧来处理这些缺点。We also need to edit the Fresnel value to set the proper transparencyfor now, set it at a value of 3.0. 我们也需要编辑菲尼尔(Fresnel )的值设置适当的透明现在,设置值为3.0.Theres a problem, though. If we render out our image now, its not exactly transparent. This is because although the material has transparency enabled, the alpha channel isnt linked to the materials output in the Compositor. 这儿有一个问题,虽然我们渲染出我们的图像,但它透明不准确。这是因为虽然激活了材质的透明度,但alpha通道在合成器没有链接到材质的输出端。To do this, click on the small gray circle next to Alpha output on the glass Material node and drag over to the gray circle next to the Alpha input on the Output node. This will link the transparency values to the composited material. 要完成它,点击在Material节点的Alpha输出端的小灰色圆圈并链接到Output节点的Alpha输入端的小灰色圆圈。这将连接透明值到合成的材质。Now, if we render out our image, we will get a better transparency result. Its better, but not perfect yet.现在,如果你渲染图像,我们将得到一个更好的透明结果。但还是不够完美。Notice how the glass appears to be blackthis is because the Depth parameter is not high enough. To improve the transparency quality, change this value to 6. 注意玻璃显示有点黑这是因为Depth参数不够。要改进透明质量,改变数值为6.Theres a noticeable difference between our renders now. With the Depth value at 6, we can actually see what appears to be a transparent glass bottle! Remember, though, its not a true transparency, and as a result, it doesnt look entirely believable. Were about to take care of that, masking Blenders shortcoming with the Gloss parameter. 现在这两幅图像有很大的差别。当Depth数值为6,我们可以看到一个透明的葡萄酒瓶!记住,虽然这不是一个真实的透明,作为这个结果,看起来不是很可信。我们可以使用Gloss来消除这个缺点。Were going to use the Gloss parameter to blur the fact that this transparency isnt entirely believable. To do this, set the Gloss value to 0.9.我们使用Gloss参数为blur让这个透明看起来不是很完美。要改变这些,设置Gloss为0.9.This effectively masks our transparency enough so that we can tell its a transparent bottle, but we cant see that Blender faked the transparency.这有效的提高了透明效果,现在我们才可以叫它为透明葡萄酒瓶,但我们还看不见Blender模拟的透明效果。The next step is to add some reflections. What is glass without reflections, anyway? To do this:下一步是添加一些反射。不管怎么说玻璃没有反射?要赋予它反射:1. Activate the Mirror settings. 勾选Mirror 设置。2. Set the Reflectivity value to 0.04. 设置Reflectivity的数值为0.04.3. Set the Depth value to 6. 设置Depth的数值为64. Set the Gloss to 0.9. 设置Gloss的数值为0.9Although the effect of the reflection is minute, its an effect that really adds to the believability of our glass material. With reflections added, our image should look similar to the following render:虽然反射的效果很微弱,但它真正的让我们的玻璃材质看起来可信。当添加反射材质后,我们的图像看起来如下图:Were making great progress! The last step for the glass material is to adjust some of the Diffuse and Specular settings. To start:我们将让玻璃材质更完美!最后一步调整是Diffuse和Specular设置:1. Adjust the Diffuse color to a gray-blue hue. Refer to the image below for specific RGB values:校正Diffuse颜色为灰蓝色。参考如下图像的RGB数值:2. Adjust the Specular color so that its an off-white color. Again, refer to the image below:调整Specular 颜色为微白色。再次,参考图像如下:3. Set the Specular Intensity to 1.0. 设置Specular Intensity到1.04. Set the Hardness to 200. 设置Hardness到200.Lets render out our image to check on our progress! 让我们渲染图像看看效果!It doesnt look like much has changed. This is because our Fresnel parameter is set so high that its letting more transparency than color through in our material. Lower this value to 2.15 and render the image againwe should get a much better result this time.它看起来好像没有很大的改变。这是因为我们的Fresnel参数设置过高。调低到2.15,再次渲染图像我们应该现在得到一个更好的结果。Creating a label material 创建一个标签材质To add our label, were going to need to create another material that we can place on top of the glass material we just made. To do this, we need to create a new Material node. Create a new Material node by:要添加我们的标签,我们将创建另一个材质我们将放置在我们的玻璃材质的顶部。首先,我们需要创建一个新的Material节点。1. Selecting Add |Input | Material in the Compositor window. 选择合成窗口的Add |Input | Material菜单。If there are any connections automatically assigned to our new Material node, drag the connection away from the node to disconnect it.如果有任何的链接自动指定到我们的新Material节点,拖动链接然后断开它。2. As we did before, click the New button to create a new material. 像我们以前那样,点击新建(New )按钮创建一个新材质。3. Rename it label. 重命名为label.Because we want to use our UV map to define the color of our label, we need to create a Texture node to attach to the label Material node. Before we do this, though, we need to create the texture. Lets take a second and switch back into the Default screen layout.因为我们想要使用我们的UV贴图来定义我们的标签颜色,我们需要创建一个纹理节点链接到我们的Material节点。在我们做这些之前,我们需要创建一个纹理。让我们花费点时间返回到默认的屏幕布局。Navigate to the Texture menu. 到纹理(Texture)菜单。4. Create a new texture, naming it label_image. 创建一个新纹理,命名为label_image.5. Change the texture type to Image or Movie. 改变纹理类型为Image or Movie.6. Load the UV map we created earlier, bottle_label.png, into the texture. 载入我们先去创建的UV 贴图,bottle_label.png 导入到纹理。Now that our texture is created, we need to remove it from the current material so there arent any conflicts with our node network later on. To do this, click the X button to the right of the texture name at the top of the menu. 现在我们的纹理已经被创建了,我们需要移除当前的材质,以致不会和我们稍后在节点网络添加的材质相冲突。要删除它,点击在顶部菜单的纹理名右边的X按钮。Thats it! Now we can change our screen layout back to Compositing to continue working with our node network. Now we can create a Texture node to use in our network. To do this: 很好!现在我们能够返回到我们的合成(Compositing)布局继续我们的节点网络工作。现在我们能够在我们的节点网络创建一个纹理(Texture)节点:1. Select Add | Input | Texture from the Compositors menu. 从合成(Compositor)器菜单选择Add | Input | Texture。2. Add our texture to the node by clicking on the blank box and selecting the texture label_image from the drop-down list.通过点击blank盒子从下拉列表选择label_image纹理添加我们的纹理到节点。Now we need to tell our texture to dictate the color of our label material. To do this, click and drag from the Color output on the Texture node to the Color input node on the label Material node.现在我们需要告诉我们的纹理链接到我们的纹理材质标签。步骤如下。点击并拖动Texture 节点的Color输出端到label Material节点的Color输入端。Now we can see that our texture has been applied to the material in the Preview box. The next step is to add the label to our glass material using a Mix node. To do this, select Add | Color | Mix in the Compositor window.现在,我们能够看到在预览盒我们的纹理已经被应用给了这个材质。接下来是使用Mix节点添加我们的标签到我们的玻璃材质。在合成窗口选择Add | Color | Mix。Click and drag the Color output channels from the glass material node and the label material node and attach them to the Color1 and Color2 input channels respectively. Blender layers nodes attached to Color2 on top of nodes connected to Color1, which means our label will appear on top of the glass. Our network should now look something similar to the following screenshot: 从glass材质节点和label材质节点的Color输出端分别连接到 Mix节点的Color1和Color2输入端。Blender层次节点链接到Color2,在顶部的节点链接到Color1,这意味值我们的标签出现在玻璃材质的上面。我们的节点网络应该如下图:We now need to attach the Mix node to the Output nodeotherwise Blender wont know to mix the two materials. Because the node channels can only accept one input connection at a time, Blender automatically disconnects the link between the glass material nodes Color channel and the Output nodes Color channel when we attached the Color channel from the Mix node. 我们需要添加Mix混合节点到输出(Output)节点否则的话Blender不会认出混合的两个材质。意味节点通道仅仅在同一时间只能够接受一个输出,当我们从Mix节点链接到Output输入端在玻璃材质和输出节点之间Color将会自动断开链接。Now lets render our image out and see our result! 现在让我们渲染下图像看看结果!It looks okay, but there are still some minor details we have to tackle. The first is the labeltheres still a reflection on the label part of the bottle from the glass material, even though there are no reflective properties of the label material itself. Its also improperly mapped, which we will deal with in a moment. We also cant see the blue color anymore, because Blender mapped the black color from the label texture on top of the glass material. We can use another texture to separate these materials so Blender renders them properly.它现在看起来很好,但还有一些细节的地方需要修正。首先是标签在瓶子上的标签反射仍然是来自玻璃材质,但标签本身应该没有什么反射的。它的贴图都不正确。我们也不能够看见任何的蓝色,因为Blender的黑色来自玻璃材质的上的标签纹理。我们使用另外一个纹理分离这些材质让Blender渲染它们的属性。Were going to use the following image to separate, or mask, our materials. Its an edited version of the label image, just without the details of the label itself. You can create this image yourself, or you can download a copy from http:/www.cgshark. com/lighting-and-rendering/. Select the label_mask.png image from the Interior Lighting project list.我们将使用下面的图像独立,或遮罩,我们的材质。它编辑字标签图像版本,只是没有标签本身。你可以自己创建这个图像,或可以从这里http:/www.cgshark. com/lighting-and-rendering/.下载一个副本。选择Interior Lighting的label_mask.png 图像。Just like we did before, we need to create a new texture for this image. Switch to the Default screen layout and navigate to the Texture menu. 就像前面那样的,我们需要为这个图像创建一个新的纹理。返回到默认的屏幕布局,并到Texture菜单。1. Create a new texture. 创建一个新的纹理。2. Rename it label_mask. 重命名为label_mask。3. Change the Type to Image or Movie. 改变类型为Image or Movie.4. Load our newly downloaded image, label_mask.png.载入我们新下载的label_mask.png图像。Go ahead and remove the texture from the current material by clicking the X next to the name, and we can change back to the Compositing screen layout.点击名字前的X按钮从当前材质移除纹理,任何返回到Compositing屏幕布局。1. Add a new Texture node. 添加一个新的Texture 节点。2. Click the blank box and select the texture label_mask from the drop-down list. 点击blank盒子并从下拉列表选择纹理label_mask。3. Click and drag to connect the Texture nodes Color output to the Fac input on the Mix node. 点击并拖动纹理节点的Color输出端到Mix节点的Fac输入端。We can now use the node compositor to tell Blender to use the wine bottles UVcoordinates to map our label_image and label_mask textures to our wine bottle so that they appear correctly in our render. We can use a Geometry node to do thisthe Geometry node contains information about the object the material is connected to, including things like texture coordinates and other settings. To create a Geometry node:我们现在可以使用节点合成器,告诉Blender使用葡萄酒瓶的UV坐标来贴我们的label_image和label_mask纹理到我们的葡萄酒瓶,以致它们正常的出现在我们的渲染中。我们可以使用Geometry(几何体)节点来完成这个Geometry(几何体)节点包含物体材质链接的信息,包括像纹理坐标和其它设置。要创建一个Geometry(几何体)节点:1. Select Add | Input | Geometry in the Compositor window.在合成器窗口选择Add | Input | Geometry。2. Connect the UV output of the Geometry node to the Vector inputs on both the label_image Texture node and the label_mask Texture node.链接Geometry节点的UV输出端到label_image纹理节点和label_mask纹理节点的输入端。Now if we render our image out, the label should look a lot better.现在我们如果渲染图像,标签应该更好了。The last thing were going to do is soften the specular highlight on our label to make it more distinguishable from the glass material. To do this:最后一步是让我们的标签高光变得更柔和和瓶子的区分更明显:1. Select the label material node. 选择label material节点。2. Set the Hardness value to 20. 设置Hardness的数值为20.3. Set the Specular Intensity value to 0.2. 设置Specular Intensity的数值为0.2.Heres our final material node network. 最少我们最终材质的节点网络。Thats it! Our wine bottle is finally done! Now lets move on to the rest of the scene and finish adding materials.很好!我们的酒瓶终于好了!现在让我们完成剩下的场景。Finishing up materials 完成材质Congrats! Weve success

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论