You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Replace NaN components with zero. See explanation in Ray Tracing: The Rest of Your Life.
Replacing NaNs here with 0.0 will simply replace a pixel with one thats the wrong color. E.g. rgb = (NaN, Nan, Nan) will be black in the final image. When I use the glass sphere in my cornell box I still get acne. As you describe in the text 'pixel_color' is the average over many samples so the NaN fix should take place before the averaging. Probably here:
So that the black is averaged in. I tested this in my ray tracer which is written in Rust and it seems to work. Technically I think it would be better to just throw out this ray but this would require keeping track of the number of "good" rays to reduce the number of samples_per_pixel in the denominator.
The text was updated successfully, but these errors were encountered:
raytracing.github.io/src/common/color.h
Line 24 in 04d80ed
Replacing NaNs here with 0.0 will simply replace a pixel with one thats the wrong color. E.g. rgb = (NaN, Nan, Nan) will be black in the final image. When I use the glass sphere in my cornell box I still get acne. As you describe in the text 'pixel_color' is the average over many samples so the NaN fix should take place before the averaging. Probably here:
raytracing.github.io/src/TheRestOfYourLife/scene.h
Line 34 in 04d80ed
The text was updated successfully, but these errors were encountered: