Skip to content
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

Book 2 > Perlin Noise > Adjusting the phase: wrong scaling #896

Closed
mu-lambda opened this issue Jun 8, 2021 · 1 comment
Closed

Book 2 > Perlin Noise > Adjusting the phase: wrong scaling #896

mu-lambda opened this issue Jun 8, 2021 · 1 comment

Comments

@mu-lambda
Copy link
Contributor

In the current book (also in dev-major branch), the value for the noise texture looks like this

    return color(1,1,1) * 0.5 * (1 + sin(scale*p.z() + 10*noise.turb(p)));

Here the z coordinate of the p is scaled, but the p itself when it is passed to noise.turb is not. Therefore the turbulence is not scaled with the texture as it should be (one can also see it in the final image, where instead of a nice marble texture one sees some white noise). I think the correct line would be

   return color(1,1,1) * 0.5 * (1 + sin(scale*p.z() + 10*noise.turb(scale * p)));

With this change, one gets a nice marble texture in the final render, like here: https://github.com/mu-lambda/mu-lambda-raytracer/blob/main/final_scene.jpg

There is a related issue #425 : the picture would look even better if the noise was aligned along different axis: when one aligns along z, the unnatural con-axed circles on the marble surface are apparent.

@mu-lambda mu-lambda changed the title Book 2 > Perlin Noise > Adjusting the phase Book 2 > Perlin Noise > Adjusting the phase: wrong scaling Jun 8, 2021
mu-lambda added a commit to mu-lambda/raytracing.github.io that referenced this issue Jun 8, 2021
@hollasch
Copy link
Collaborator

Fixed in #897

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

2 participants