Question on Book 1 Chapter 4.2 ray_color
function
#1056
-
in return (1.0-t)*color(1.0, 1.0, 1.0) + t*color(0.5, 0.7, 1.0); i don't understand why it has to be |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
just to add on, i output the image and received a different colour from the png. |
Beta Was this translation helpful? Give feedback.
-
Unfortunately, yes, the behavior above is expected. It's not normal. But it is expected. The ppm file format and whatever sdl2 is using have a slightly different color gamma function. We don't cover this in the book, I'd like to, but I'm not sure if it makes sense. The book is written with ppm in mind, as we know the color curve really well, but anything rendered out using a different library will just be different. |
Beta Was this translation helpful? Give feedback.
Unfortunately, yes, the behavior above is expected. It's not normal. But it is expected.
The ppm file format and whatever sdl2 is using have a slightly different color gamma function.
We don't cover this in the book, I'd like to, but I'm not sure if it makes sense.
The book is written with ppm in mind, as we know the color curve really well, but anything rendered out using a different library will just be different.