dilevin / computer-graphics-ray-tracing

Computer Graphics Assignment about Ray Tracing
1 stars 5 forks source link

How should I clamp the colors? #63

Closed Maxlyu254 closed 1 year ago

Maxlyu254 commented 1 year ago

The only viable way I can think of is to add a behaviour to writing_ppm(): when we write the color intensities of pixels into files, we set the intensity of the brightest pixel to be 1, and scale down all intensities by that factor. However, this would mean that every picture we generated would be of the same brightness.

We might track how many light sources have we taken in the recursive calls of raycolor(). However, that would change the function signature.

Is there a better way of clamping down the color intensities?