Skip to content

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

@mu-lambda

Description

@mu-lambda

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions