Glad to hear that it works as expected now! 🙂
Anisoft đã viếtI assume the ability to force stuff to be linear or not is useful beyond just normals for if I have a linear texture I wanted copied over too (so maybe something like a emissive texture?, actually I'm not fully sure what its other uses could be)
Emissive textures are a pitfall here - they shall be declared as sRGB textures. This thread on the Allegorithmic forum (you know them from Substance Designer and Painter) summarizes it quite well:
https://forum.substance3d.com/index.php?topic=8745.0
Wes McDermott đã viếtThe simplest way to look at it is that if its color we see, then its to be treated as sRGB and the gamma needs to be removed. This is albedo, diffuse, base color, specular. [..] Yes, emissive should be sRGB. A good way to look at is like this...
If it's a color that you see then it's sRGB. Everything else is linear. Basecolor contains diffuse reflected color and metal reflectance values. Both represent light rays bouncing back and picked up by our eyes. Emissive is the same.
Hm, and Unity seems to expect Metallic
textures to have the sRGB
property checked (for whatever reason, maybe filtering as mentioned in the forum thread):
https://forum.unity.com/threads/metallic-map-linear-vs-gamma.425872/#post-2752018
One exception to the "if you see color, it's sRGB" rule is if it's .exr
or .hdr
files or other floating point formats, which will not be gamma-encoded, the content is already stored in linear space. I assume Unity will ignore the sRGB
property at these files anyway, so it should not become a problem.
Anisoft đã viếtTbh I'm not really sure what the usage of checking stuff not to be srgb in the texture importer is for too
When the project is set to Linear
color space, all color and lighting computations will take place in Linear
color space. When the sRGB
property is enabled at a texture in its import settings, it declares that the 8bit per channel color data was encoded in sRGB
color space typically for viewing on a monitor (a.k.a. "my dark values are important") and will be converted to linear space color (a.k.a. "light adds up and multiplies this way") when sampling a texel.
Regarding normalmaps:
Note that when using Photoshop in a default setup, the color chooser's 0-255 values are showing sRGB values. Now a normalmap's red channel is authored as "0 sRGB is left, 128 sRGB is neutral, 255 sRGB is right". Although when storing it as a .png
image it is stored in sRGB
color space, you want the 8bit integer values to be interpreted directly as 0, 128, 255
and you don't want any gamma correction being removed from these colors. It is true that the colors of the normalmap after being interpreted as linear
would look brighter, but we do not want to preserve the "visual look" of the color image, but instead it's integer data values must stay the same. When you enable sRGB
in the import settings, you declare that the "visual look" shall stay the same and the data values representing it shall be interpreted accordingly, leading to different data values at the texel than the ones you originally chose in sRGB
space.
Ill be sure to share when I finish it.
Great! 🙂