Author Topic: Free Comprehensive PBR Guide  (Read 27282 times)

Hey Fabian F.,
I must have missed your suggestion from the other thread:
Hey kashif.c.riley,

if you really would like to author your maps in Photoshop, for instance, you wouldn't want to author them darker and recalculate every time you make a change. It's quite confusing :P
What you could do is to create your own working space for Linear sRGB colour. To work just like you would normally you could use a proof setup to view the image in sRGB with a Gamma of 2.2, even if the actual image is linearised.

The biggest benefit I see doing that: You won't get those dark rims around blended colours, which you do get when not working with a linear colour space because Photoshop does the maths wrong somehow.

If you really need to use Photoshop this would the setup I would recommend. If not, just use Substance Painter :P


Best Regards

So what I did in Photoshop was to create an ICC Profile with Gamma 1.0. And whenever I need to modify a metallic-smoothness map from Substance Painter I switch Photoshop to that Profile, open the texture, do my stuff and save it.
With the proof Settings under the view menu you gave me a new toy to play with, thx. :)

But now I wonder. Since the Unity Standart shader seems to assume sRGB textures (even for smoothness?) do I really need to go this extra mile at all? If I read correctly in the other thread you are not required to "Bypass sRGB sampling" for metallic-smoothness maps. Does that mean Unity expects them to be in Gamma space? Confusion.

Hi,

The easiest and less confusing method is to work in sRGB space. If you work in Photoshop without any profiles or linear gamma, the texture will be interpreted by the shader correctly. I would not recommend trying to work or author in linear space within photoshop.

Unity does expect these maps to be in gamma space and it knows it needs to make the corrections. You don't need to change "Bypass sRGB" as this really only pertains to the albedo map and the specular map (specular/gloss workflow). If you enabled this flag, it would not linearize the map (remove gamma curve), which would result in the sRGB gamma being applied twice. Once in the texture and once in the render view. So if you author in sRGB, then you don't need to worry about manually controlling the linear interpretation of the textures.

I think a good way to think about it is as follows: If a texture contains color then it needs to be interpreted as sRGB. This means it will be linearized by the shader for rendering. If the texture doesn't contain color such as metallic or roughness, then it needs to be interpreted as linear. Its more like its "assumed" to be in linear space. You technically authored roughness and metallic in sRGB, but the shader knows to interpret these values as data.

Here's how the shaders will interpret the maps:

Diffuse, base color, specular : sRGB
The shader will linearize these maps for computation i.e. remove gamma encoded values

Metal, roughness, ambient occlusion : linear
These maps are "interpreted" as linear. It means that the shader will not linearize them for computation. Basically, their value is read "as is."

I hope that helps : )

Cheers,

wes



Integrations Product Manager / Training
wes.mcdermott@allegorithmic.com
Twitter: The3DNinja

Now some implementation also use a grayscale "specular" map to specify the F0 value for dielectrics. In Designer it corresponds to the usage "SpecularLevel". It maps linearly F0 values from 0 (black) to 0.08 (white), the default value being 0.04 (mid-grey).

Quote from: PBR Guide Vol. 2 Page 15 (and Figure 25)
"the shader is mapped to a range of 0.0-0.08"

Hey. I'm trying to make sense of this. And it makes sense in the metal/roughness workflow, it even corresponds with UE4 where the default value for the additional specular slot is 0.5 (mid-grey), if I'm not mistaken.

However, the second quote is from the specular/gloss section of the guide. So what exactly would that quote mean in this context? If specular value of 1 maps to 0.08, creating metals wouldn't be possible in the spec/gloss workflow. I must be missing something. Thanks :)

Guys, Figure 09 is missing! Also, the last paragraph on page 10 is repeated on page 11.

Awesome guide anyways :)

Hey Wes, if you corrected this, then someone must've accidentally re-uploaded the old version when you were switching servers or something, cause it's still there.

Anyway, thanks for the guide and all the other stuff you do here and on YouTube - it's extremely helpful.
Last Edit: June 05, 2016, 09:49:43 pm

Now some implementation also use a grayscale "specular" map to specify the F0 value for dielectrics. In Designer it corresponds to the usage "SpecularLevel". It maps linearly F0 values from 0 (black) to 0.08 (white), the default value being 0.04 (mid-grey).

