SimplyMaya

Welcome back to SimplyMaya. Check out our latest training here.

MAYA TUTORIALS
General Lighting, Camera & Rendering Related Topics
 
Thread Tools
# 1 07-12-2011, 01:12 PM
Falott's Avatar
Falott
Registered User
Join Date: Jan 2005
Location: vienna
Posts: 1,095

proper connection: mia_material_x + normalMap

dear folks,

Intro:
Iīve come around that issue many times, but always ended up by using a bumpmap instead of normalMap, because it simply doesnīt work. there are numerous tutorials about connecting mia_material and normal maps but each and every explanation seems to really miss the point there.

the main issue is that by default the texture file is always connected to the bump2dNode through the alpha channel, which by definition doesnīt pass RGB values. it may be that by switching the bump2d from bump to tangent space normals the shader somehow grabs RBG values nonetheless, but I doubt it. still, normalmaps somehow work but adjusting bump2dīs intensity has no effect at all. (it seems to use a value of 1) additionally there is no visual difference if a bump or normal map is used.

has anyone ever used normalmaps successfully with the mia_material_x?

thx!


everything starts and ends in the right place at the right time.
# 2 07-12-2011, 06:58 PM
NextDesign's Avatar
NextDesign
Technical Director
Join Date: Feb 2004
Posts: 2,988
Hi Falott, I'll take a look for you. Is it necessary to have an X shader?


Imagination is more important than knowledge.

Last edited by NextDesign; 07-12-2011 at 07:40 PM.
# 3 08-12-2011, 07:24 AM
Falott's Avatar
Falott
Registered User
Join Date: Jan 2005
Location: vienna
Posts: 1,095
not necessarily. it didnīt work with mia_material as well. using maya2011 here, any previous version you may work on is of course ok. thanks for your interest man!


everything starts and ends in the right place at the right time.
# 4 08-12-2011, 05:38 PM
NextDesign's Avatar
NextDesign
Technical Director
Join Date: Feb 2004
Posts: 2,988
I got it to work with the mia, and mia x materials, but the x was limited. I'll post up my findings later today.


Imagination is more important than knowledge.
# 5 09-12-2011, 07:07 AM
Falott's Avatar
Falott
Registered User
Join Date: Jan 2005
Location: vienna
Posts: 1,095
cool! canīt wait to see the connections you made.


everything starts and ends in the right place at the right time.
# 6 10-12-2011, 02:32 AM
NextDesign's Avatar
NextDesign
Technical Director
Join Date: Feb 2004
Posts: 2,988
I can post it up later tomorrow. Exams are killing me at the moment. (3 in under 24 hours)...


Imagination is more important than knowledge.
# 7 10-12-2011, 05:39 AM
Falott's Avatar
Falott
Registered User
Join Date: Jan 2005
Location: vienna
Posts: 1,095
donīt worry! I have a working solution right now. post it after your exams, whenever it fits your time.
good luck!


everything starts and ends in the right place at the right time.
# 8 10-12-2011, 08:12 PM
NextDesign's Avatar
NextDesign
Technical Director
Join Date: Feb 2004
Posts: 2,988
Hey Falott. You certainly bring up some interesting challenges for me

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? )

Code:
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.

Hopefully this does what you need.

-John


Imagination is more important than knowledge.

Last edited by NextDesign; 10-12-2011 at 08:21 PM.
# 9 11-12-2011, 04:45 AM
PixalZA's Avatar
PixalZA
Lifetime Member
Join Date: May 2011
Location: Riyadh, Saudi Arabia
Posts: 525
Thanks ND. I remember some time ago experimenting with mia_material and also hitting the problem of getting normal maps to work. Have saved this for future reference.

# 10 11-12-2011, 08:42 AM
Falott's Avatar
Falott
Registered User
Join Date: Jan 2005
Location: vienna
Posts: 1,095
Holy! First time normalMaps work with both mia_material + mia_material_x! canīt believe it besides, this solution appears to be perfectly logic and simple.

Thank you so much man! but it is a pitty that youīre really the first guy who got this essential feature to work. From my point of view your answer would be definitly worth becoming sticky

all best!
Daniel


everything starts and ends in the right place at the right time.
# 11 11-12-2011, 09:57 AM
Nilla's Avatar
Nilla
Administrator
Join Date: Jun 2009
Location: Prague
Posts: 823

From my point of view your answer would be definitly worth becoming sticky

Originally Posted by Falott View Post
It's true there's a lot of questions on connections with the mia_material_x so I made it a sticky. Thanks for mentioning it.

Nilla

# 12 11-12-2011, 06:17 PM
NextDesign's Avatar
NextDesign
Technical Director
Join Date: Feb 2004
Posts: 2,988
Awesome, glad it worked!


Imagination is more important than knowledge.
Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off