-
Notifications
You must be signed in to change notification settings - Fork 868
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
[Book2] Incorrect marble pattern at the final Perlin noise section #1286
Comments
It seems like your solution matches the code in v3: https://raytracing.github.io/v3/books/RayTracingTheNextWeek.html#perlinnoise/adjustingthephase Scaling is only applied to the phase |
Looks like it's fixed for future releases then :) |
No, @gau-nernst is saying that the old version matches your solution, and the new version in development has the defect you point out. At this point, your comment and solution look correct to me. In order to properly test this, I'll need to be in the middle of the book 2 progression work that we have scheduled when the book 2 alpha is getting ready for release. I'll revisit then and likely apply your fix. |
Wait, no — I was looking at |
Yup, looks good. Nice catch; thank you! |
At some point we passed the scaled point to the noise.turb() function, when we should have continued to pass the unscaled point. Resolves #1286
At some point we passed the scaled point to the noise.turb() function, when we should have continued to pass the unscaled point. Resolves #1286
At some point we passed the scaled point to the noise.turb() function, when we should have continued to pass the unscaled point. Resolves #1286
Fixed. |
Hi, I'm implementing this code in Rust instead of CPP so I very much hope that this isn't due to language differences.
The issue
Anyways, in the Perlin Noise chapter at the marble pattern section the book proposes this modification to get the marble texture:
Here is my equivalent Rust code:
And this is the image produced:
This is doesn't really look like marble, and does not resemble the following example from the book:
Potential solution
I've played around with the code, and noticed that if I pass the raw point (unscaled) to the turbulence function like so:
I get the following image:
Which appears much closer to the intended result.
I cannot say I understand the math behind this chapter very well, so I don't know if this is the correct solution, but wanted to share anyway.
Hope this is helpful!
The text was updated successfully, but these errors were encountered: