View Single Post
# 8 10-12-2011 , 08:12 PM
NextDesign's Avatar
Technical Director
Join Date: Feb 2004
Posts: 2,988
Hey Falott. You certainly bring up some interesting challenges for me user added image

Alright, so I chose to use a mia material, but you can use the same for a mia_x shader as well. What you need to do, is what other people have said (but with a twist!). Connect a misss_set_normal node to the bump of the mia material. Then, connect a bump2d node to the normal attribute of the miss_set_normal node. Make sure to change it to tangent space before connecting the file; Otherwise it will just function as a normal bump; even after changing the mode.

Now, to change the intensity (this is the tricky bit). To naively modify the intensity of a normal map, you simply overlay the neutral normal-map color (0.5, 0.5, 1.0) over-top. However due to the strange way that Maya handles normal maps, if you do any processing of the normal map in Maya, ex. connect a layered texture node to overlay the color, it will break the tangent space vectors. Another option is to edit the actual texture outside of Maya. However! I have found a way to get around this, using the color gain, and color offset attributes in the file node itself! Since this is still in the file node; it will not break the vectors!

So, the new control for the intensity of the normal map will be the file node's color gain. Right click on color offset, and click "Create new expression." Now, enter in the following, replacing "fileNode" with the name of the file node. (I know, code... But what did you expect from me? user added image)

fileNode.colorOffsetR = (1 - fileNode.colorGainR) * 0.5;
fileNode.colorOffsetG = (1 - fileNode.colorGainG) * 0.5;
fileNode.colorOffsetB = (1 - fileNode.colorGainB) * 1.0;
What this does, is as you increase the color gain, the more of the map will show through. The less the color gain, the more of the plain normal-map will be shown.

You can then connect this value (color gain) with the bump node's Bump Depth attribute, so the functionality would be the same as it always was. Simply open up the connection editor with the bump node in the left pane, and the file node in the right. Then simply connect the bumpDepth to the colorGainR, colorGainG, and colorGainB. Now, take the depth slider out for a spin! With all luck you should have complete functionality back. user added image

Hopefully this does what you need.


Imagination is more important than knowledge.

Last edited by NextDesign; 10-12-2011 at 08:21 PM.