Or: mentalray bump, demystified
Many people keep asking if anyone got the custom mentalray bump nodes to work. Because many people think custom mentalray bump nodes are waaay better than the maya’s default bump2d nodes. Let’s have a look.
First off we need to get the mr bump shading-network actually working. Here’s a hypershade snapshot of the raw bump-vector generating part:
The connections are as follows:
Whereas the mentalrayTexture is being automagically created and connected when clicking on the checker button next to ‘tex’ in the mib_bump_map node.
Ok, but what should we do now with the created network? There are several things we could do:
We could plug it into the bump input of one of francesca luce’s bumpCombiner, or we could plug it into the NormalCamera (Bump Mapping slot) of any standard maya shader - basically the mib_bump_map has the same output as a bump2d:
Did I say the same? Well, it’s not quite the same as you can see. What did happen? I left all settings at default - that was a failure. It’s the ‘step’ vector we need to adjust, just to give you a hint. But why, and more important: how? Here’s an explanation:
If you read through the above link, you know: we have to set our step value (the texture is tiled 1-1) to 1/2560, because it has a resolution of 25602560 pixels. If we had 2-2 tiles we would have to set it to 1/(25602), the formula is
step = 1/(textureResolution*tiles)
Looks better, doesnt it? Because 1/2560 is quite a small number (0.000390625) I decided to write an expression to not lose any precision:
mib_bump_map1.stepX = mib_bump_map1.stepY = mib_bump_map1.stepZ = 0.000390625
You probably ask yourself, how differntly than a bump2d this shaders actually work. Let’s compare, here’s a bump2d with default settings, I only set the Bump Depth to -0.010 because mr custom bump shaders bump in negative direction, and their factor acts different. Factor 1 is Bump Depth -0.010 in this example:
Bump Filter is 1, texture filter is Quadratic with Filter 1 - all default. Quite dull compared to a standard bump you might think. Let’s remove all the filters; but dont set the Texture Filter to off, leave it at Mipmap - I only set the Filter under Effects to 0, as well as the Bump Filter of the bump2d node:
Hey, it’s almost the same! Maybe we can assimilate it even more? We can, because apparently the step value of our mr custom bump needs to be 10 times lower and it’s factor 10 times higher to compensate the differences - this is the adjusted mr custom bump:
Except a few pixels, the result is exactly the same as with a bump2d. Exciting, isnt it?!
Well… You probably ask yourself what the other available bump node, the mib_passthrough_bump_map is good for. It has the same effect, it is only connected differently to the shading network. Here’s a snapshot of what I mean:
Ugh. What’s that blendColors node doin there? Well, I guess the mentalray developers simply had a good idea to pass a bump vector through a shading network if you dont have a Bump Mapping slot around, as with all mr custom shaders like the Cook-Torrance or DGS for example. The blendColors color1 is the mib_passthrough_bump_map, and color2 is the lambert. It’s Blender value is very low at 0.001, just as low to be non-zero, and the blendColors node itself goes into the mentalray material slot of your shading group. It’s a trick of course. The result is the very same though (with adjusted step settings etc.):
So. What are the reasons to use custom mr bump shaders? If you ask me, I dont see any. The bump2d has, with all filters off and mipmap activated, the exact same output. As long as you dont use mr custom shaders plus as long as you dont have no bumpCombiner around, it’s wasted time to build this networks (not in every case of course).
In reverse, the bump2d has some big bonus like the Bump Filter and the ability to use texture filters (quadratic etc.) to reduce texture artifacts.
NB: This is a rough comparison between the two methods to get mentalray bumping. It may, of course, not apply to all possible situations. And do try this at home!