SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

Home / forum / Lighting & Rendering, Dynamics & Effects, Texturing / Mental Ray / proper connection: mia_material_x + normalMap
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 07-12-2011, 12:12 PM   #1
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
Thanks: 3
Thanked 20 Times in 18 Posts
Default 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.
Falott is offline   Reply With Quote
Old 07-12-2011, 05:58 PM   #2
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Posts: 2,988
Thanks: 33
Thanked 532 Times in 471 Posts
Default

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 06:40 PM.
NextDesign is offline   Reply With Quote
Old 08-12-2011, 06:24 AM   #3
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
Thanks: 3
Thanked 20 Times in 18 Posts
Default

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.
Falott is offline   Reply With Quote
Old 08-12-2011, 04:38 PM   #4
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Posts: 2,988
Thanks: 33
Thanked 532 Times in 471 Posts
Default

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.
NextDesign is offline   Reply With Quote
The Following User Says Thank You to NextDesign For This Useful Post:
Falott (09-12-2011)
Old 09-12-2011, 06:07 AM   #5
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
Thanks: 3
Thanked 20 Times in 18 Posts
Default

cool! canīt wait to see the connections you made.
__________________
everything starts and ends in the right place at the right time.
Falott is offline   Reply With Quote
Old 10-12-2011, 01:32 AM   #6
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Posts: 2,988
Thanks: 33
Thanked 532 Times in 471 Posts
Default

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.
NextDesign is offline   Reply With Quote
Old 10-12-2011, 04:39 AM   #7
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
Thanks: 3
Thanked 20 Times in 18 Posts
Default

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.
Falott is offline   Reply With Quote
Old 10-12-2011, 07:12 PM   #8
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Posts: 2,988
Thanks: 33
Thanked 532 Times in 471 Posts
Default

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 07:21 PM.
NextDesign is offline   Reply With Quote
The Following User Says Thank You to NextDesign For This Useful Post:
nilag (24-11-2012)
Old 11-12-2011, 03:45 AM   #9
PixalZA
Lifetime Member
 
PixalZA's Avatar
 
Join Date: May 2011
Location: Riyadh, Saudi Arabia
Posts: 525
Thanks: 67
Thanked 90 Times in 77 Posts
Default

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.
PixalZA is offline   Reply With Quote
Old 11-12-2011, 07:42 AM   #10
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
Thanks: 3
Thanked 20 Times in 18 Posts
Default

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.
Falott is offline   Reply With Quote
Old 11-12-2011, 08:57 AM   #11
Nilla
Administrator
 
Nilla's Avatar
 
Join Date: Jun 2009
Location: Prague
Posts: 801
Thanks: 28
Thanked 234 Times in 187 Posts
Default

Quote:
Originally Posted by Falott View Post
From my point of view your answer would be definitly worth becoming sticky
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
Nilla is offline   Reply With Quote
Old 11-12-2011, 05:17 PM   #12
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Posts: 2,988
Thanks: 33
Thanked 532 Times in 471 Posts
Default

Awesome, glad it worked!
__________________
Imagination is more important than knowledge.
NextDesign is offline   Reply With Quote
New Thread

« Previous Thread | Next Thread »

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Very Basic Connection Editor Question Falott Maya Basics & Newbie Lounge 4 06-02-2011 07:00 AM

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.