Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / Materials / Blend two shaders together?
  RSS 2.0 ATOM  

Blend two shaders together?
Rate this thread
 
15084
 
Permlink of this thread  
avatar
  • Total Posts: 9
  • Joined: 16 July 2008 11:15 AM

Hi there-

I am trying to build a blend material using Maya. I mean the mix of two different shadders using a mask or pordecural method. It is easy to do in Max but I cannot find a way with Maya.

I know there is a layered shader usefull to do it but it seems to me it is not working right when using MIA (mr) materials.

Any idea?

thanks in advance!



Replies: 0
avatar

yeah you can either use the blend node in hypershade or take to presets and join 50%



Maya :D

Replies: 0
avatar

Just an updated question.

How can we blend between MR material nodes, and perhaps Maya material nodes ?
ie:
You have a mia material with a bumpy surface, and you want to blend in some rust in areas.

You know, something along those lines.
It’s REALLY easy in Max but I cannot see how to do it in Maya as the blend colour node is only for two.



Replies: 0
avatar
  • THNKR
  • Posted: 24 March 2010 09:55 AM

There are endless ways of doing this. Here are thetwo simplest I can think of:

For “blending in” rust in a few areas, I would use a layered texture node, which work with mr materials.

If I wanted to animate a transition from say a mia_material to a an mi_metallic paint, I’d assign a surface shader, map a blendColors node to OutColor, and map the two materials to the colors of the blendColors node. Then I’d map an (animated) b/w texture to the blend attribute.



Replies: 1
/img/forum/dark/default_avatar.png

This is a great question, I have not been able to add two shaders to one surface successfully.
You would think the obvious thing would be to use the “Layer Shader node” but I have tried every which way to no success.
For example I am trying to add a pool of water to concrete. So I have my concrete shader (sourcing a texture on a blinn shadder) and then added a pool of water on top by assigning another texture (with alpha to cut out the puddle) moved its coordinates to where I like it played with the specular and reflection so it looked like water.

I have been trying to figure this out for days now. Can someone please help me with this. Are there examples that I can dissect to see how they work ?

Author: mettam

Replied: 25 March 2010 02:06 PM  
avatar

In mental ray, the answer is a mib_color_mix node, which is found in the “Data Conversion” section of your mental ray nodes in the hypershade window.

Mental Ray reads shader information by using the Shading Group (SG) node which is automatically created when you use either a Maya or Mental Ray Illumination Shader (like the MIA material, or a simple Phong or Blinn).  You cannot assign a color mix node directly to a surface, though, so you have to work around it.

Select a shader - any shader, and assign it to your object.  Display the SG node in the Attribute Editor, and expand the menu rollout under the “Mental Ray” section.

Drag a mib_color_mix node into the slot marked “Material Shader” in the Mental Ray section.

Display the mib_color_mix attributes in the Attribute Editor.  At the bottom you’ll see a place where you can assign a base color plus eight additional layers, starting with 0 and going up to seven.  This is a simple compositing node - above the color node section you’ll see eight inputs marked “weight” - these are your alpha channels. 

Up at the top, there is a section where you can specify your compositing flags on a layer by layer basis - you can use “add” or “multiply” or “blend” etc.  Finally, there is a dialog box called “Num” which directs Mental Ray as to how many layers above the base should be considered for compositing.  Note that the base color is NOT calculated in this - so if you have a base + two layers, the NUM should be set to 2 - even though it might seem to you that you have three layers.

The “weight” can be a simple float (grayscale) value to adjust the transparency of the layer, or you can use an image with an alpha channel. 

If you want to use a bump map with a color mix node, you can set it up initially like you would set up a Maya bump map - take a texture (like a fractal, for example) and connect it to a 2D Bump node.  The mib_color_mix node can’t understand a Maya bump node, so you can use a misss_set_normal node to translate it.  Drag the Maya bump onto the misss_set_normal, and connect the output of the bump to the “normal” attribute.  Drag the misss_set_normal onto the Color Base of the mib_color_mix node; assign another material to Color 0, set the weight to 1, the Num to 1, and the composite flag to “Add” and you’ll have the first step in a bumpy layered shader.



Replies: 0
avatar
  • TroyGBIV
  • Posted: 04 April 2010 08:35 AM

http://www.creativecrash.com/maya/downloads/shaders/c/mix8-layer-for-mentalray

you might like this as well, I have heard a few things about it sounds useful.

Btw, I think this was compiled for use only with windows as you may notice there is a .dll file in the mentalray includes.

There is a mix20 shader compiled for OSX though its a little older variant based off mix8 v1.0 and not the new alpha control mix8 v1.1. I have not really messed with either myself.

you can find the Mix20 on http://www.pixero.com/downloads_mr.html at the bottom. you can find a lot of shaders there actually. Mostly Windows, some old, some for Linux and OSX.

- T



Replies: 0