O'Reilly logo

OpenGL 4.0 Shading Language Cookbook by David Wolff

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a seamless noise texture

It can be particularly useful to have a noise texture that tiles well. If we simply create a noise texture as a finite slice of 3D noise values, then the values will not wrap smoothly across the boundaries of the texture. This can cause hard edges (seams) to appear in the rendered surface if the texture coordinates extend outside of the range of zero to one.

We can create a noise texture that is seamless by making use of the fact that the noise functions are defined on an infinite domain. Instead of simply storing the noise values directly within the texture, we store a linear interpolation of the noise value with three other noise values located at the corners of a rectangle with the same dimensions as the texture ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required