CGTalk > Software > Autodesk Maya
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 02-09-2013, 05:44 PM   #1
ibm051000
New Member
portfolio
Isaac Murray
USA
 
Join Date: Feb 2013
Posts: 6
Question How to Use RGB Mattes for Layered Textures in MentalRay

Here is the core concept.

I am creating a mia_material_x shader and need a little help with how masks are used to make layered textures for one channel. I have a RGB texture matte/mask where R, G and B color is used for a different pattern of scratches or scuffs. This will then be used as the mask to combine 3+ diffuse textures.

What node do I need to use to accomplish this?

Thanks in advance!
 
Old 02-10-2013, 03:04 PM   #2
EightBit
Lord of the posts
Mitch Rosefelt
OutThereSumwhere, USA
 
Join Date: Jan 2008
Posts: 1,044
Are you familiar with compositing? If so, you could create a render layer for each mask and assign the mask as a surface shader - white for scratches, the rest black. Then in your compositing software you would assign these as masks for the colors that you want to apply - choosing a blending mode that looks coolest. You can get quite artsy with this flexible technique.
__________________
If animation couldn't change the world, it wouldn't be such a Micky-Mouse place.
 
Old 02-10-2013, 04:49 PM   #3
ibm051000
New Member
portfolio
Isaac Murray
USA
 
Join Date: Feb 2013
Posts: 6
Thanks for the reply EightBit!

I am familiar with compositing and have used RGB mattes in Nuke/AE before. This is basically the same concept, just happening at a shader level to control how textures are mixed. Here is a rough visual representation of what I am going for:



I have come fairly close with the mib_colormix node, but it is looking for alpha input. I need something that works just like RGB mattes do in compositing where you can say take the Red channel and that's the mask for texture 1, take the Blue channel and that's the mask for texture 2 . . . so on.
 
Old 02-11-2013, 02:37 AM   #4
EightBit
Lord of the posts
Mitch Rosefelt
OutThereSumwhere, USA
 
Join Date: Jan 2008
Posts: 1,044
I'm not a MR expert by any means, but if the look of these scratches is worth the effort of creating separate mattes like that, compositing has got to be infinitely more tweakable.
__________________
If animation couldn't change the world, it wouldn't be such a Micky-Mouse place.
 
Old 02-11-2013, 03:01 AM   #5
ibm051000
New Member
portfolio
Isaac Murray
USA
 
Join Date: Feb 2013
Posts: 6
I am working with assets that were provided to me and I am building the shaders from the textures they provided, the picture above is just a rough example that I threw to together to illustrate my point. The real textures are indeed very detailed. I think it was textured in Mari and the use of RGB mattes to create layered textures is to leave some flexibility for changes. If you decide to change the amount/style of scratches you output one new matte opposed to having to out put new diffuse/spec/etc... Just a guess though.

Now I just have to figure out how to get it to work!
 
Old 02-11-2013, 10:51 AM   #6
nookie
Know-it-All
 
nookie's Avatar
portfolio
Luca Fiorentini
Lighting Artist
Lucasfilm Animation
Singapore, Singapore
 
Join Date: Jan 2004
Posts: 367
Send a message via MSN to nookie
check out the mib_color_mix.
Take care about layering shaders this way cause, depending on what you do, render time could go really high.
Seems that a new library is under development to avoid this (http://elementalray.wordpress.com/2...i-beta-shaders/)
 
Old 02-12-2013, 07:33 AM   #7
gauranga108
Lord of the posts
portfolio
jake mr
makaha, US
 
Join Date: Apr 2010
Posts: 736
I did this for the first time the other day.

I made a layered shader node, then put different surface shaders in as different layers and used the custom color buffer pass and the writeToColorBuffer node to get each layer into a pass. It's great for an exr for nuke, saves work in nuke not having to shuffle and copy passes to the main data stream.

You may want to write a little script to automate the process though.

Is that what you meant?
 
Old 02-12-2013, 04:54 PM   #8
ibm051000
New Member
portfolio
Isaac Murray
USA
 
Join Date: Feb 2013
Posts: 6
Thanks nookie, mib_color_mix did the trick. I had one of those "duh" moments when I realized I just needed to point either the R, G or B of the outColor from the RGBmask to the mix weight.

I ended up creating multiple mia_material_x shaders, such as base metal, paint, dirt and used the mib_color_mix to combine them as desired.

I'm about to explore doing this same setup with VRay.

Thanks for the help!
 
Old 02-12-2013, 04:59 PM   #9
ibm051000
New Member
portfolio
Isaac Murray
USA
 
Join Date: Feb 2013
Posts: 6
Not sure this is what I was trying to do, my previous post mentions my solve, but pretty cool concept! So this would give you RGBmattes as passes on your exr?

Quote:
Originally Posted by gauranga108
I did this for the first time the other day.

I made a layered shader node, then put different surface shaders in as different layers and used the custom color buffer pass and the writeToColorBuffer node to get each layer into a pass. It's great for an exr for nuke, saves work in nuke not having to shuffle and copy passes to the main data stream.

You may want to write a little script to automate the process though.

Is that what you meant?
 
Old 02-12-2013, 08:18 PM   #10
gauranga108
Lord of the posts
portfolio
jake mr
makaha, US
 
Join Date: Apr 2010
Posts: 736
Quote:
Originally Posted by ibm051000
Not sure this is what I was trying to do, my previous post mentions my solve, but pretty cool concept! So this would give you RGBmattes as passes on your exr?


yup and then some.
 
Old 02-14-2013, 05:45 PM   #11
VB2341
Frequenter
portfolio
Varun Bajaj
Troy, US
 
Join Date: Jan 2013
Posts: 125
mib_color_mix is probably a better node to use than maya's default layered texture, but you can use the layered texture node and plug in the various outColor channels from the mask image into the alpha of each layer. As stated though, this can be dangerous at render time, so I'd be wary of that (though it'll work if for some unknown reason you decide to use the software renderer). IMO, the most efficient method may actually be to extract the channels in Photoshop or something, it will generate a few more files, but I would think it would be a lot more advantageous at render time.
 
Old 02-14-2013, 05:45 PM   #12
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,480
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 12:20 PM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.