MentalRay环境模拟_第1页
MentalRay环境模拟_第2页
MentalRay环境模拟_第3页
MentalRay环境模拟_第4页
全文预览已结束

下载本文档

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

文档简介

1、MentalRay环境模拟这篇教程翻译的不是很好,有些术语不懂,请高人查缺补漏,修改一下,以免误人子弟。I read a thread which was started by Filip Orrby, in which he asked “How to make object not block FG rays?”. He went on to answer his own question and since it is similar to a technique I use, I decided to elaborate.我读到一个人询问“如何让物体不阻塞FG射线?”他的答案和以前我用

2、到的一种技术很相似。我在这里详细阐述一下。Im going to write about a shader and lighting setup I use a fair bit for product shots, where the background is very simple, often white and the product is to be brightly lit. For my final renders I usually break things into render layers, but I like to be able to quickly render

3、 everything in one pass to evaluate my animation and to show my progress to the client.我正要写一篇我经常使用的shader以及一个照明设置的文章,这种技巧经常被用于我的产品展示渲染,这个设置背景很简单,经常是白色背景,能使产品看上去更加光亮一些。在最后的渲染中经常将物体渲染出不同的层通道,但我也喜欢在给客户展示时,会将所有物体放到一个Pass中渲染,以节省时间。Here is a typical example of the end result.这是典型的最终结果To see a step-by-step

4、 breakdown of the setup, click hereMy lighting is physical sun/sky using final gather. My background is a simple fileTexture of a cloudy sky above a white ground which I have mapped onto a flattened sphere. You can download my scene file here.我使用了物理天光系统,背景是一个简单的天空文件贴图,地面是白色的压扁的球体。你可以点击这里下载源文件。Here i

5、s a snapshot of the wireframe.线框的截图and this is a small version of the sky map天空贴图The problem is that the flattened sphere blocks the final-gather rays from the physical sky. I could just live with it and use the sphere surface with its file texture as a final-gather radiator. And I would get somthin

6、g like this问题是扁平的球体阻挡了来自天光的FG射线。我只能将带着贴图的球体作为FG的散射器了,如下图所示。As you can see the result is still good and is not drastically different to the first image. But my background image is mostly white with a bit of blue and this drives the look of the FG giving it a neutral feel. Compare this with the first

7、image where, due to the low angle of the sun, there is a noticeable warm look to the FG.So, how do we stop the sphere blocking the FG? The answer is, by using mib_continue and mip_rayswitch.你可以看到渲染结果还是可以的,和第一张图比起来显著的差异,我的背景图片大部分是白色的,带着一点蓝色,这样可以使FG射线呈现一个自然的效果。对比第一张图片,将物理天光灯光的阳光的角度调低,可以获得一个显而易见的暖色调效果。

8、那么,我们怎样才能不让球体阻挡FG射线呢?答案就是使用mib_continue 和 mip_rayswitch节点。mip_rayswitch enables different shaders to be used depending on the type of ray that is being calculated. Have a look at the attributes here to see the different type of rays that can be singled out.mip_rayswitch节点可以将不同的Shaders作为不同类型的射线来计算使用。

9、看看它的属性面板,有许多不同类型的射线可以单独的分离出来。Ill just mention two of them in this example. The eye rays are the ones you actually see in the rendered image, so that is where I connect the shader that I want for my background color. The finalgather rays are used in the FG calculations and it is here I connect the mi

10、b_continue shader.在我们这个例子中我将仅仅涉及到它们中的两种,Eye 射线是你实际上看到的渲染出来的图像,所以我将希望我的背景呈现的颜色连接给这个Shader。FG射线会在FG计算中用到,这里我将它连接给一个mib_continue节点。mib_continue is a shader that takes any incomming ray and simply lets it continue on through the surface as if the surface was not even there. So in my example it lets the

11、FG rays from the physical sky continue through the flattened sphere. In this case Im just using the mib_continue with its default attributes.mib_continue节点是一个接受任何入射光线,让其穿过模型表面就像表面不存在一样。在这个例子中,我让FG射线从物理天光发射出来穿过球体。我使用mib_continue节点的默认设置。So that is the basis of my setup, but to make it work there are a

12、 few more things to consider.这就是我的设想,但是做要比想难很多倍。Firstly, I am using mia_exposure_photographic tone mapper as a lens shader with gamma=2.2 for a linear workflow. This means I need to increase the brightness of my background texture map to boost it into the same dynamic range as the physical sky. If I

13、 dont, then the background will be black! And I need to de-gamma the fileTexture since the gamma will be added by the tone mapper.首先,我是用一个mia_exposure_photographic tone mapper作为一个镜头shader将Gamma值调节为2.2。这意味着我需要增加背景图片的亮度来迎合物理天光的高动态范围。如果我不这样做,背景图片在高动态的物理天光的照射下依旧是黑色的。同时由于Gamma数值会被tone Map贴图加大,我需要减少文件贴图的G

14、amma值。Secondly, I am using the mip_matteshadow shader with my own spin on it for coloring the flattened sphere. Ill do my best to explain: mip_matteshadow is a more powerful version of mayas native useBackground shader. It is normally used to catch shadows, occlusion, reflections and indirect lighti

15、ng for compositing later and supports multiple outputs. But I am using it as a way of doing that compositing within the render.Reason 1: it makes it easy to get shadows on a surface that is not otherwise illuminated by any lights.Reason 2: it makes it easy to get reflections on very light colored (o

16、r white) surfaces, because it can do subtractive reflections. (I didnt use reflections in my example though.)Reason 3: When I get to my final renders phase, I can easily break out the components I need into different renderlayers without having to change too many things.第二,我需要mip_matteshadow节点,来生成扁平

17、球体的色调,我来解释一下:mip_matteshadow节点比Maya自带的Usebacgground节点要强大很多,一般用于分离阴影、阻塞、反射、和间接光照用于后期合成以及支持多种输出。我只是用它在渲染中进行合成,1.因为很容易获得阴影而且不受其他灯光的影响。2.他很容易从受灯光颜色影响很少(或者是白色)的物体上获得反射效果,因为他无需改变其他东西就可以进行负反射。3.当我进入最后渲染阶段时,我不用更改大量的属性而将我需要的属性分离到渲染层中。Thirdly, I am using mib_amb_occlusion instead of using mip_matteshadows occ

18、lusion feature. The reason is that I often add nurbs-planes to act as final-gather casters, much like you would use diffuse lights or reflector cards in a real photo shoot. These planes will have primary visibility off, but I do not what them to occlude the ground in any way. mib_amb_occlusion has a

19、n idNonself attribute that can be used to prevent objects from being considered for ambient occlusion.第三,我使用mib_amb_occlusion节点来替代mip_matteshadow节点的 OCC功能,因为我常常将NURBS平面作为FG的底板。也许大多数人使用灯光阵列和反射板来模拟真实环境,这些物体经常是不可见的,但是我不想它们产生任何OCC的影响,我使用mib_amb_occlusion节点的idNonself属性来防止物体被计算到AO中。Notice how I have set i

20、dNonself=5 . If I add an extra attribute called miLabel to an objects transform node and set its value to the same number, in this case 5, then it will be ignored by the ambient occlusion. Here is how it looks on the bgndSphere transform node注意我将idNonself设为5,如果我增加额外的属性miLabel到一个物体的位移节点上,将其值设为与idNons

21、elf相同的数字,那么这个物体就不会被考虑在AO的计算范围之内了。So now, to bring all this together, I just need to show you the hypershader network (click image for a larger version that you can actually read).现在,我展示一下Hypershader中的节点网络。Ill explain the connections from left to right.The fileTexture connects to the gammaCorrect nod

22、e with a value of 0.455 (1/2.2)我将从左到右来解释节点网络。文件节点连接到gammaCorrect节点,调节的数值时1/2.2(mia_exposure_photographicd 的Gamma值)=0.4545mib_amb_occlusion is combined with the background color using a mib_color_mix node, where the occlusion layer is multiplied over the background color.mib_amb_occlusion 是用mib_color

23、_mix节点与背景颜色联合使用,OCC层正片叠底在背景颜色上。The combined result is then multiplied by 20000 to bring it into roughly the same dynamic range as the physical sky and counter the effect of the exposure node lens shader. This number, 20000, was determined through trial-and-error (but after doing this for I while, Iv

24、e got fairly good at guessing).叠加的结果要使用一个乘除节点乘以20000来适配物理天光的高动态和对抗镜头材质的曝光。参数是20000,这是需要反复测试计算得出的。The very bright background color is then connected to the eye ray of the mip_rayswitch where it is combined with finalgather ray from the mib_continue node (shown earlier).非常亮的背景颜色连接到mip_rayswitch的sye ra

25、y上,mip_rayswitch的finalgather连接了mib_continue节点,让FG射线穿过背景的表面。The output of mip_rayswitch is fed into the mip_matteshadow background color. And mip_matteshadow is connected to the SG node as the miMaterialShader. (The lambert shown has no effect on the render, but is useful for being able to select assigned objects from the hypershade rmb-menu)mip_rayswitch节点的输出连接到mip_matteshadow的background上

温馨提示

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

评论

0/150

提交评论