The whole thing about sRGB and converting to linear sort of flew over my head a bit. Is this something that comes from high-end rendering? also, there was mention of a link with some way to convert the values, but i don't see it.
after a bit of reading i think it's to un-gamma correct the textures.. .is this correct?
Textures that are authored in Photoshop or rendered out from a 3d package are generally in sRGB (gamma-space).
All colour math inside shaders is done in linear-space. This means that any sRGB textures need to be converted to Linear before they can be used in the shader (the conversion is done IN the shader when it reads the texture though, so don't sweat it - saving your textures in sRGB is totally fine). The final results of the shader need to be converted to sRGB (gamma-space) at the end of the shading so that it can be displayed correctly.
Converting between Linear and sRGB is just a math transform that you can find on wikipedia (although granted it's a bit complex to decipher).
I don't have the link to hand, but CrazyButcher has a little webpage converter tool on it that EarthQuake has linked to in the past. I want to stress that you shouldn't need to worry about gamma correction unless you really know what you're doing with it though.
Most of the time I see artists asking about gamma correction and gamma conversion, it's because they think it's the solution to a problem they have - more often than not gamma isn't the solution to their problem and something else is wrong instead.
The way I deal with linear to srgb is by prototyping my spec and gloss in Marmoset. After I have what I like I just use the Hue/ Saturation/ Brightness control on the color picker in Photoshop to get the linear value correct. So for .8 gloss in Marmoset I simply paint down 80% brightness and my values will be correct. The benefit for me there is that I don't have to get confused by the rgb values. Here is the area in the color picker I am talking about:
If the Linear to sRGB converstion was a linear lookup, that would work. It isn't though, it's a curve, so what you're doing is inaccurate and incorrect.
This should help illustrate the problem.
What the math transforms do is apply a specific curve to your image, one curve to go Linear to sRGB, the opposite curve to go sRGB to Linear:
I mean, applying a curve like this in photoshop would work but you'd have to make sure it was *exactly* the correct curve otherwise you'd introduce artifacts:
I see. So is there a way to get linear values with out having to do the math every time you need to convert? Also how much does the conversion need to be exact? The stuff I have been making looks how I want it to. So am I making stuff that is going to look wrong in certain conditions or is the margin of error acceptable?
I guess my question overall is how much should I be concerned about this as an artist and if I should be concerned what steps should I take to have accurate values?
It depends what you're using the values for. If it's reflectivity values for PBR specular then it's probably best to use the correct linear values as your reference as using correct measured data is one of the cornerstones of any physically based system.
Ok. I always look up real world values as a base for specular and then I go from there. For the most part as long as I am referencing accurate values for specular the rest of it I really shouldn't worry about correct?
I got a really dumb/beginner question. At the point when you have all your maps ready to go and you are going to be rendering in Toolbag 2, do you have to do anything in particular besides plug the maps on the correct slots in marmo?
i.e: in substance painter, you have the options of selecting from a drop down the PBR lighting system.
Yeah, with the metalness workflow, the albedo map is both the diffuse and specular map in a way.
For metalic surfaces (white in the metalness map) the specular intensity and color comes from the albedo map, and the diffuse color is set to black (because pure metals reflect nearly all the light that hits them and absorb/scatter very little).
For non metal surfaces (black in the metalness map), the specular intensity is locked to a fixed value (about 0.04) as most non metals reflectivity is in a very narrow range. The albedo sets the diffuse color in this case like traditional shaders do.
So if, for example, I set my Metalness to black in UE4, you say that the reflectivity is set to about 0.04 since the reflectivity of non-metals is in a very narrow range. So in that case, why are we seeing Metalness, Albedo, and Reflectivity values in PBR charts like this one?
Same goes for a Metal surface. If Metalness is set to 1, the albedo levels clearly have values here in this chart, and aren't black, as you said.
So if, for example, I set my Metalness to black in UE4, you say that the reflectivity is set to about 0.04 since the reflectivity of non-metals is in a very narrow range. So in that case, why are we seeing Metalness, Albedo, and Reflectivity values in PBR charts like this one?
Same goes for a Metal surface. If Metalness is set to 1, the albedo levels clearly have values here in this chart, and aren't black, as you said.
Because that stands for:
Albedo = Diffuse
Microsurface = Roughness/Gloss
Reflectivity = Spec
None of that data even mentions metalness. You assumed because there was an "M" it meant metalness.
There are two distinct workflows. One is the reflectivty/spec workflow which is nearly the same as last gen in terms of what the maps do ( authoring them is different). The other is metalness which is explained well here http://www.polycount.com/forum/showthread.php?t=134475.
Because that stands for:
Albedo = Diffuse
Microsurface = Roughness/Gloss
Reflectivity = Spec
None of that data even mentions metalness. You assumed because there was an "M" it meant metalness.
No, I didn't assume the M meant metalness. What I did assume was that the chart I linked was for a metalness workflow. Clearly I'm mistaken, and that is what was confusing the hell out of me.
Oh my bad I see what you are saying. There is variance in reflectivity, however it's not significant enough for it to be a big deal hence the standardized number. Also there is question over the accuracy of that chart becuase there shouldn't be any color in the reflectance of the non metals as well. If you want accuracy take a look at this chart here http://seblagarde.wordpress.com/2012/04/30/dontnod-specular-and-glossiness-chart/
No, I didn't assume the M meant metalness. What I did assume was that the chart I linked was for a metalness workflow. Clearly I'm mistaken, and that is what was confusing the hell out of me.
For the chart, the scan data is setup for a specular map workflow. However, you can use some basic logic to make it work with a metalness workflow as well.
Q: Is it metal?
Y: Take the reflectance value and throw it in the albedo, set the metalness value to 1
N: Take the aledo value and throw it in the albedo, set the metalness value to 0 (ignore the reflectivity value)
sorry if this question has asked before.
I want to ask about the grayscale value on Metalness map. How the shader will deal with it ? (especially TB2 and UE4).
is it Metal? with black diffuse and reflectivity is pulled from the albedo map ? or it'll treat as non-metallics ?
Values other than 0 or 1 will be treated as partially metallic. What this is means is that depending on the value, lets say a value of 0.5, the shader will pull the diffuse and reflectivity from the albedo map, and only darken the albedo map half way.
Generally, this isn't something you'll want to do very often, usually only for transitioning effects (fuzzy edges etc).
Q: Is it metal? Y: Take the reflectance value and throw it in the albedo, set the metalness value to 1
N: Take the aledo value and throw it in the albedo, set the metalness value to 0 (ignore the reflectivity value)
I'm confused.
-If take reflectance value and throw it in the albedo, then how can I change the color? (photoshop)
-How can I set the reflectance value above a texture albedo? (example: wood or metal texture).
I'm confused.
-If take reflectance value and throw it in the albedo, then how can I change the color? (photoshop)
The reflectance value can mean both color and intensity, and the albedo map is a full color map, so for colored metals like gold or brass, you set the color in the albedo map.
-How can I set the reflectance value above a texture albedo? (example: wood or metal texture).
Wood is not a metal, so you don't need to set the reflectance value, it will get a value of 4% with most metalness shaders. You would set the metalness value to zero(black) for wood as it is not a metal.
The reflectance value can mean both color and intensity, and the albedo map is a full color map, so for colored metals like gold or brass, you set the color in the albedo map.
thanks for reply.
Example 1(metal): If you want a cube mid-iron and aluminum
-metalness map: all white
-albedo map: how can I split the metals?
-glossmap: as you please
What do you mean split the metals? I think you're overcomplicating it. In this case, your albedo for the metallic areas is exactly like a traditional spec map. For the albedo map, you create the differences in the two metals directly in the albedo texture. Nothing difficult or complicated about it.
With the metalness workflow since specular values are already sorted, for an object like wood, does this mean the albedo and gloss values can be anything? Or do albedo values still have to be a referenced value. I ask this because there are many kinds of dark woods.
I work with Unity and usually things look great in all lighting conditions in marmo, but then suddenly once its in Unity with PBR the textures are way too bright or sometimes too dark. I assume that is because my albedo values still need to be referenced?
Yeah albedo should still be referenced, look at the Unity PBR charts, and make sure you are working in the right color space (sRGB vs linear). Albedo isn't as much of a hard rule set as reflectance values and reflectance colors for mimicking metals, but it's easier to start with reality and then start picking your own values. Especially when you are doing things on the very light or very dark ends, like white paint vs snow vs white plastic.
For the most part, diffuse/albedo and gloss/roughness maps simply vary. Yeah, there will be reasonable ranges for most material types, like you would be unlikely to find natural wood that is 0,0,0 or 255,255,255, or to find charcoal brickets that are 100% smooth/glossy.
You can't find reflectance values for every surface type, so you're going to have to use your better judgement here. Wood isn't a specific material, but rather a huge family of materials types. There is no "correct" albedo or roughness for "wood", as wood has such a huge variance. If you can find measured values from a similar material, you can use some logic to come up with sane values, like unfinished walnut would tend to be darker than unfinished pine, and varnished wood would be smoother than unfinished wood.
In a PBR engine does applying specular maps make it work in legacy manner or does it have some new characteristics? I see in UE4 there is a node for specular and specular power maps.
I can just answer this one now since they probably won't answer it. UE4, and really any Metal Roughness enviroments specular input has absolutely nothing to do with a legacy specular map. It is by default a value of .5 on any material and it shojld really stay there most of the time. Theres a formula for converting the IOR of a materials specular responce to specular level, and that value is almost always .5 or very very close to it. Specular level is completely irrelevant to anythin with a metallic value of 1. Liquids should have specular values other than .5 and rare materials such as vantablack should have specular values of 0. Human skin pours should be made into a cavity and combined with sone other specularlevel values for increased realism. The 4.20 human face documentation has some excellent information on this. But your average material should have an empty specular input in UE4, and you should be working in roughness and metal values.
TL;DR Metal/rough PBR specular inputs do not have anything to do with old specular inputs, default and usually should remain at .5 and are reserved for cavity maps and rare use cases. Plugging specular maps from megascans into UE4 materials is a bad idea and does look good.
Replies
Basic summary:
Textures that are authored in Photoshop or rendered out from a 3d package are generally in sRGB (gamma-space).
All colour math inside shaders is done in linear-space. This means that any sRGB textures need to be converted to Linear before they can be used in the shader (the conversion is done IN the shader when it reads the texture though, so don't sweat it - saving your textures in sRGB is totally fine). The final results of the shader need to be converted to sRGB (gamma-space) at the end of the shading so that it can be displayed correctly.
Converting between Linear and sRGB is just a math transform that you can find on wikipedia (although granted it's a bit complex to decipher).
I don't have the link to hand, but CrazyButcher has a little webpage converter tool on it that EarthQuake has linked to in the past. I want to stress that you shouldn't need to worry about gamma correction unless you really know what you're doing with it though.
Most of the time I see artists asking about gamma correction and gamma conversion, it's because they think it's the solution to a problem they have - more often than not gamma isn't the solution to their problem and something else is wrong instead.
This should help illustrate the problem.
What the math transforms do is apply a specific curve to your image, one curve to go Linear to sRGB, the opposite curve to go sRGB to Linear:
I mean, applying a curve like this in photoshop would work but you'd have to make sure it was *exactly* the correct curve otherwise you'd introduce artifacts:
I guess my question overall is how much should I be concerned about this as an artist and if I should be concerned what steps should I take to have accurate values?
i.e: in substance painter, you have the options of selecting from a drop down the PBR lighting system.
So if, for example, I set my Metalness to black in UE4, you say that the reflectivity is set to about 0.04 since the reflectivity of non-metals is in a very narrow range. So in that case, why are we seeing Metalness, Albedo, and Reflectivity values in PBR charts like this one?
Same goes for a Metal surface. If Metalness is set to 1, the albedo levels clearly have values here in this chart, and aren't black, as you said.
Because that stands for:
Albedo = Diffuse
Microsurface = Roughness/Gloss
Reflectivity = Spec
None of that data even mentions metalness. You assumed because there was an "M" it meant metalness.
There are two distinct workflows. One is the reflectivty/spec workflow which is nearly the same as last gen in terms of what the maps do ( authoring them is different). The other is metalness which is explained well here http://www.polycount.com/forum/showthread.php?t=134475.
No, I didn't assume the M meant metalness. What I did assume was that the chart I linked was for a metalness workflow. Clearly I'm mistaken, and that is what was confusing the hell out of me.
The chart is from a tutorial I wrote: http://www.marmoset.co/toolbag/learn/pbr-practice It covers PBR in general, and goes over both the metalness and specular map workflows.
For the chart, the scan data is setup for a specular map workflow. However, you can use some basic logic to make it work with a metalness workflow as well.
Q: Is it metal?
Y: Take the reflectance value and throw it in the albedo, set the metalness value to 1
N: Take the aledo value and throw it in the albedo, set the metalness value to 0 (ignore the reflectivity value)
I want to ask about the grayscale value on Metalness map. How the shader will deal with it ? (especially TB2 and UE4).
is it Metal? with black diffuse and reflectivity is pulled from the albedo map ? or it'll treat as non-metallics ?
Generally, this isn't something you'll want to do very often, usually only for transitioning effects (fuzzy edges etc).
I'm confused.
-If take reflectance value and throw it in the albedo, then how can I change the color? (photoshop)
-How can I set the reflectance value above a texture albedo? (example: wood or metal texture).
The reflectance value can mean both color and intensity, and the albedo map is a full color map, so for colored metals like gold or brass, you set the color in the albedo map.
Wood is not a metal, so you don't need to set the reflectance value, it will get a value of 4% with most metalness shaders. You would set the metalness value to zero(black) for wood as it is not a metal.
For metal, see first point.
thanks for reply.
Example 1(metal): If you want a cube mid-iron and aluminum
-metalness map: all white
-albedo map: how can I split the metals?
-glossmap: as you please
example2 (non-metal): a cube half wood and plastic
-metalness map: all black
-albedo map: wood with the texture (without AO) and the plastic?
this link can help me? how?
https://www.fxguide.com/wp-content/uploads/2013/06/Albedo_values.jpg
http://i.imgur.com/k9jKjiW.png
-glossmap: as you please
Thanks
What do you mean split the metals? I think you're overcomplicating it. In this case, your albedo for the metallic areas is exactly like a traditional spec map. For the albedo map, you create the differences in the two metals directly in the albedo texture. Nothing difficult or complicated about it.
I work with Unity and usually things look great in all lighting conditions in marmo, but then suddenly once its in Unity with PBR the textures are way too bright or sometimes too dark. I assume that is because my albedo values still need to be referenced?
You can't find reflectance values for every surface type, so you're going to have to use your better judgement here. Wood isn't a specific material, but rather a huge family of materials types. There is no "correct" albedo or roughness for "wood", as wood has such a huge variance. If you can find measured values from a similar material, you can use some logic to come up with sane values, like unfinished walnut would tend to be darker than unfinished pine, and varnished wood would be smoother than unfinished wood.
https://www.artsfon.com/games/
https://www.artsfon.com/games/
TL;DR Metal/rough PBR specular inputs do not have anything to do with old specular inputs, default and usually should remain at .5 and are reserved for cavity maps and rare use cases. Plugging specular maps from megascans into UE4 materials is a bad idea and does look good.