Skip to content

Handling Surface Acne in section 12.6 seems wrong. #1021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jeffreyrosenbluth opened this issue May 11, 2022 · 4 comments
Closed

Handling Surface Acne in section 12.6 seems wrong. #1021

jeffreyrosenbluth opened this issue May 11, 2022 · 4 comments

Comments

@jeffreyrosenbluth
Copy link

// 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:

ray r = cam.get_ray(u, v);
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.

@trevordblack
Copy link
Collaborator

I believe this was already fixed in the dev-major branch, but if not, an issue might be floating around for this somewhere.

@jeffreyrosenbluth
Copy link
Author

The def-major branch still has this error. But you are right, issue 979 #979 (comment) discuss this problem

Thanks for the speedy response!

@trevordblack
Copy link
Collaborator

If I'm in a meeting at the office, you get a speedy response!

@hollasch
Copy link
Collaborator

Let's close this issue and consolidate discussion in #979.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants