[page]
如果这里渲染,你得到的图将会是黑色一片,注意mib_illum_lambert的参数下有个MODO,这个是设置材质的光照模式,说明一下,0为接受所有灯光(ALL),1为接受灯光列表中的灯光(包括),2是排除模式(排除列表中的灯光)可以看看帮助文件。所以创建两个点光源,移动位置,并且要把它们连接到mib_illum_lambert的LIGHTS中,把MODO设为1,完成后材质如图:
再次渲染,可以看到光照是有了,但是有个问题,为什么指定的贴图无法显示出来呢?因为MR无法取得模型的贴图坐标,所以当然无法显示啦。俺表达能力有限,无法准确表达出来,反正可以理解就行了。接下来让MR取得MAYA的贴图坐标,打开超图,新建两个节点,如图:
[page]
这两个节点的作用比较重要,其中mib_texture_remap接受纹理顶点的缩放,旋转,变换,剪切,合并纹理,运算顺序为首先变换,然后重复,交替,环状和最后最小/最大剪切。结果被返回,简单理解就是和MAYA的二维贴图坐标差不多的。原文件帮助这是样的:
vector "mib_texture_remap" (
vector "input",
transform "transform",
vector "repeat",
boolean "alt_x",
boolean "alt_y",
boolean "alt_z",
boolean "torus_x",
boolean "torus_y",
boolean "torus_z",
vector "min",
vector "max")
input is a texture vector from a generator such as mib_texture_vector that returns texture vectors. input is overridden when this shader is called with a nonzero arg parameter in mi_call_shader_x. This is useful for remapping multiple texture coordinates when the remapping parameters are identical for all of them.
transform is a general transformation applied to the texture vector before the remaining parameters are applied. If transform[3][3] is 0.0, the matrix is ignored (normally transform[3][3] is 1.0).
repeat contains repetition factors in X, Y, and Z that the texture vector is multiplied with. A value of 2, for example, shrinks the texture such that it fits twice in the [0, 1) interval. Repeating has no effect outside this interval. After the multiplication by the repetition factor, the integer part is removed. This algorithm allows finite repetition in an interval determined by the transform parameter. A repetition value of 0 turns off repetition in the corresponding component, as if the value were 1.
alt_* specifies whether every other copy of the repetition would be reversed such that successive copies of the texture are traversed in alternate, back-and-forth directions. Alternate flags have an effect only if the corresponding repetition component is greater than 1, and also work only in the [0, 1) interval.
torus_* maps the texture space into the range [0, 1) such that values less than 0 and equal to or greater than 1 are put into this range by cutting off the integer part.
min and max implement image or volume cropping by specifying the range of the texture to be considered. Portions of the texture outside this range are trimmed off. If repetition is used, the max point of one copy joins the min point of the next copy (unless alternation is turned on). min is inclusive, max is exclusive. If a min component is equal to the corresponding max component, both are ignored.
参数意义相信熟悉MAYA操作的兄弟都能明白。mib_texture_vector的作用更重要,它是贴图坐标数据产生的基础。可以解释一下参数:纹理向量产生,输出值连接到SHADER,产生不同投影模式)
Return a texture vector derived from orthographic projections of the 3D point in space (XY, XZ, YZ), non-orthographic projections (spherical or cylindrical); or return a numbered texture vector from the texture vector list. Optionally, this shader can base its calculations on object, camera, world, or screen space.
从3D顶点空间返回正投影纹理顶点(XY,XZ,YZ),非正投影(球体或者圆柱)。或者从纹理列表返回纹理向量编号,这些SHADER能够计算物体,摄像机,世界或者屏幕空间坐标。
vector "mib_texture_vector" (
integer "select",
integer "selspace",
integer "vertex",
integer "project")
select specifies the value to look up, as described above.
selspace allows choosing the source space for projections, as described above. Space conversion is done before the projection specified by the select parameter. If selspace is 4 (screen space), select, vertex, and project are ignored.
vertex specifies the location of the vertex: 0 is the intersection point, and 1, 2, and 3 are the vertices of the intersected triangle. It has no effect if select is -10.
project specifies a projection that is performed after selection and space conversion. It has no effect if select is -10.
如果是要用MAYA的默认UV SET,记得参数保持默认啊,别乱输入其它数字,其实就是可以用它来指定不同的贴图坐标,比如屏幕空间,视图空间,摄像机空间或者正投影模式不过都得用数字代码来表示。这里发发牢骚,MR的这种数字模式有时候气死人,谁记得了这么多不同数字代表什么东东啊?用过RAT的兄弟就知道RAT的坐标处理多直观,S T .MAYA UV SET等一目了然。mib_texture_vector连接到mib_texture_remap的INPUT上,方式如图:
[page]
接下来把mib_texture_rema连接到mib_texture_lookup的COORD上。
整个材质网络连接完成后如图。
[page]
这时开渲染就会有效果的了,这里只是学MR的节点,因为文件贴图也可以直接使用MAYA的,还少了连来连去的麻烦。
这是BUMP的效果。
[page]
这个是LAMBER材质的反射效果,不是很明显,参数是默认的。
这是它的节点网。