Author Topic: Linear Workflow with Substance  (Read 43000 times)

Hey Guys,

I've been running into some "problems" when trying to adapt a Linear Workflow (LWF) into my own pipeline.
What I want: I want to create Linear images during the whole creation progress. Substance Designer is a good-to-go-choice, because I can switch the view between linear and RGB during runtime instantly.
Substance Painter has no ability to do that, but I can switch the outputs from sRGB8 to RGBx (in my example: RGB16).
At the far end of my pipeline I want the Engine to apply that Gamma. In my case: UE4.
In the Engine there is a button with which I can tell the engine either the image is Linear or not.

Now here is the description of my "problem":

When viewing all my test-outputs in photoshop, applying the desired color Profile, I get a result like the attached "Gamma_vs_Linear.png".
On all Gamma-Outputs I attached the standard sRGB color Profile.
On all Linear outputs I attached my own Linear sRGB color Profile.

The files on my Mac (in Finder, like explorer in Windows) are looking like the attached image "Gamma_on_Mac". I thought the linear Images should be shown wrong, because of the Gamma-interference. But it could be that the Monitor Gamma of 2.2 is applied so the Linear_Designer-Image is looking like the others.
If I am wrong until here, please correct me!

But it seems that Substance Painter does not export Linear Gamma Images correctly. The Image in the Finder (Explorer on windows) is looking way too dark (shouldn't it be brighter?) and if I open the Image and applying a Linear color profile it looks like it would be non-linear (Gamma_vs_Linear.png).

In the Engine I see the same result. (LWF_UE4 attachment).

Why I want to be linear: I want to have a correct lighting and I want to make sure all my values are correct and PBR ready (50% Gray is not always 50% Gray: http://filmicgames.com/archives/299)

Is there a better way to work with the approach of being linear? What are your experiences? Have you got any tips for me? How are you going to handle this?

I would appreciate it to read some replies ;)

Thanks!
Environment Artist - Twitter

Hey Guys,

I've been running into some "problems" when trying to adapt a Linear Workflow (LWF) into my own pipeline.
What I want: I want to create Linear images during the whole creation progress. Substance Designer is a good-to-go-choice, because I can switch the view between linear and RGB during runtime instantly.
Substance Painter has no ability to do that, but I can switch the outputs from sRGB8 to RGBx (in my example: RGB16).
At the far end of my pipeline I want the Engine to apply that Gamma. In my case: UE4.
In the Engine there is a button with which I can tell the engine either the image is Linear or not.

Now here is the description of my "problem":

When viewing all my test-outputs in photoshop, applying the desired color Profile, I get a result like the attached "Gamma_vs_Linear.png".
On all Gamma-Outputs I attached the standard sRGB color Profile.
On all Linear outputs I attached my own Linear sRGB color Profile.

The files on my Mac (in Finder, like explorer in Windows) are looking like the attached image "Gamma_on_Mac". I thought the linear Images should be shown wrong, because of the Gamma-interference. But it could be that the Monitor Gamma of 2.2 is applied so the Linear_Designer-Image is looking like the others.
If I am wrong until here, please correct me!

But it seems that Substance Painter does not export Linear Gamma Images correctly. The Image in the Finder (Explorer on windows) is looking way too dark (shouldn't it be brighter?) and if I open the Image and applying a Linear color profile it looks like it would be non-linear (Gamma_vs_Linear.png).

In the Engine I see the same result. (LWF_UE4 attachment).

Why I want to be linear: I want to have a correct lighting and I want to make sure all my values are correct and PBR ready (50% Gray is not always 50% Gray: http://filmicgames.com/archives/299)

Is there a better way to work with the approach of being linear? What are your experiences? Have you got any tips for me? How are you going to handle this?

I would appreciate it to read some replies ;)

Thanks!

HI Fabian,

In SP painter, the viewport is showing all maps as sRGB for display, so this can cause a lot of confusion. I think we may add a switch so that linear maps can be displayed as linear in the viewport.  The base color is exported as sRGB and maps such as roughness are exported as linear. Basically, any channels that are set as linear in the document settings are exported as linear. 

In the engine, you need to set the profile for the images for the rendering to be correct. Just exporting the images in the correct space is not enough. The engine needs to know how to interpret the images. For example with UE4, in the texture editor, all maps are set to sRGB. For the base color, you need to leave sRGB checked. For the roughness and metallic, you need to uncheck sRGB so these maps will be interpreted as linear. The data is stored as linear in the maps, but UE4 still needs to know to interpret them as linear.

For your workflow, you only need to set the linear maps to be interpreted as linear and base color (gamma-encoded) enabled as sRGB. From there, UE4 will know how to interpret the maps for linear calculation.

Base Color = sRGB checked (converted to linear by engine)
Roughness = sRGB uncheck (computed as linear)
Metallic = sRGB uncheck (computed as linear)

If you apply a gamma of 2.2 to the base color, it will result in a washed out image. The base color already has gamma-encoded values. If a gamma is applied on top of that, you will essentially be adding double the gamma. In UE4, with sRGB checked, the gamma is removed by applying the inverse gamma. In your image, it looks like a double-gamma is being applied to the base color.

For roughness and metal, they are in linear space on export. No gamma operation should be applied to them. Their gamma is 1.0 or linear. By unchecking sRGB, UE4 knows to not remove any gamma and treat these images as linear.

In the second image, you can see the exported roughness map (image on left) is "darker" than what is shown in the SP viewport (image on right). The exported map is in linear and correct while the display in the 2D view is showing the roughness as sRGB which is incorrect.

Cheers,

Wes











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

Thank you Wes, as always ;)

But I thought Linear images should be lighter than Gamma corrected (2.2) images.
I'm quite confused why both exported Linear images (from SP & SD) appear different. The image from Substance Designer is lighter and has the behaviour I think which is right for Linear images. The Substance Painter image, however, appears like a standard sRGB image with a Gamma 2.2 applied.

I don't know if it is useful to make my Albedo maps Linear, instead of leaving them Gamma corrected, like you said, Wes.
I really want to understand this Gamma correction and the Linear Workflow, but it is confusing how the exported images appear to be different, even outside the engine.
Environment Artist - Twitter

Thank you Wes, as always ;)