Quote from: PBR Guide Vol. 2 Page 15 (and Figure 25)
"the shader is mapped to a range of 0.0-0.08"

Hey. I'm trying to make sense of this. And it makes sense in the metal/roughness workflow, it even corresponds with UE4 where the default value for the additional specular slot is 0.5 (mid-grey), if I'm not mistaken.

However, the second quote is from the specular/gloss section of the guide. So what exactly would that quote mean in this context? If specular value of 1 maps to 0.08, creating metals wouldn't be possible in the spec/gloss workflow. I must be missing something. Thanks :)

Guys, Figure 09 is missing! Also, the last paragraph on page 10 is repeated on page 11.

Awesome guide anyways :)

Hey Wes, if you corrected this, then someone must've accidentally re-uploaded the old version when you were switching servers or something, cause it's still there.

Anyway, thanks for the guide and all the other stuff you do here and on YouTube - it's extremely helpful.


Hi,

I fixed the errors. Thanks for pointing them out : ) We'll have it updated ASAP on the website.

For the shader map range, it maps the 0.0 - 0.08 to 0.0 - 1.0. This is only for dielectric (non-metals) in the metal/rough workflow. The shader doesn't have this for the specular workflow.

The dielectric reflectance value is handled the same way for both metal and specular workflows. Meaning that 0.04 (4%) is used for common dielectrics. In the metalness workflow, this is hardcoded in the shader. However, you can override the 4% value using the specularLevel. However, with specular map, you can author any value in the map as dielectric. So there isn't an override option as you can do this in the map itself. Both workflows should adhere to the ranges mentioned in the guide for dielectrics. The metal worfkflow enforces this whereas the spec workflow doesn't. This range doesn't affect the values for metals at all.

Cheers,
Wes

 
Integrations Product Manager / Training
wes.mcdermott@allegorithmic.com
Twitter: The3DNinja

This is all clear, thanks. But now I'm even more positive that there's a mistake in volume 2 of the guide, page 15 (this is the Specular/Glossiness Workflow part of the guide):

Quote from: PBR Guide Vol. 2 Page 15 (and Figure 25)
If you can't find an IOR value for a specific material, you can use 4% (0.04 - plastic). Gemstones are an exception and they have a range of 0.05-0.17 (linear) as was shown in figure 21. The shader is mapped to a range of 0.0-0.08 (linear), as zero is needed to represent air.
Last Edit: June 06, 2016, 11:20:59 pm

This is all clear, thanks. But now I'm even more positive that there's a mistake in volume 2 of the guide, page 15 (this is the Specular/Glossiness Workflow part of the guide):

Quote from: PBR Guide Vol. 2 Page 15 (and Figure 25)
If you can't find an IOR value for a specific material, you can use 4% (0.04 - plastic). Gemstones are an exception and they have a range of 0.05-0.17 (linear) as was shown in figure 21. The shader is mapped to a range of 0.0-0.08 (linear), as zero is needed to represent air.

Ah, I see what you mean. That section from the guide in the quote above is talking about dielectric materials, however, I didn't indicate the remapping of the shader only takes place for the metallic workflow. I mentioned in the metal workflow section, but it should be clarified in the spec workflow section as well as it's confusing currently. 

The values for dielectrics is the same for both metal and specular workflows. The shader remaps this range in the metal workflow if you are supplying a specular level map input only to override the hardcoded 4% value. However, with specular workflow, you don't have this. It's not part of the specular workflow. You author the dielectric value in the spec map along with the metal value. I'll add a sentence to clarify this in the guide. Thanks for the feedback : )

Cheers,
Wes
Last Edit: June 07, 2016, 03:51:53 pm
Integrations Product Manager / Training
wes.mcdermott@allegorithmic.com
Twitter: The3DNinja

Wes, I think the part which is wrong in this context is the one rosenand set in bold in his quote, i.e. the claim that the shader remaps the 0-1 range to 0-0.08, which is only true for the specularLevel channel in the "metallic" workflow, but not for the specular channel in the "Spec-Gloss" workflow.

Last Edit: June 07, 2016, 03:23:15 pm

