Ok, it seems alot of people still have some problems using the DGS shader, especially when it comes down
to bump mapping. Although you can find the necessary information on this board it's still quite some work
and you have to collect quite some bits and pieces, so here is my quick and dirty tutorial for creating
bump mapping. I won't get into the depths of MR (since I don't really know them
.
First create some Maya material (Lambert, Blinn, whatever) and apply it to your object.
Then go to the shading group node of that material and in the mental ray section activate "suppress all maya shaders".
Then apply a DGS material as your "material shader"
Set your DGS parameters. One of the three reflection types should be untouched cause we are going to use
it as our bump channel (there seems to be a way to use all three reflections and(!) bump, but again, this is quick an dirty, check the board).
Now we are going to build the bump network.
First, create a mib_texture_vector node.
This is for creating raw texture coordinates. Its parameters are:
-select
-selspace
-vertex
-project
If you are using polygons and you have created your UV Mapping, you can leave all parameters at 0
("select" with 0 or positive values up to 63 uses the appropriate UV sets). If you need projections for
NURBS it gets a bit complicated: set "select" to -1 which uses 3D space coordinates, "selspace" to 1 for
Objectspace (2 would be worldspace) and "project" to
2 - for orthographic XY projection
3 - for orthographic XZ projection
4 - for orthographic YZ projection
5 - for spherical projection
6 - for cylindrical projection (Y is cylinder axis)
Next, we need a "mib_texture_remap" node to modify the raw coordinates we got from the texture_vector node.
Connect the "output value" of your mib_texture_vector to "input" of the new "mib_texture_remap". (these
are 3 values to support 3D textures).
Again, I'm not so much into MR to tell you about all the parameters. If you use polygons without
projections (texture-vector was 0,0,0,0) you can just set "repeat" to 1 and that's it. If you use the
projections as described above it's a bit more complicated:
you will probably have to convert your vector into the range 0 to 1 (or 0.999? I'm not sure). So if your
objectspace was in the range from -4 to 4 you have to multiply your vector with 0.125 (set in the "Max"
parameter) and add 0.5 (set in the "Offset" parameter). Now the range is 0 to 1.
Now let's go for the bump.
Create a "mib_bump_basis" node.
I think you can leave all parameters untouched.
Create a "mib_passthrough_bump_map" node.
Connect the "u" values and "v" values outputs of the mib_bump_basis to the appropriate inputs of the
mib_passthrough_bump_map.
Connect the "outValue" of the mip_texture_remap to the "Coord" parameter of the passthrough_bump node.
Here the "step" parameter is used to offset the texture and thus creating a gradient which is used for
the bump effect. Set it to 0.01 and -0.01 for a start.
"Factor" controls the strength of the effect (positive or negative values)
Finally we'll get our texture:
Connecting standard maya file-nodes does not work. Thanx again to this forum which got me there: Go to
the mental ray section of your render globals. At the bottom you will find a section called "custom
entities". There you will find "custom textures". Click "Create".
Now you will find a new texture "file" node in your hypershade. Load your texture file.
In the "mib_passthrough_bump_map" now enter the name of the "file"-node (not the file itself), usually
"file1", into the "tex" field.
Finally connect the "outValue" of the passthrough_bump to the free reflection parameter of your DGS. Do
the lightlinking (you will find info about this issue if you don't know yet) for your DGS and be happy.
Hope this helps. I know there are a few question I cannot answer but this might be good for a start.
-k