But I thought Linear images should be lighter than Gamma corrected (2.2) images.
I'm quite confused why both exported Linear images (from SP & SD) appear different. The image from Substance Designer is lighter and has the behaviour I think which is right for Linear images. The Substance Painter image, however, appears like a standard sRGB image with a Gamma 2.2 applied.

I don't know if it is useful to make my Albedo maps Linear, instead of leaving them Gamma corrected, like you said, Wes.
I really want to understand this Gamma correction and the Linear Workflow, but it is confusing how the exported images appear to be different, even outside the engine.

Hi Fabian,

Very happy to help : )

The linear images will always be darker. They have a gamma value of 1.0. Gamma-encoded sRGB images have a value of 2.2. In the image I posted above, you can see a base color with linear gamma (appears darker) and sRGB which appears normal. Our eyes have a logarithmic response (non-linear) and thus computer displays are calibrated to adjust for this. So images that are meant to be displayed such as base color are gamma corrected to sRGB space. Images there are not displayed on the screen, but are used for rendering calculation such as roughness are calculated in linear (gamma 1.0).

Mathematically, all of the maps are processed in linear space in the rendering process. The result is corrected to sRGB space for us to view on our monitors. It works like this..

Input
1. If maps are in sRGB space, then the gamma-encoded value (2.2) must be removed by applying an inverse gamma of 0.4545. The gamma encoded value of sRGB space is removed for rendering calculations.
2. If map is meant to represent surface attribute values such as roughness, then it is interpreted as linear and gamma is kept at 1.0.

Rendering calculation happens in linear space......

Output
1. The resulting rendered image is gamma-corrected for display and a 2.2 gamma applied

I think there is a bug with the sRGB switch in SD 2D viewport. With sRGB on, it should look correct. With sRGB off, it should look darker. I am checking with the devs. However, this switch is just for display only. It should be left at sRGB on.

I am thinking that it just doesn't show linear data correctly similar to how SP is showing linear maps in the channel view as sRGB. However, it doesn't really matter in terms of rendering. It's just display.

The key is that you don't need to worry about seeing the linear value. As long as the maps are interpreted correctly by the renderer, it will be fine. All you need to know is that base color or Diffuse is sRGB (gamma 2.2 needs to be removed) and everything else is linear. Basically, any color values that are displayed in the final render are sRGB and any maps used for lighting calculation is linear. So if you have emissive color. The color is sRGB and the intensity is linear.