Wes, I think the part which is wrong in this context is the one rosenand set in bold in his quote, i.e. the claim that the shader remaps the 0-1 range to 0-0.08, which is only true for the specularLevel channel in the "metallic" workflow, but not for the specular channel in the "Spec-Gloss" workflow.

 In the guide, this section is only talking about dielectric, but doesn't specifically state this remapping is only for metal workflow with the specularLevel. I will add a sentence to clarify that.
Integrations Product Manager / Training
wes.mcdermott@allegorithmic.com
Twitter: The3DNinja

Is the printed version of the 2018 version going to be for sale publicly?

Hello!

I've got some noob questions here. I did understand that no dark values for the albedo/diffuse maps should go below the 30 - 50 sRGB color range. And that no bright values for dielectric materials should go above 240 sRGB .

However, how exactly do I set this up in Substance Painter? Because when I open up the base color window and pick a color, all the color values (both RGB and HSV) are shown in a 0.0 - 1.0 range. So, how can I "convert" those "0.0 - 1.0" values to a "0 - 255" value?

Moreover, when the document states that, regarding dielectric materials, no values should go above 240 sRGB in the base color map, this means that none of the color channels (R, G or B) should exceed 240, right?

And for the sake of curiosity: is it safe to infer that the roughness map in the Metal/Roughness workflow is an inverted version of the glossiness map in the Specular/Glossiness workflow, and vice versa? Or is there anything I am missing?

Is the printed version of the 2018 version going to be for sale publicly?

Yes! We will be selling in on Amazon. It is currently on www.amazon.co.uk and coming to the US store soon.

https://www.amazon.co.uk/PBR-Guide-Handbook-Physically-Rendering/dp/2490071009/ref=sr_1_1?ie=UTF8&qid=1529005935&sr=8-1&keywords=pbr+guide

Cheers,
Wes
Integrations Product Manager / Training
wes.mcdermott@allegorithmic.com
Twitter: The3DNinja

Hello!

I've got some noob questions here. I did understand that no dark values for the albedo/diffuse maps should go below the 30 - 50 sRGB color range. And that no bright values for dielectric materials should go above 240 sRGB .

However, how exactly do I set this up in Substance Painter? Because when I open up the base color window and pick a color, all the color values (both RGB and HSV) are shown in a 0.0 - 1.0 range. So, how can I "convert" those "0.0 - 1.0" values to a "0 - 255" value?

Moreover, when the document states that, regarding dielectric materials, no values should go above 240 sRGB in the base color map, this means that none of the color channels (R, G or B) should exceed 240, right?

And for the sake of curiosity: is it safe to infer that the roughness map in the Metal/Roughness workflow is an inverted version of the glossiness map in the Specular/Glossiness workflow, and vice versa? Or is there anything I am missing?

Hi,

However, how exactly do I set this up in Substance Painter? Because when I open up the base color window and pick a color, all the color values (both RGB and HSV) are shown in a 0.0 - 1.0 range. So, how can I "convert" those "0.0 - 1.0" values to a "0 - 255" value?

With Painter this is more complicated than it needs to be. We will be working on the color picker. Currently the numeric values are in floating point linear space. So you have to convert to sRGB and then convert to integer.

The conversion from linear to sRGB
x ^ 0.4545 = y
y * 255 = 59

R .064 G .003 B .003

Example for computing the Red channel: 
0.064 ^ 0.4545 = 0.29
0.29 * 255 = 74

The Red is 74 (sRGB).

You can use the pbr validate filter which is much easier : ) https://share.allegorithmic.com/libraries/824.
1. Import the sbsar to your filters in the shelf.
2. Apply the filter to the layer you need to check the color and choose Albedo for the mode.

Moreover, when the document states that, regarding dielectric materials, no values should go above 240 sRGB in the base color map, this means that none of the color channels (R, G or B) should exceed 240, right?

That is correct.

And for the sake of curiosity: is it safe to infer that the roughness map in the Metal/Roughness workflow is an inverted version of the glossiness map in the Specular/Glossiness workflow, and vice versa? Or is there anything I am missing?

Yes, the gloss map is just the invert of the roughness map.

Cheers,
wes





Last Edit: June 14, 2018, 10:11:57 pm
Integrations Product Manager / Training
wes.mcdermott@allegorithmic.com
Twitter: The3DNinja