Friday, May 8, 2015

Substance Designer and Rendering in Mental Ray

In the last year I've jumped into Substance Designer. It's node based workflow just makes sense after all these years of Fusion and Nuke. Because of that, potential change requests in textures/shaders are SO easy to make! Add a decal to a wall, branch it to affect normals and make it a bit bumpy, branch it to metallic and roughness to make it not shiny where the decal sits. Client doesn't like it? Use a 2D transform to move it around and all the properties update! I love it. Can I say that about a piece of software?

Working with the roughness/metallic workflow does make for some tricky transitions into Maya and Mental Ray though. Mental Ray's MIA material doesn't have a roughness/metallic input in the same method that Designer does and works based on reflectivity/specularity/glossiness. Fortunately, Substance has included a tool that translates diffuse/roughness/metallic into diffuse/specular/glossiness. Still, what I've found is that those maps aren't quite enough to get a perfect replica of what I did in Substance over to Maya.

In this post I'm going to outline what my workflow is. It's a bit complicated, but it seems to work well, especially when using image based lighting in Mental Ray. My results match what Substance has in its viewport quite well.

Here's a sample material preset from Substance Designer:

As mentioned above, those 4 outputs don't translate directly to the MIA material, so I've come up with this graph:

I'm using the built-in translator to go from roughness/metallic to spec/gloss. I'm keeping the normals and roughness (I know I'm not using roughness in the way Substance uses it, but it still varies the surface a bit which helps with creating a good looking material). As for reflectivity, by using the blend feature in the middle of the above instructions, I'm getting something that work for limiting what is and isn't reflective.

Lastly, I'm using an older method based on some instruction from Master Zap on his mental ray blog on "creating better metal materials." The short of it is:
- turn on Fresnel
- set your IOR high (like 25 or 50!)

Here's the resulting render using the same HDRI and image based lighting in Maya using Mental Ray:

Side benefit? This method works with non-metallic materials too. Here's an example of a graph using the Concrete preset in Designer:

And the resulting turntable:

There IS some reflectivity in the concrete. Barely. You can also see from the image of the resulting graph that the Specular output is pure, dark grey.

Lastly, as one final proof, here's a mixed material of metallic, paint, wood and some burn effects all on one kettle. The handle had some UVs that were a bit small which accounts for the flicker.

So let's talk pros and cons.

- results match Substance Designer
- material creation in Mental Ray is repeatable and settings are the same because it's dependent on these 6 outputs

- it may be repeatable, but even after coming up with this, I'm constantly referring to my own docs because I forget the steps
- 6 maps? Isn't that too much? Well it depends on the material. You have to use your own judgement. Do you need a concrete with subtle reflections? Then use the 6 maps. If it can just be a simple concrete then use the "Matte Finish" preset in the MIA material and just add color and bump. Done.
- Sometimes, in some cases, maps are duplicated. Look closely at the concrete output. The Reflectivity and Glossiness maps are identical. Work smart, pay attention to what you're doing, and load ONE map into Maya and branch it.
- Render times. So often I see people loading 2k maps on everything regardless of distance to camera. If you're loading SIX 2k maps on every object in your scene, you're not optimizing. Work smart.

It's been a LONG time since my last post, but I'm working on changing that this year. Next post will be using Agisoft Photoscan to aide in the creation of cool materials in Substance Designer!