Cheers,

Wes

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

You deserve a big THANK YOU, Wes, I greatly appreciate your explanation about this topic.
However, there are still misunderstandings/questions left. Based on the following 2 Website-Links, I understand that Linear images should be Lighter than Gamma 2.2 ones... You said that it is the other way (Gamma is Lighter than Linear).
http://filmicgames.com/archives/299
http://ninedegreesbelow.com/photography/linear-gamma-blur-normal-blend.html

Did I understand the website wrong, or your explanation?

The second link is also quite interesting, because of the Calculation of Opacity and Blending modes behind the scenes in software packages like Photoshop.
I also tried it out myself and got the same result:
sRGB (Gamma 2.2) images get this dark rim when painting with a falloff in photoshop. Linear Images with a Gamma of 1.0 applied have not this dark rim.

In Substance Painter I didn't get that dark rim, too. Does it mean that Photoshop handles Linear images a different way, does something wrong or did I do something wrong in the options?

When I open a Linear Photoshop Document it is lighter than a standard sRGB image.

Sorry when I am a bit annoying (:P) but I am really interested in this topic and I want to get this right and understand it.

All Substance Software Packages are designed like you told me: The Albedo colors are sRGB, the grayscale images are Linear.
Based on the Articles/Websites I posted in this post earlier, I would try to get a linear Albedo, too, like I explained in the opening post of this thread.
Did I get something wrong or does the Albedo color only change so slightly no one would ever notice? Does it change, anyway?

At the moment I try to understand the Pros and Cons of being linear within the Albedo colors. I think I understood why I have to be Linear in the grayscale images (Roughness, Metallic, etc.) but I will still try out some setups with different roughness and Metallic values just to see the difference of being linear or not.
The Albedo maps are just curious... I didnt get that quite well for now...
Environment Artist - Twitter

You deserve a big THANK YOU, Wes, I greatly appreciate your explanation about this topic.
However, there are still misunderstandings/questions left. Based on the following 2 Website-Links, I understand that Linear images should be Lighter than Gamma 2.2 ones... You said that it is the other way (Gamma is Lighter than Linear).
http://filmicgames.com/archives/299
http://ninedegreesbelow.com/photography/linear-gamma-blur-normal-blend.html

Did I understand the website wrong, or your explanation?

The second link is also quite interesting, because of the Calculation of Opacity and Blending modes behind the scenes in software packages like Photoshop.
I also tried it out myself and got the same result:
sRGB (Gamma 2.2) images get this dark rim when painting with a falloff in photoshop. Linear Images with a Gamma of 1.0 applied have not this dark rim.

In Substance Painter I didn't get that dark rim, too. Does it mean that Photoshop handles Linear images a different way, does something wrong or did I do something wrong in the options?

When I open a Linear Photoshop Document it is lighter than a standard sRGB image.

Sorry when I am a bit annoying (:P) but I am really interested in this topic and I want to get this right and understand it.

All Substance Software Packages are designed like you told me: The Albedo colors are sRGB, the grayscale images are Linear.
Based on the Articles/Websites I posted in this post earlier, I would try to get a linear Albedo, too, like I explained in the opening post of this thread.
Did I get something wrong or does the Albedo color only change so slightly no one would ever notice? Does it change, anyway?

At the moment I try to understand the Pros and Cons of being linear within the Albedo colors. I think I understood why I have to be Linear in the grayscale images (Roughness, Metallic, etc.) but I will still try out some setups with different roughness and Metallic values just to see the difference of being linear or not.
The Albedo maps are just curious... I didnt get that quite well for now...

HI Fabian,

No problem at all : ) Happy to help.

I checked the web links. I think I see where the confusion is. The article on gamma correction is talking about gamma and the logarithmic response in our eyes and monitors (section on the gray value not being 128). I think they are referring to the final output image that has been processed correctly through a linear pipeline and gamma corrected. It can be confusing as they are showing a linear image as brighter than a 2.2 gamma image. The chart they are showing is pertaining to a final result. The actual linear image will be darker than an image with a gamma of 2.2.

