PBR: Implications for texture creation?

So no spec maps plugged in there, ever. Just floating values or cavity maps (as explained in Joe’s tutorial), right…?

Just to be crystal-clear, , so how do we control Reflectivity/Reflectance in UE4? Again the 2 workflows to deal with this parameter described by are Specular and Metalness, and since we have none in UE4, I’d be tempted to think we deal with this with Roughness. But then why other solutions have both Roughness (or Glossiness, I wish people agreed on terminology…) AND Metalness and/or Specular? Is it not needed in UE4 because we have masks…? I’d like to understand the difference here.

The plot thickens…

The Marmoset tutorial is quite ok.
http://www.marmoset.co/toolbag/learn/pbr-practice

translation chart MTB->UE4:

albedo -> diffuse
microsurface -> roughness (inverted)
reflectivity -> specular
fresnel -> NO INPUT (automatically derived by BRDF model and specular-metal)
ambient occlusion -> ambient occlusion
cavity -> NO INPUT (you need to mult your maps either in diffuse and/or spec depending on the use)

and yes, no maps for spec. Remember to use it just as a float value.

Thanks. So we got no way to control reflectivity in UE4 other than with a floating value. I am still puzzled somehow.

If you think about it carefully it’s not really surprising. Reflectivity is just a “how much” value, so it’s gonna be a single float 0 to 1. Of course you can pump up the value to 100 if you like, but then you’re gonna kiss your energy conservation goodbye! Reflection doesn’t have a colour per se, it’s just reflected light coming from another source. If you turn metal up then spec is irrelevant, since metals reflect almost all the wavelength. Fresnel is taken care of by the brdf so it’s fine not having a value.

How should the GameTextures PBR textures be hooked up, then? Anyone want to post an example material setup?

They have an example on their blog:

Video:

Yes but no. See in that video the guy plugs a specular map into specular, for instance, which is completely wrong for UE4, if you’ve read this thread. He’s getting okay results with this mat but for dielectrics it really doesn’t pop on my end…

Yeah that’s a weird setup. Metallic and specular both hooked up. I imagine that can’t be keeping a proper light conservation.

As an aside, what’s the texture sample underneath the specular that has the green channel going to metallic? Just a special map with mutliple channels of data or…?

The setup is a bit strange, thats right. It would however be suitable for a material, where you have metallic and non-metallic parts in the same texture. The texture sample underneath the specular is mask, masking the different parts of the texture. Green represents the light grey metal lines on the in- and outside of the texture.

Here is what answered to the following query, thought I’d share with everyone:

*After watching your tutorial on setting a metal material for UE4 I must say I am puzzled. Admittedly I am very new to this all but after doing a lot of reading on PBR I would like to point a few things out:

I can see you plugged a Specular map into Specular, for instance. Specular in UE4 does not drive Reflectance, and has absolutely no effect on Metals. UE4 documentation specifically says you can occasionnally plug a cavity map there for dielectrics.

Also I’m not too sure about the use of your AO maps either. I noticed very few material coming with UE4 has AO maps now, and from what I gather on the ongoing PBR thread at Polycount, large scale AO is now a thing of the past.

In any case appart from metal materials I didn’t have much chance setting up dielectrics materials from your side in UE4 following. I think stating that most of your material work right out of the box in UE4 is slightly misleading and that we could use a little bit of clarification as to how to use it.*

Our materials are very much suited for UE4. We provide Ambient Occlusion maps as a courtesy because sometimes customers want them.
>
> As far as your issues with specularity - you are quite right. UE4 does not pay attention to specularity in some cases.
>
> Specularity is ONLY used on areas of a material that have a zero value for its metal map. Roughness and Specularity and Metalness are three separate things, and specularity is definitely still used.
>
> So, the specularity map will only render in areas that have a zero value in metalness, if there is a 0.1 value in metalness, then the specularity will no longer be used, and instead it will be replaced with a metal rendering process that UE4 uses.
>
> That is what the mask texture is for, so you can easily assign areas to be “metallic”.
>
> For Dielectric materials, it is important that you put in a constant node in the metalness input of your material and set it to the value of 0. This way it will know that it is not trying to render metal, and it will look to the specular map instead for reflection - but they definitely still work.
>
> The Ambient Occlusion maps are not always necessary, and most of the time they’re completely unnecessary. We provide them so that users may add ambient occlusion back in to their materials if they so desire, we stopped taking the liberty of just adding it ourselves with the release of all of the new rendering technology.
>
> As far as “out of the box” - nothing in Unreal 4 works “out of the box” - There is no material that is going to work perfectly how we designed them in UE4 without a little set up. This is just the direction Epic has taken with their rendering algorithms.

I guess the only thing I remain puzzled about is that I thought PBR implied not using spec maps anymore, even for non-metal materials? Is that wrong?

Anyway, thanks for the help everyone, I think this is a very valuable thread. I know I have things set up wrong, or at least not completely right, in several cases.

“I thought PBR implied not using spec maps anymore, even for non-metal materials? Is that wrong?”

I far as I understand, If you’re making a material that represents a single real world material, then you should use a single float value set to the real world reflectance of that material. The AO map(placed in the material AO slot) will dim down/cancel out the reflections that are in recessed areas. The gloss/roughness map not only makes the reflections blurred, but it also controls the intensity in a way that it follows energy conservation.

Non PBR shaders didn’t do this, so we had to fake it with specular maps. In short, Old Specular map = New Specular Constant + Roughness Intensity + AO

If your making a material that consist of multiple real world materials(like a wood surface that’s partially painted and metal inlays, etc) Then you would use textures to define the the different metallic and specular properties of each real world material in your shader.

Baking Cavity maps or AO maps into the Albedo map is still need in some situations to make up for the lack of self-shadowing in materials that have deep recessed areas. You still wouldn’t bake this into the specular map cause the spec map will still have a reflectance of 1 at gazing angles. The AO map in the AO material slot already does this for you.

At least this is how I understand it.

One more thing to note about the difference in how specular works compared to the old way. (note: I’m basing the “old way” of doing things on the current way that non pbr materials in 3dsmax work, so this might not be entirely accurate)

The Old way of doing specular was to feed in a specular value multiplied by a fresnel which used an IOR value.
So a glossy material would have a specular of 1 multiplied with a fresnel with an IOR of 1.3 -1.6 (this would give you a specular intensity of 1 at gazing angles and the “approximately” correct reflectance of the material at the viewing angle)

The New way hardcodes the specular constant of 1, and the user feeds the specular value of the reflectance at the viewing angle. And I’m guessing the fresnel IOR is computed internally between the two.
So now, a glossy material would have a specular(physical reflectance of the material) input of say, .01 or .02 or .5 and be done with it. ( I don’t the actual values per material, that’s what the charts are for)

And by all means, if I am incorrect on any of this, pleeeease let me know. I’m still trying to figure all this stuff out myself.