apply gamma correction

This commit is contained in:
Cat Flynn 2023-02-26 03:28:26 +00:00
parent 892bec867c
commit 6ca53a5329
1 changed files with 7 additions and 0 deletions

View File

@ -99,6 +99,13 @@ void main()
depth += sampleDepth / float(samples);
}
// include the first sample we took
samples++;
// gamma correction
float scale = 1.0 / samples;
pixel.xyz = sqrt(scale * pixel.xyz);
pixel.xyz = mix(pixel.xyz, vec3(1.0), depth);
// output to a specific pixel in the image