If you render a scene without gamma-correction, the resulting image will actually be too dark when viewed in gamma-encoded space (2.2). The reason is that the calculations are always in linear space and our presented to us a linear image, but this looks too dark on our monitor with a gamma of (2.2) due to how the monitor displays value with a non-linear response. However, a linear-processed render will look brighter in color and shadow overall. However, the key is that the final image must also be gamma corrected for display and the sRGB inputs linearized. So with a linear render, any sRGB input such as color maps, photos must have their gamma-encoded (2.2) values removed. This is done as the article suggests. However, this resulting linear image will be darker than a normal image with a gamma of 2.2 at this point. A gamma of 0.4545 is lower than 2.2. You can test this by opening Photoshop and apply levels to an image. In the gamma, change it to 0.4545 to linearize the image. 

In the first attached image, you can see a render from modo. It has a sRGB image and rendered without a proper linear setup. It is darker viewing on my monitor which is gamma 2.2 space or video space. However, by setting the final output gamma to 2.2 and setting the sRGB brick image to linear (gamma of 0.4545) the image has now been processed correctly and the final image looks brighter. It's actually a more natural look. There reason is because all calculation was done in linear space and then the final render was corrected to a gamma of 2.2 for display. Substance is doing the same thing. 

In the second attached image, you can see a color value that was linearized for a render. The method to convert sRGB to linear is
(x / 255) ^ 2.2. So if you look look at an RGB color of 20, 88,152 the linear conversion would be...

(20 / 255) ^ 2.2 = 0.04 (linear floating point) : convert to integer (.04 * 255) = 10
(88 / 255) ^ 2.2 = 0.1 (linear floating point) :  convert to integer (.1 * 255) = 25
(152 / 255) ^ 2.2 = 0.32 (linear floating point) :  convert to integer (.32 * 255) = 81

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

The second article shows a great by-product of linear rendering. One of the core benefits is that the blending math will work correctly. That is why in a film pipeline, all compositing is done in linear floating point. Motion blur will look more realistic as well as light blending. You get a lot of realistic lighting effects essentially for free by just rendering and compositing in linear space.

Where you saying that you were having issues with Substance Painter and a dark line?

With photoshop, I think you may be having an issue where color management is changing the interpretation of the linear image.

Cheers,

wes

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

HI Fabian,

No problem at all : ) Happy to help.

I checked the web links. I think I see where the confusion is. The article on gamma correction is talking about gamma and the logarithmic response in our eyes and monitors (section on the gray value not being 128). I think they are referring to the final output image that has been processed correctly through a linear pipeline and gamma corrected. It can be confusing as they are showing a linear image as brighter than a 2.2 gamma image. The chart they are showing is pertaining to a final result. The actual linear image will be darker than an image with a gamma of 2.2.

If you render a scene without gamma-correction, the resulting image will actually be too dark when viewed in gamma-encoded space (2.2). The reason is that the calculations are always in linear space and our presented to us a linear image, but this looks too dark on our monitor with a gamma of (2.2) due to how the monitor displays value with a non-linear response. However, a linear-processed render will look brighter in color and shadow overall. However, the key is that the final image must also be gamma corrected for display and the sRGB inputs linearized. So with a linear render, any sRGB input such as color maps, photos must have their gamma-encoded (2.2) values removed. This is done as the article suggests. However, this resulting linear image will be darker than a normal image with a gamma of 2.2 at this point. A gamma of 0.4545 is lower than 2.2. You can test this by opening Photoshop and apply levels to an image. In the gamma, change it to 0.4545 to linearize the image. 

In the first attached image, you can see a render from modo. It has a sRGB image and rendered without a proper linear setup. It is darker viewing on my monitor which is gamma 2.2 space or video space. However, by setting the final output gamma to 2.2 and setting the sRGB brick image to linear (gamma of 0.4545) the image has now been processed correctly and the final image looks brighter. It's actually a more natural look. There reason is because all calculation was done in linear space and then the final render was corrected to a gamma of 2.2 for display. Substance is doing the same thing. 

In the second attached image, you can see a color value that was linearized for a render. The method to convert sRGB to linear is
(x / 255) ^ 2.2. So if you look look at an RGB color of 20, 88,152 the linear conversion would be...

(20 / 255) ^ 2.2 = 0.04 (linear floating point) : convert to integer (.04 * 255) = 10
(88 / 255) ^ 2.2 = 0.1 (linear floating point) :  convert to integer (.1 * 255) = 25
(152 / 255) ^ 2.2 = 0.32 (linear floating point) :  convert to integer (.32 * 255) = 81

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

