View Full Version : Maya: Mixing shading networks using a Mask
I've come from 3DS Max where blending two shaders on one object with the help of an Alpha mask is a piece of cake. I'm now trying to figure out how to do this in Maya, and really need some help with it.
What I want to contruct is:
Two shaders (any two.. could be a blinn and a lambert, or even a skin or glass shader) with their respective shading networks are to be mixed on a single mesh by using a mask.
If, for example, I have a wall object, I want to have a complete network for the stone (with diffuse, spec, bump - all of it) and then mask in a glued on poster or similar, with it's own shading network.
Just masking file nodes are simple, but they then share the same settings apart from the Color map. Mixing whole shading networks is something I haven't cracked yet.
Would love the help and if someone have an example shading network setup, please post an image of it.
10-03-2005, 08:14 PM
Shading networks in MaYA is a WHOLE diffrent legue than that of Max...
You sort of have an unlimited ability to do anything.
For your specific question there is a variaty of ways to go for...
One simple method could be by using UV sets.. another by using a layered Shader...
The way the UV sets work is like lets say you have a brick wall like you said.. or a skin texture.. since this is going to tile and repeat.. you wouldn't need to go far and have a grand UV map for it.... just a unified projection would be enough.
But Lets ay you want to put a poster/Grafitti on your wall... and this time you have to have the whole wall projected onto a planar mapping. You simply create a new UVset and and give it a distinctive name.
In the UV connection editor, you could later on assighn the poster texture onto the second set.. and the brick texture onto the UV original Set.
(I usually use this for displacement maps.. since unified and spread out UV coords give me a better result I prepare that one seperately)
The method with the layered shader would be by creating two individual shaders and then assigning them to the layered shader.
These work literally like the layers in any photo editing program. The ones on top (In this case 'infront') is seen.. and you choose the options on how the one on the bottom is to be seen.
Now you could prepare a brick wall shader (Or use a redy one) and then you could prepare your poster and asaighn these two to the input values of theLayeredShader.
Now there are several tricks you could do here. One of them would be to have an alpha map prepared for the poster and to assighn the out alpha as transparency.. Or since a poster is fairly rectangular in shape.. you could scale rotate and reposition the poster on the wall with your 2D placement node. (Oh don't forget tochange your default colour to black then though.. or you will get semi transparency on the wall from it, since the default is 50 percent grey)
One of these should fit you fine as I get your question... if you decide on which one would be more for your benefit, let me know. I'll try to prepare a walk through accordingly.
Thanks for the help
The layered shader idea seems to be what I'm looking for.
I've had problems with the spec/transparency though.
Using a map for transparency still makes the "hidden" area show up in spec, so I'd have to mask off every aspect of the shader.
Is there some way to have a collector node, where I define which shader should go into white areas and which shader should go into black, and then connect a mask to it (without masking the transperency of either one)?
Any good tutorials on masking in layered shaders out there?
Anyway, I'm gonna try it out and see what I come up with.
10-03-2005, 10:21 PM
Yes there are ways;
And yes there are tutorials.. maybe you might want to give them a go first though.
So if you still have questions you can always come back and ask.
Putting a Lable on a bottle (http://www.digital-tutors.com/digital_tutors/display_video_details.php?videoX=153)
Placing a decale on an android (http://www.digital-tutors.com/digital_tutors/display_video_details.php?videoX=540) (I personally didn't like this one. There are many things I would do diffrently, and it starts in the middle of a training kit.
But none the less it helps for starters)
These are only two samples.. there are ALOT of tutorials such out there. the key word you are searching for is "Layered Shader" :)
hope this helps
Thanks for the help Black.
I've solved the problem now, and thought I'd write it down if anyone else have the same problem.
The standard Layered Shader in Maya doesn't support Mental Ray rendering that good, so I found the mix8layer Shader on www.Highend3D.com which works pretty much like layers in Photoshop (you can select a whole load of mixing techniques).
I connected my SSS_fast_skin Shader to color.layer0 (base color) and my blinn to color.layer1.
Important though is to connect the lmap (lightmap) file for the SSS material to the Shading Group of mix8layer (instead of the old SSS SG).
And finally, connect a file node (the alpha map) to o.factor in layer1 (also, I went with normal.mix in blending mode).
anyone have any questions, mail me and I'll try to answer:
14-03-2005, 06:32 PM
Lol; layered shaders are well supported in MetnalRay, it's the type of shaders you asign to the layered shader that can create problems. :)
Mental Ray has it's draw backs; like opacity maps, Alpha's.. subsurface scatterings and simiallar, don't really work.. especialy with mosified SubD's...
I have read that there have been significant changes in the newer version that comes with MaYA 6.5. But I haven't tried it yet. Waiting for the PLE first to come out.
I wish that you had told me earlier that you had intended to generate a skin shader... The part about 'Stone' got me off the track of Skin. That IS a whole diffrent matter to have to deal withn and there ARE ways to get impressiver effects.
None the less, I am glad you came up with a solution by yourself. Nothing would teach you better.
13-07-2005, 01:40 AM
This is a dated response but there's another, easier way to do this, using the blend node.
You would use a blend node in Maya and a b/w grunge map to control the actual blend value. The attached image shows a quick example...two different texture files and respective bumpmaps plugged into two blinns plugged into the blend node. Then theres a grungemap I painted in photoshop controlling the blend node's alpha setting.
Yeah a blend node would work for standard materials, but I've noticed that the fast_SSS shader isn't supported.
The Mix8Layers node will take care of the problem when using SSS and the blend node will deal with it if the mixed shaders are some of the normal ones.
vBulletin® v3.7.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.