Maya: Mental Ray: Bump Mapping with Mental Ray v6 custom shaders

 

The standard solution for bump mapping when using custom mental ray shaders (such as DGS, dielectric, etc) is to plug-in a somewhat intimidating shader network into the specular channel of the DGS material shader. See this file in on your hard drive for details:

 

devkit/mentalray/docs/gettingStarted/textureShaders_bump.html

If you don't want to use the specular channel for bumping, then there is a work around in the v6 docs that uses the mib_color_interpolate node (in lieu of the mib_color_mix node) that plugs into the dgs diffuse channel.

 

Here is a network using a file and a bump texture that is combined in the mib_color_interpolate mode before output to the DGS diffuse channel:

 

Click on image for larger picture

 

1. Create dgs_material node (mental ray material)

 

2. Create mib_color_interpolate (mental ray data conversion)

a. set the input value of the mib_color_interpoloate node to a low value like 0.001

b. connect mib_color_interpolate.outValue to dgs_material.diffuse

3. Create file texture node (maya 2d file texture)

a. connect file.outColor to mib_color_interpolate.color_0

4. Create mib_passthrough_bump_map (mental ray texture)

a. set factor in Bump Effects section to say 8

b. create a mental ray Texture "tex" node and select a bump file texture (*see note 1 below)

c. connect mib_passtrhough_bump_map.outValue to mib_color_interpolate.color_1

5. create mib_bump_basis (mental ray texture)

a. connect mib_bump_basis.u to mib_passthrough_bump_map.u

b. connect mib_bump_basis.v to mib_passthrough_bump_map.v

6. Create mib_texture_remap (mental ray texture)

a. connect mib_texture_remap.outValue to mib_passthrough_bump_map.coord

7. Create mib_texture_vector (mental ray texture)

a. adjust sel, selspace for the type of surface you are using (*see note 2 below)

b. connect mib_texture_vector.outValue to mib_texture_remap.input

*note 1: In the special case where your bump map must have a specific orientation and size, you can create the bump map using the "Convert to File Texture". In my scene, it was a nurbs surface, and I used the original texture and "Convert to File Texture" in Hypershade to create an image with the proper x,y orientation and image size (ignoring the 512 maximums in the documenation).

 

*note 2: For a nurbs surface, use the correct Select and SelSpace values:

select = -1 (3D space coordinates)
selpace = 2 (Worldspace)

Consult the documenation for the mib_texture_vector:

*note 3: When I optimized the scene, I lost the file texture on the mib_passthrough_bump_map tex channel and have to set it again (bug).