The second article shows a great by-product of linear rendering. One of the core benefits is that the blending math will work correctly. That is why in a film pipeline, all compositing is done in linear floating point. Motion blur will look more realistic as well as light blending. You get a lot of realistic lighting effects essentially for free by just rendering and compositing in linear space.

Where you saying that you were having issues with Substance Painter and a dark line?

With photoshop, I think you may be having an issue where color management is changing the interpretation of the linear image.

Cheers,

wes

I understand that better and better! :D

I just tried it out in the software:
In Photoshop, when I paint in sRGB, I get this dark rim. When I paint in Linear mode, there are just clean colors without darkening effects.
In Substance painter I also get the better result -> Without dark rims. :)

But what I am still curious about: Why do the Substance packages (SP & SD) have standard sRGB outputs, when doing Linear is better with accurate colors?
If it has something to do with what is shown to the user and what calculation is done in the background, would a Linear Albedo color make sense, anyway?
I mean: In Substance I think (and what I think what you just told me) the calculation is done in Linear space, just the image I see is been shown in sRGB (2.2 Gamma). Because of that I have no dark rims etc. in Substance Painter and have no need to export my Albedo in Linear space, because it is made Linear by the software... am I right until now? ;)

But what does the second web-link I posted has to do with it? In combination with your example of how the Blue color is changing, I would assume to make all images Linear, also the Albedo. Because it is looking different. OR:
Does it look different because you picked up the exact same color (20,88,152) but one was calculated Linear, but is shown in sRGB?
I don't know how to say that, I hope you will understand... Are those both Blue solid surfaces both the same color, but the darker one is just Linear, without changing the color value directly?
In my eyes the difference between sRGB Blue and Linear Blue is quite big and i think I'm on the right way to understand this, but I am still a bit confused.. :/

EDIT: I just tried out if I could be right or not and calculated this with "ColorSync Utility" on the Mac (Built In).
Linear color has not the exact same Values but quite close. Just the Red channel has a "big" difference.

I am still very curious about the first Web-Link (http://filmicgames.com/archives/299)... Do I really have to pick this right Value (187 instead of 128), or does Substance doing it for me? ... The more I read about this topic the more I get confused :D
Last Edit: January 20, 2015, 01:39:01 pm
Environment Artist - Twitter

Hi Fabian,

Great : ) Yeah, it is definitely a complicated topic. I went through this same process as well. I really wanted to make sure I was understanding it correctly, so I'm very happy to help. 

But what I am still curious about: Why do the Substance packages (SP & SD) have standard sRGB outputs, when doing Linear is better with accurate colors?
If it has something to do with what is shown to the user and what calculation is done in the background, would a Linear Albedo color make sense, anyway?
I mean: In Substance I think (and what I think what you just told me) the calculation is done in Linear space, just the image I see is been shown in sRGB (2.2 Gamma). Because of that I have no dark rims etc. in Substance Painter and have no need to export my Albedo in Linear space, because it is made Linear by the software... am I right until now? ;)


You would never want to author albedo in linear space. In the shader, the albedo color is linearized in the shader. So even though the albedo is authored in sRGB, it is still calculated in linear space by the shader. The gamma-encoded values in the texture are removed for calculation. In Substance Designer and Painter, this is the default. You can tell the shader in SD not to do this, but that would not be a good workflow. If you tried to author the albedo in linear space, you would be choosing different values altogether. You would also then need to set the shader to not remove gamma.

You don't need to do anything to the albedo map. It is handled correctly and automatically for a linear workflow in Substance.

But what does the second web-link I posted has to do with it? In combination with your example of how the Blue color is changing, I would assume to make all images Linear, also the Albedo. Because it is looking different. OR:
Does it look different because you picked up the exact same color (20,88,152) but one was calculated Linear, but is shown in sRGB?
I don't know how to say that, I hope you will understand... Are those both Blue solid surfaces both the same color, but the darker one is just Linear, without changing the color value directly?
In my eyes the difference between sRGB Blue and Linear Blue is quite big and i think I'm on the right way to understand this, but I am still a bit confused.. :/

