2-D PSRDnoise tutorial

Page 1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21

Frame rate: FPS

3: Periodic wrap

The function "psrdnoise" has four arguments. The first one is the texture coordinate, which is all you get with most other noise functions. Let's explore the other three in order.

The second argument, "p", can be used to set a repeat period for the noise pattern, to make it tile. (The "p" in the name "psrdnoise" is short for "periodic".) This is useful if you want to pre-compute the noise pattern and read it from a texture, and it can be quite handy in other situations as well.

Here, we set the period to (6.0, 4.0) for this 12-by-12 sized square to repeat the pattern twice across the canvas horizontally, and three times vertically. The periods in x and y can be set independently, but because of the simplex grid, the period in the y direction needs to be an even number.

	// Text in this pane will be dynamically replaced.