Gamma Chopper

Read about gamma correction and why it is used:

https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch24.html

You can also watch this video from MinutePhysics.

You probably did not use gamma correction in the previous tasks. Try to do it now. The color values are currently adjusted to work without gamma correction, in order to not mess up the scene lighting, we can assume that the input color values are also in gamma space. For example, if we have a color code that represents $(128, 128, 128)$ gray, then we can assume that this is the actual value that we want to output. Ie if the light calculations determine that this $(128, 128, 128)$ gray stays the same, then that is the value we output from the shader (not the value that would represent the exact half-gray).

With that in mind, you need to gamma decode the input, then do light calculations and just before assigning the final gl_FragColor, encode back into gamma space.

Use either of the base codes from the previous two tasks (Shaded Chopper, Blinn Chopper). Take the gamma value $2.2$.

You should get a result, where there is a more sharper boundary between the illuminated and non-illuminated areas of the sphere. This is because previously some colors that were meant to be light, were converted into darker colors by the monitor's gamma function.

The pictures below both have the gamma correction applied.

Gouraud Phong

If you used gamma correction in the previous tasks, then just upload the same solution here.

;