EDIT: I just tried out if I could be right or not and calculated this with "ColorSync Utility" on the Mac (Built In).
Linear color has not the exact same Values but quite close. Just the Red channel has a "big" difference.

I am still very curious about the first Web-Link (http://filmicgames.com/archives/299)... Do I really have to pick this right Value (187 instead of 128), or does Substance doing it for me? ... The more I read about this topic the more I get confused :D


In the color swatch example, I was illustrating that the value in linear space is darker. This is a good analogy for the question above. If you tried to author albedo in linear, you can see that you would be working with different values. So if you wanted a lighter blue, the values would be drastically different.

The linear value looks different (darker) because the gamma-encoded values from the color pick have been removed. This is what the first article was discussing. Monitors are not displaying values as linear. You don't need to worry about picking 187 instead of 128. Because of the scale that sRGB uses, 128 looks the mid value and in terms of authoring, that is what matters.  You just work with what you see : ) Our work is always done in sRGB space. Its only computed in linear and is then converted back to sRGB. In the color sync utility, it looks like it's correcting the swatch to be viewed in sRGB. That is why you see the same color value, but with different numbers.

You don't need to worry about authoring in linear space. Linear interpretation is done at the shader / engine level. It is not done in the authoring stage. This is handled automatically in Substance Designer and Painter. However, its vital to understand when maps will need to be interpreted as you may need to flag maps as linear or sRGB such as with UE4.

1. You author all maps in sRGB space. You don't need to worry about the values. This is the space we display images (monitors) and how our eyes see as well.

2. For correct rendering, calculation should be done in linear space. Linear data is interpreted at the shader / engine level.

Any maps that modulate the diffuse (albedo), basecolor (albedo), specular color should be interpreted as sRGB. They are authored in sRGB. However, the shader needs to know that they are sRGB as it will remove the gamma, converting them to linear space for computation.

Maps that modulate the light direction such as normal, height, roughness are to be interpreted as linear. Also, maps that store pure mathematical values for the texture such as ambient occlusion and metallic are to be interpreted as linear as well.

Color Maps = interpret as sRGB
Grayscale Maps = interpret as linear 

This is all handled automatically in substance, but if you wanted to export maps for UE4, you would need to make sure they are interpreted correctly. The maps would all be imported into UE4 as sRGB. In the texture editor, the sRGB flag is checked. However, for the metallic, roughness and AO, you would need to uncheck the sRGB flag. The normal map is interpreted correctly.

So it all really comes down to interpretation. We author in sRGB, shader computes in linear, we view render in sRGB. As long as the shader is interpreting the maps correctly, you will get the correct results. You don't need to worry about special values or anything like that.


Cheers,

Wes
 

 
Last Edit: January 20, 2015, 04:37:40 pm
Integrations Product Manager / Training
wes.mcdermott@allegorithmic.com
Twitter: The3DNinja

Wow, simply wow. There is a big chance that I finally understood it  8)
I will still test a few things out, just out of curiosity. Thumbs up, Wes, you did it.
And the best part of this thread: We have a good resource for other artists who have no idea about Gamma correction!

If there is still a question left, I know where I need to ask ;)
Environment Artist - Twitter

Wow, simply wow. There is a big chance that I finally understood it  8)
I will still test a few things out, just out of curiosity. Thumbs up, Wes, you did it.
And the best part of this thread: We have a good resource for other artists who have no idea about Gamma correction!

If there is still a question left, I know where I need to ask ;)

Great! That's awesome. Let me know if you have any questions.

Cheers,

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

A new question popped up!  :D
I know that sRGB images use more bits in the dark areas than in the white ones, because the human eye can determine differences in dark color tones better than in light tones.
That said, should I use 16 bit images instead of 8 bit images?

I read that some people recommend to use 16 bit, because then there is "no need" to make this bit-allocation anymore.
And why are some channels in Substance Painter L32F outputs and some just L8? There is no L16(F) output. Why is that? Are there benefits and/or drawbacks for L8/16/32?

I know that 32 bit images are always linear and when you use 32 bit images as a output you make sure it is linear, but: 16 bit would safe storage data and could be loaded faster, wouldn't it?
And are the outputs of SD & SP the same by default?
Environment Artist - Twitter

A new question popped up!  :D
I know that sRGB images use more bits in the dark areas than in the white ones, because the human eye can determine differences in dark color tones better than in light tones.
That said, should I use 16 bit images instead of 8 bit images?

I read that some people recommend to use 16 bit, because then there is "no need" to make this bit-allocation anymore.
And why are some channels in Substance Painter L32F outputs and some just L8? There is no L16(F) output. Why is that? Are there benefits and/or drawbacks for L8/16/32?

I know that 32 bit images are always linear and when you use 32 bit images as a output you make sure it is linear, but: 16 bit would safe storage data and could be loaded faster, wouldn't it?
And are the outputs of SD & SP the same by default?

Hi Fabian,

The option to work in 16 or 8 bit depends on what type of operations and you are going to perform on the image and the precision of the data needed. I asked Nicolas Wirrmann, one of the devs/tech artists and he provided some good examples. Some operations such as levels can damage the data i.e remove bits from the original image. Another example is multiply a color by a middle gray value cuts the bits in half and you wouldn't be able to recover the original color back using a level.

In Substance, you can work in 16 bit color using the GPU engine and switch when you need to. So you can make sure that you have more precision for specific operations.
I don't think working at 16 bit the entire time is an optimized solution. So you can work at 16 bit and then convert to 8 bit at different areas in the graph so you can work in the graph faster. Also, the exported maps can be more light-weight in terms of memory.     

And why are some channels in Substance Painter L32F outputs and some just L8? There is no L16(F) output. Why is that? Are there benefits and/or drawbacks for L8/16/32?

I know that 32 bit images are always linear and when you use 32 bit images as a output you make sure it is linear, but: 16 bit would safe storage data and could be loaded faster, wouldn't it?
And are the outputs of SD & SP the same by default?


Some channels are different depending on the data needed. For instance in Painter, height needs to be 32 bit float because you can paint positive and negative beyond the -1.0 to 1.0 range. With metallic, this is usually only binary data 0 or 1 so bit will work fine. Also the value will never go above 1.0 so no reason for 32 bit float at all.

You can export in 16 bit float in export dialog as well as set channels to be 16 bit float. If you export height, roughness, normal in 16 bit, it will be "assumed" linear. This means that these files will be flagged as linear in the shader. If you were to author a 16 bit base color, it would need to be sRGB. Base color, diffuse, specular color are never interpreted as linear no matter the bit depth.

The outputs for SD and SP are the same.

Cheers,

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

This helps a lot, Wes, as always. Thank you!
Now I only have to check out how to work only sometimes in 16 bit, as you mentioned. ;)
Do you have a simple example for working in 16 bit and convert to 8 bit "at different areas"?
You said I could work in the graph faster when using 8 bit instead of 16. How does it affect the graph? Is the difference so much?
Last Edit: January 27, 2015, 11:34:08 pm
Environment Artist - Twitter

Really enjoyed reading this informative conversation gents.  I thought I would post this really good video by zeth willie expalining Linear Color space http://vimeo.com/8119194

@Wes, for export to Alloy2 (Unity4) I pack four linear grayscale maps into a RGBA node for single output.  Will this RGBA output publish as sRGB or Linear?

Thanks.

You can export in 16 bit float in export dialog as well as set channels to be 16 bit float. If you export height, roughness, normal in 16 bit, it will be "assumed" linear. This means that these files will be flagged as linear in the shader. If you were to author a 16 bit base color, it would need to be sRGB. Base color, diffuse, specular color are never interpreted as linear no matter the bit depth.

The outputs for SD and SP are the same.

Cheers,

Wes

Hey Wes,

good read and very informative. But I do not understand the last part, that I quoted.
Who "assumes" 16bit or above images to be "linear"? Every shader/engine?

Normal maps, calculated in SD 4.6.1, are 24bit png (when you save them by hand in "png" format)

So maybe this could be the reason, why I should switch "sRGB" off in Toolbag2, when loading such a normal? (So it would be calculated as linear and displayed as sRGB)?
Like I wrot in e-mail yesterday, I get drastically different results when checking "Scale&Bias" in addition to "sRGB".

That brings me to the question, if it makes sense exporting normal maps and color maps higher than 8bit depth per channel? Sure, for heightmap/displacement you would set 16bit or even higher than that (as the are "greyscale maps" that "contains precise computation data")
But for albedo? Or even for a normal map?

Cheers!