Why lighting calculations look blown-out and plastic without proper gamma correction:
- Monitors display colors using non-linear gamma ($V_{\text{display}} = V_{\text{linear}}^{2.2}$).
- Light calculations (Lambertian diffuse, Phong specular, PBR) must occur in Linear space ($1.0 + 1.0 = 2.0$).
The Solution:
- Load color textures using
sRGBformats (DXGI_FORMAT_R8G8B8A8_UNORM_SRGB/GL_SRGB8_ALPHA8) so hardware automatically linearizes inputs. - In post-processing shader, convert linear HDR result back to gamma space:
vec3 finalColor = pow(linearColor, vec3(1.0 / 2.2));