XM Magdalena 3D print, GGeorgy (3D)
LC #42 Pipers Alley

View Full Version : mixing mia_material_x shaders with add?

08-01-2009, 10:05 PM
I'm seeing that you can't have an add in a layered shader but you can have two mia_mat_x layered. Then there's mix20layers that lets you have them as add but you can't use it with mia_mat_x shaders. Is there something I can use to have it all?

08-02-2009, 12:05 AM
Couldn't you just plug your second mia material into the first's "Additional Color" slot? Or am I misunderstanding the question?

08-02-2009, 01:13 AM
ah - good point since this one is add. But that's just for this one shader I'm working on - is there no way to multiply/subtract/etc like mix20 but with mia_mats?

08-02-2009, 05:14 AM
This might help :


I made this for another post similar to yours.

08-02-2009, 03:18 PM

You can use that technique, and there's also a way to do it with a mental ray phenomenon on DJX's blog.


In addition, I compiled mix20 for Intel Mac folks, which you can pick up in a separate package on Pixero's site (old news, but useful within the context). There's a link to a huge .zip of all of the Intel .so's halfway down the page until he gets around to integrating them / replacing the PPC versions in the main packages.



08-02-2009, 04:24 PM
I have mix20 and it works great but does that djX phenomenon shader use mia_mats? It might sound inefficient but I'm looking for a simple way to get Maxwell-like monolithic shader layering

08-02-2009, 06:36 PM
Well, dj's mix_colors phenomena works more or less like mix_20. What I'd recommend doing is blending a ton of your mats then feeding them as additional color over you master shader/shading group (an mia_material, usually). You can build up speculars, multiply out dirt, etc etc this way.

You can mix raw textures/ramps/procedurals and shader output in it, just no compiled shader requirement... which can be very helpful in a multiplatform environment.

It's sounding like you really want something akin to Nexus (a monolithic uber shader with a built in pass buffer)... but I'd hesitate to recommend it after seeing the complete lack of anything other than Win32 support and next to no bug fixes or development updates since its release...


Puppet's MegaTK is similar to Nexus as well... and is very well supported. Has a built in pass system as well, which rocks, and it writes multichannel EXR if I recall.


Hope some of this helps,


08-03-2009, 12:39 AM
cool - I have megaTK installed. I'll give it a look.

08-03-2009, 02:25 AM
I think the reason people think mia doesn't work with other shader-nodes (like all these layering ones) is because someone decided to call the mia output attribute "result" instead of "output" like in every other shader. When you drag-and-drop, maya trys to connect the output attribute, which it cant find on mia so nothing happens.
So you have to use the connection editor and hook it up yourself.
-- David

08-03-2009, 09:25 AM
The simplest way to do an "Add" 2 shaders on top of each other is use a +/- node. You have no options, but sometimes simplicity is all that is needed. If you want to have color controls just insert a HSV color node before you connect it to the Add node. Then you have more possibilities.

I mention this because sometimes using custom shaders is not an option.

08-03-2009, 11:47 AM
I am having the same problem, I am trying to create a carbon fiber shader, but I am not getting the results with the "add" algorithm. I used the +/- node, but for some reason the spec in the second shader is affected by the normal map in the first shader.

I know the mix20layer has a screen option which might work. But I can't get mix20layer to work with maya2009 (it worked perfectly in Maya8.0)

This is what I would like to achieve:
http://mxmgallery.maxwellrender.com...1&mode=0&id=172 (http://mxmgallery.maxwellrender.com/ranking_scripts.php#page=1&mode=0&id=172)
http://img141.imageshack.us/img141/1885/flatcarbonfiberglas9541.jpg (http://img141.imageshack.us/i/flatcarbonfiberglas9541.jpg/)

Unfortunately, this is where I get stuck at. I can't get the coating effect right.
http://img222.imageshack.us/img222/2505/carbonfiber.jpg (http://img222.imageshack.us/i/carbonfiber.jpg/)

Any Ideas?

08-03-2009, 06:34 PM
I think the reason people think mia doesn't work with other shader-nodes (like all these layering ones) is because someone decided to call the mia output attribute "result" instead of "output" like in every other shader. When you drag-and-drop, maya trys to connect the output attribute, which it cant find on mia so nothing happens.
So you have to use the connection editor and hook it up yourself.
-- David

haha - you're right. now my problem is solved. I just connected the result from one mia_mat_x to the Additional Color node of another mia_mat_x. thanks

Hoerboer vbmenu_register("postmenu_6020754", true); - - the Maxwell shaders are so high quality and so easy to work with (roughness goes up, glossiness goes down, etc) that it makes these kinds of things seem ridiculous. you can't use procedural textures with Maxwell though so it's ONLY good for realism and image-based textures.

08-04-2009, 08:10 AM
You will need to use a layered shader for this.

To get MIA to work in a layered shader connect "result" to the color of a surface shader, then connect this to Layered shader.

For the Laque, you will also need to connect the transparency, and make the shader completely transparent so you only get your spec/reflection.

If you are using MIA, make sure you have a "no diffuse on bump" enabled to get the laque effect.

For the Carbon Fibre, your are going to need 2 shaders.

1. Anisotroic metal shader with the bump and textures
2. Laque on top, with no bump in the diffuse.


08-04-2009, 03:27 PM
Awesome!! Thanx MasonDoran for the advice, it worked.

Here is the result. Carbon Fiber still needs some work but at least the Laque on top looks like its supposed to

[/url][url="http://img140.imageshack.us/i/rim02026medium.jpg/"]http://img140.imageshack.us/img140/9616/rim02026medium.jpg (http://img219.imageshack.us/i/rim02026medium.jpg/)

08-05-2009, 06:53 AM
Nice looking tire. Is that a displacement map?

08-05-2009, 12:10 PM
I actually connected the mia_x material to a layered shader which worked fine. Don't know why I didn't try it the first time.

Thanx. No I didn't use displacement maps, it's all modelled.

I am selling this scene on turbosquid if anyone is interested.
Geometry + Materials + Textures

http://img233.imageshack.us/img233/6251/thumbsf.jpg (http://img233.imageshack.us/i/thumbsf.jpg/)

08-06-2009, 05:52 AM
Just curious - do you make money on Turbosquid? I always thought it was a bit like this design I did for a cell phone graphics company a while back (which was also based on royalties): you spend 20 hours on something and get a cheque for $9.30 every year.

08-06-2009, 10:02 AM
I don't make models especially for Turbosquid. It's more like some of my personal test projects which I sometimes upload on Turbosquid. And the more models you upload the more you'll make. Every extra bit helps I guess.

Let me put it this way, I have managed to pay most of my scuba equipment with the checks I got from Turbosquid.

08-06-2009, 12:02 PM
We use turbosquid models at work. It's more cost-effective than hiring someone to model for you, if the objects you need are 'common'

Then again I'm not happy to be the one who has to transfer .max to maya files and clean up the uber-heavy-poly-scenes.

08-06-2009, 05:43 PM
whoa - that's pretty good, Hoerboer. A lot better than I thought it would be. I've bought models from there when at the magazine and in a pinch for an asset (do I really want to model the interior of a snowglobe today or lay out the rest of the feature?)

But ya, the sloppiness of some of the models and formats is annoying. Especially since I'm on a Mac and have to open VMWare to translate a max file.

CGTalk Moderation
08-06-2009, 05:43 PM
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.