How to mix layered material by Fresnel IOR?


#1

Hi,

i very often do custom CarPaint materials with Mental Ray, as the pre-made material is quite clumsy and inflexible.

I usually achieve this by blending metallic base layer of rough colored reflection with mirror reflection used as a coating.

In 3ds Max this is super easily achieved by using blend material with two materials blended by falloff node set to Fresnel IOR mode.

In Maya, such an essential thing is being really pain so far. I discovered the annoying workaround of feeding mia_materials through surface shader node into layered shader, but i can not figure out how to blend the two shaders using Fresnel IOR.

SamplerInfo plugged into ramp node does not pump out fresnel, but some random arbitrary incidence gradient. There is also mib_refraction_index node which i could not find how to hook up.

I will be really thankful for any suggestions. This is what i am after:


#2

>SamplerInfo plugged into ramp node does not pump out fresnel

You can tweak ramp as you wish to get result very close to frenel.


#3

Yes, but that is exactly what i do not want. I know what to expect from fresnel, and i am used to it. Plus the number is variable. So i would constantly need to render out references of particular Fresnel IOR number in Max, and then spend a lot of time tweaking it to look the same. This is really extremely basic task, so i can not imagine Maya not being able to do that.


#4

Are you or will you have access to maya 2015? You can use the new mila shaders for this nice and easily. You can layer materials via fresnel index of refraction, schlick approximation or custom map.


#5

I know about MILA, but i had no idea that it is production ready. I heard about numerous cases where it produces weird results or artifacts, and that it often does not mix well with mia_materials.


#6

Well you will not know unless you try and then any problems you can report so they can be looked at and fixed.

You would not want to mix them in a scene with mia’s. You would want use solely mila materials in the scene.


#7

maybe interesting…
http://elementalray.wordpress.com/2014/04/18/the-layering-library-mila-part-1/
http://elementalray.wordpress.com/2014/04/20/the-layering-library-mila-part-2/
http://blog.mentalray.com/2014/04/18/layering-in-maya2015/


#8

Yes, this is the biggest problem. Most of my materials are mia. there’s some flexibility that MILA is missing compared to mia… also MILA materials are a LOT more pain to set up that MIA… Sure they offer greater flexibility when you are layering materials, but when you are not, they just add unnecessary layer of complexity to something otherwise very simple.

If combining MILA and mia is not officially supported, then that is a serious flaw in the design. While i can see someone using MILA for specific layered materials, i really can not see anyone using MILA materials exclusively in their scenes anytime soon. Especially in this semi-beta state.


#9

Yeah I thought you might say that. We have the same issue here with our shader library of mia’s.

Can you elaborate on this? What kind of flexibilities?

Hopefully when the nvidia scripts come out maybe there will be more phenomenons made. One setup in the style of the mia material for people. A script would be handy to transfer a mia to a mila. Think there is already one somewhere.

This would be solved with a preset for a mila material already setup like the mia.

I think you can have a scene where some geometry is using mia’s and others are using mila. Layering a mia into a mila I believe is possible but I think the idea now is to get away from the old and start a fresh. My guess is that there will be certain new features that the mia’s will not be able to take advantage of in terms of the new rendering core but I am not sure.

To be honest we are not using mental ray much more. I am keeping my eyes on it as it evolves but for me, until the IPR is improved to a level on par with Vray and Arnold I can’t see us using it. IPR is one of the most import things for us. This is down to Autodesk but thankfully nvidia are now closer with them so maybe in another year we will see this resolved.

We are working on an internal project testing maya 2015 and will be using MR to render so we can really test mila and new mr features.


#10

The biggest issue i have is absence of AO detail enhancement mode. FG is terribly inaccurate GI solution, so absence of this feature, which i use as sort of local brute force GI, is a real dearbreaker.

Not FG force, nor new GPU GI, are usable in production with acceptable speed or result. And GPU GI set to CPU fallback seems to have intentionally crippled performance to appear significantly slower compared to it’s GPU mode, even when such a slowdown is not even practically possible.


#11

The biggest issue i have is absence of AO detail enhancement mode. FG is terribly inaccurate GI solution, so absence of this feature, which i use as sort of local brute force GI, is a real dearbreaker.

This is maybe in a different position to where it is in Max. But it is definitely there and I use the same technique when dealing with mentalray scenes. It’s located under the Ambient Occlusion rollout… of the Mia material’s attributes in the Attribute Editor.

As for the fresnel node I feel your pain. I much prefer layering a second clearcoat using a IOR fresnel node as I’m also used to dealing with reflection falloff in IOR. I am able to do this in vRay because of the fresnelTex it comes with. But haven’t found a sollution for mentalray.
I once upon a time created my own fresnel node compound for softimage using all the math nodes that came with it but haven’t been able to do the same thing in maya.


#12

Yes, we were talking about what is missing in MILA layering library compared to mia_material. I know where it is located in mia_material, and how to use it. What i do not know is where to find it in MILA material.


#13

I managed to achieve the result you are wanting, creating a fresnel tex shader by using a
hacked mia_material which outputs the fresnel curve from your IOR value.

To create the fresnel tex all you have to do is set the following in your mia material…

diffuse -> “0”
refl.color -> “1”
reflectivity -> “1”
gloss ->“1”
Use Max distance -> “On” (under the Advanced Reflection Rollout)
End Color -> “White” (under the Advanced Reflection Rollout)
Max Distance -> “0.00001” (under the Advanced Reflection Rollout)
Max Trace Depth -> “1” (under the Advanced Reflection Rollout)
Fade To End Color -> “On”
Use Fresnel Reflection -> “On” (under BRDF rollout)
Single Sample from Environment -> “On” (under Interpolation rollout)
Specular Balance -> “0” (under the Advanced rollout, near the bottom)

Now you have a material that just outputs a black and white value
based on the IOR value you set under the refraction rollout of the mia.
Its basically just reflecting white and we set the max distance to a really small value
so you get an output of the fresnel curve.
You can save this as a material preset so you don’t have to do this all over again
every time.

Then you use any of the output values from this fresnel mia’s output R,G or B as the driver
for your blend between your 2 materials. I’m using a mia_X material for the 2 visible
blended shaders and just a normal mia for the fresnel tex.

The correct way would be to use a mib_color_mix, plugging the output of that into
the surface override on the shader group. But using the blendColors and a Surface
shader should work too, just took a lot quicker to setup to convey the idea here.


#14

Sorry, my mistake for skim reading the followup posts. I’m guessing it’s missing from the MILA
library because the MILA shaders are specifically designed for a more physically based brute-force unified approach ala Arnold. But check the post above this one for your fresnel issue.


#15

You could try Maya’s Studio Clear Coat. I haven’t loaded the plug in in a while. But in theory it will give you an IOR input to add to your shading network.

http://download.autodesk.com/global/docs/maya2014/en_us/index.html?url=files/Shading_Nodes_Studio_Clear_Coat.htm,topicNumber=d30e667880


#16

The solution from LinchpinZA seems to be working, thanks a lot!

As for the MILA’s absence of AO detail enhancement… Brute force GI solutions in mental ray are still unusable, so as long as there’s this gap state of no usable brute force GI and no AO detail enhancement in MILA, i can’t really see myself using it.


#17

The Maya studio clearcoat is unfortunately unsupported by mentalray.


#18

Cool, glad it’s working for you.
Yeah there are some great posts on that elementalray blog about setting up mentalray for
good brute force and unified sampling and they have some impressive render-times. But
the setup time to get to that point is still way too long and clunky for me. I’m keeping an eye on it though as I think the MILA library is a clever idea with dealing with Bruteforce methods as you are essentially limiting shader calls to the exact amount that is required in a scene unlike traditional monolithic shaders (mia, vraymtl, aiStandard) that can become very expensive to evaluate when you have a lot of them in a bruteforce scene.


#19

I actually do not have problem with setup… but with speed. I just haven’t ever seen FG brute force successfuly used in production, and i myself failed everytime i attempted to get any reasonable rendertime with FG force.

BTW, i saw your awesome demo reel. Is that all Mental Ray?

EDIT: Nevermind the question. I wasn’t paying attention to the text bar at the bottom :slight_smile:


#20

Oh OK, yeah I haven’t tested it myself so was just going by what I’ve seen on the
elementalray blog. I think bruteforce methods are still always going to be a lot longer to
render, even with using rayswitching/instanced render-assemblies(proxies) etc.

I’ve stuck with V-Ray and mentalray because it allows me to tweak and get render times a lot lower for the small resources I have at our shop. The Arnold/bruteforce philosophy is cool (shorten artist time at the cost of render time) but doesn’t make sense for a studio that only has 10 render machines.

About the reel, thanks man, a mixture of everything, mostly vray… but the bottle render which was all mentalray is still probably my favorite render of the lot.