void PerlinNoise(float frequencyX, float frequencyY, unsigned numOctaves, unsigned randomSeed, bool stitch, bool fractal, unsigned channelMask = Channel_RGB, bool grayScale = false, float* offsets = 0, unsigned offsetCount = 0);
PerlinNoise generates a Perlin noise image.
Parameters |
Description |
float frequencyX |
Frequency to use in the x direction. For example, to generate a noise that is sized for a 64 x 128 image, pass 64 for the frequencyX value. |
float frequencyY |
Frequency to use in the y direction. For example, to generate a noise that is sized for a 64 x 128 image, pass 128 for the frequencyY value. |
unsigned numOctaves |
Number of octaves or individual noise functions to combine to create this noise. Larger numbers of octaves create images with greater detail. Larger numbers of octaves also require more processing time. |
unsigned randomSeed |
The random seed number to use. If you keep all other parameters the same, you can generate different pseudo-random results by varying the random seed value. The Perlin noise function is a mapping function, not a true random-number generation function, so it creates the same results each time from the same random seed. |
bool stitch |
A Boolean value. If the value is true, the method attempts to smooth the transition edges of the image to create seamless textures for tiling as a bitmap fill. |
bool fractal |
A Boolean value. If the value is true, the method generates fractal noise; otherwise, it generates turbulence. An image with turbulence has visible discontinuities in the gradient that can make it better approximate sharper visual effects like flames and ocean waves. |
unsigned channelMask = Channel_RGB |
A number that can be a combination of any of the four color channel values (BitmapDataChannel.RED, BitmapDataChannel.BLUE, BitmapDataChannel.GREEN, and BitmapDataChannel.ALPHA). You can use the logical OR operator (|) to combine channel values. |
bool grayScale = false |
A Boolean value. If the value is true, a grayscale image is created by setting each of the red, green, and blue color channels to identical values. The alpha channel value is not affected if this value is set to true. |
float* offsets = 0 |
An array of points that correspond to x and y offsets for each octave. By manipulating the offset values you can smoothly scroll the layers of a perlinNoise image. Each point in the offset array affects a specific octave noise function. |
unsigned offsetCount = 0 |
_nt_ |