Metallic-roughness workflow

Started by sboerner, March 08, 2020, 08:48:58 PM

Previous topic - Next topic

sboerner

I've been learning about the metallic-roughness PBR workflow and am trying to figure out the best way to implement it in Terragen. Basically following up on this thread and making a few tweaks to the shading network that Matt recommends.

The three main maps are basecolor (albedo), metallic, and roughness. The basecolor map stores both the diffuse color (for dielectrics) and specular color (for metals). The metallic map is just a mask used to keep the two separate. This mask enforces the law of energy conservation by ensuring that any reflected light (diffuse + specular) will be less than or equal to the amount of light used to illuminate the surface.

An example of the shading network I'm working with now is attached. The metallic map masks two instances of the basecolor map, with the dielectric map inverted. Roughness and height (if used) are plugged in as usual, with roughness also directed to a reflective shader, which provides fresnel reflections on the oblique surfaces of the object. The specular shader is also masked by the metallic map. These are all set to 1 in the default shader: Diffuse color, specularity, roughness. Index of refraction is set to 10. In both basecolor image map shaders, "Fit mask to this" is unchecked. This is important to keep the two maps from being scaled differently and creating interference patterns across the UV map.

Of course, if the metallic map is completely white, the surface is pure metal and you can simplify the network. Likewise, if it's completely black, the surface is completely dielectric and you can really simplify the network.

I wondered if it might be possible to set up an image-based lighting node in Terragen so I could duplicate the lighting used in the Substance Painter workspace and make apples-to-apples comparisons of surfaces between the two applications. Turns out that you can. Disable the planet, background, sun, and environment light. Create a sphere large enough to contain the object and your camera and assign an HDR image to it with a spherical projection. Give the sphere a negative radius to place the image on the interior, and flip the x direction of the image to correct the orientation. Turn off everything except luminosity, which can be set to 1-2. Works great with the path tracer. I understand it also will work with the standard renderer if you enable the environment light. Doesn't work with RTP, unfortunately.

Some things might need to be tweaked to match the two views (image attached). For the IBL rendering of the teapot (also attached) I reduced the roughness slider to 0.5 to sharpen up the specular reflections a bit.

Much more to be learned here. Comments welcome, especially if anyone spots something I'm doing wrong.

If we ask nicely, I wonder if Planetside some day might give us a metallic-roughness shader. That would be sweet.

Matt

Quote from: sboerner on March 08, 2020, 08:48:58 PMMuch more to be learned here. Comments welcome, especially if anyone spots something I'm doing wrong.

It's interesting to see your workflow. At first glance it seems like a lot of nodes, but then I remember that I ran into a similar level of complexity with my setup. Which leads onto the next bit...

QuoteIf we ask nicely, I wonder if Planetside some day might give us a metallic-roughness shader. That would be sweet.

I am considering some ways to make PBR materials easier to work with. One idea that I'm leaning towards is adding a metallic setting to the Default Shader, and renaming the diffuse colour to base colour. All of the existing reflectivity settings would take care of the fresnel effect which is present in metals as well as dielectrics, and we could update the defaults to make them more physically correct (e.g. reflectivity at 1). It means that we can continue using the Default Shader as the standard shader assigned to imported objects. Chaos Group recently did something similar with VRayMtl and this reinforced the idea for me.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

sboerner

Thanks, Matt. This is great news. Would the metallic setting be similar to the metalness parameter in Arnold's standard surface?

Matt

Yes, exactly the same, as far as I know. I don't know whether it's better to call it 'metallic' or 'metalness'. 'Metallic' isn't the right word (unless it's a checkbox), but 'metalness' isn't a real word.
Just because milk is white doesn't mean that clouds are made of milk.

WAS

#4
My leather pants are crackling

First of all I like the effect of your tweaks for metalness, some nice things to consider here. Effect is nice, and cleaner than multiple shaders and mixes by metallic. I do feel that the specific look of the roughness in your source material may be down to lighting, where TG is considering more ambient light.

Also that idea from Matt sounds fantastic and less invasive than thoughts I had about more redundantly having a PBR shader with a specific end use.

Dune

Great work, Steve, and I am pretty pleased with your reply too, Matt! Sounds good.

Hannes

Echo all! Sounds great! And thanks for your efforts, Steve. :)

KyL

Really nice experiment.

I usually work in Painter with an HDRi rendered from Terragen, but this is great to see this works nicely with the other way around. You could do an exact comparison if you create your own HDRi though.  :)

sboerner

Quote'Metallic' isn't the right word (unless it's a checkbox), but 'metalness' isn't a real word.
Yes, we need a noun that means "condition of," like specularity for specular, and roughness for, well, roughness. Metalarity? Metalosity?  :P


(Whatever you decide to call it, it will be a welcome addition.)


QuoteI usually work in Painter with an HDRi rendered from Terragen, but this is great to see this works nicely with the other way around. You could do an exact comparison if you create your own HDRi though.


Thanks, KyL. That's a great idea - you could make a custom HDRI from the scene that will include the object. Is that what you mean?

KyL

Quote from: sboerner on March 09, 2020, 10:38:04 AMThanks, KyL. That's a great idea - you could make a custom HDRI from the scene that will include the object. Is that what you mean?


Yes. If you simply render the default scene with a 360 degree camera and save it as a 32bit EXR to load in Painter, you should have a pretty good match.

WAS

#10
Metalness is most certainly a word (like wispiness) as it employs "-ness" which denotes a noun from an adjective. Also it would probably be best to stay within the ground of standard terminology and not make things up that would confuse people working with PBRs.

Dune

Just 'metal' would do it for me.

sboerner

Just one small update. I've found that the Specular roughness setting should be 0.8, which is the default maximum that you get when you move the slider completely to the right. Setting it to 1.0 makes the roughness too diffuse.

This seems to be an exception to the general 0-1 range used for many sliders.

WAS

Quote from: sboerner on March 20, 2020, 09:58:59 PMJust one small update. I've found that the Specular roughness setting should be 0.8, which is the default maximum that you get when you move the slider completely to the right. Setting it to 1.0 makes the roughness too diffuse.

This seems to be an exception to the general 0-1 range used for many sliders.

Interesting. I found 1 is more true to PBR examples. Slider peaking at 0.8 may be just the framework.