This article describes the noise generation functions that can be used in the Map Script and Curve Script components.
The uniform noise is an essential foundation for implementing any graphic algorithm that requires randomness. The core of the Filter Forge uniform noise API is the get_noise() function that accepts three coordinates (yes, three: X, Y and Z), takes into account the random seed which you can set by calling the set_noise_seed() function, and returns a single value representing the noise amplitude at the specified coordinates. This example uses different Z coordinates to obtain different noise values for R, G and B channels:
Script API – Uniform Noise.ffxml
Here's a filter that uses the uniform noise API to generate a randomly-colored tile pattern:
Script API – Noise Bricks.ffxml
And here's another sample filter that uses the uniform noise API to implement Worley noise:
Script API – Worley Noise.ffxml
While the uniform noise API basically offers a random number generator tied to sample coordinates, the Perlin noise API implements a well-known, award-winning noise algorithm that offers smoother, natural-looking noise with adjustable scale. The core of this API is the get_perlin_noise() function which accepts three coordinates (you should definitely play with the "animated" Z coordinate in the example below) and a scale factor, and returns a single value representing the noise amplitude at these coordinates:
Script API – Z-Animated Perlin.ffxml
The noise generated by the Perlin noise API can be made seamless. You can even specify the region to be tileable:
Script API – Seamless Perlin.ffxml
The Perlin noise API offers a single-octave noise, so if you want a more complex noise you'll have to implement the layering yourself. Here's an example filter that emulates Filter Forge's built-in multi-octave Perlin noise via the script API: