First of all, thank you for the great book!
I am still not sure why the house is not brighter but darker. I think this could be addressed by knowing:
- How does Metal texture loader deal with texture’s color space?
I am wondering if we set MTKTextureLoader.Option.sRGB
to True, does this mean Metal will automatically linearize the pixel data for us? My assumption is YES.
- After fragment shader, does Metal automatically apply gamma correction (^2.2)?
My assumption is NO. We need to manually do the gamma correction in shader.
With these assumptions,
- if
.SRGB
is set to True (by default),baseColor
is in linear space, so it looks darker since the display would lower the value. By doingsRGBcolor = pow(linearColor, 1.0/2.2);
(manual correction) before output, it becomes normal. - if
.SRGB
is set to False,baseColor
is actually in sRGB space, so we don’t need to correct it before it is sent to display.
If I understand it right, my concern is that when we set .SRGB
to False, we’re dealing with baseColor
in non-linear space, which I think it should not make sense in light calculation, especially for PBR in chapter 7 (Maps & Materials) ><