Skip to content

Typo and off-by-one error in stratifying/jittering section of Book 3 #976

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
TheRayTracer opened this issue Jan 7, 2022 · 8 comments
Closed
Assignees
Milestone

Comments

@TheRayTracer
Copy link

I have noticed a small typo in the stratifying section of Book 3 of the dev-major v4 branch. The typo is in listing 6.

int sqrt_spp = int(sqrt(samples_per_pixrel));

Also, in listing 6, I believe there is an off-by-one error. This has existed since v3 of Book 3 and the accompanying reference source code.

auto u = (i + (s_i + random_double()) / sqrt_spp) / (image_width-1);
auto v = (j + (s_j + random_double()) / sqrt_spp) / (image_height-1);

Should be:

auto u = (i + (s_i + random_double()) / sqrt_spp) / (image_width);
auto v = (j + (s_j + random_double()) / sqrt_spp) / (image_height);

And also in the final scene.h source code.

@trevordblack trevordblack self-assigned this Jan 7, 2022
@trevordblack
Copy link
Collaborator

Thanks. I'll look into it.

@trevordblack trevordblack added this to the v4.0.0 milestone Jan 7, 2022
@trevordblack
Copy link
Collaborator

This is a sibling issue to #682

@hollasch
Copy link
Collaborator

Yes, this is being addressed in issue #682.

@hollasch
Copy link
Collaborator

hollasch commented Jan 25, 2022

Fixed the typo in ongoing changes for #682.

@trevordblack
Copy link
Collaborator

samples_per_pixrel still needs to be addressed

@hollasch
Copy link
Collaborator

I've fixed it in the feature branch (not yet on GitHub).

hollasch added a commit that referenced this issue Feb 12, 2022
@hollasch
Copy link
Collaborator

Ref #993

hollasch added a commit that referenced this issue Feb 12, 2022
@hollasch
Copy link
Collaborator

Two issues here. One is fixed, and the other is addressed in #682. Closing.

trevordblack pushed a commit that referenced this issue Jun 8, 2023
trevordblack pushed a commit that referenced this issue Jun 25, 2023
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