Login - Create Account

Script API for Noise and Blending Modes

Good news for script authors: Filter Forge 3.0 introduces new API functions that allow access to the blending modes, uniform noise and Perlin noise.

Blending Modes API

This API is very easy to understand and use. Each blending mode has its own function, e.g. blend_normal(), blend_multiply() etc. Each of these functions accepts two RGBA colors to blend, opacity percentage and a HDR flag (not all of the modes support HDR though), and returns four return values representing the resulting RGBA color. Here's an example:

Blend Modes Script Example

Blend Modes Script Output

Script API – Blending Modes.ffxml

Uniform Noise API

The uniform noise is an essential foundation for implementing any graphic algorithm that requires randomness. The core of the Filter Forge 3.0 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:

Uniform Noise Script Example

Uniform Noise

Script API – Uniform Noise.ffxml


Here's a filter that uses the uniform noise API to generate a randomly-colored tile pattern:

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:

Worley Noise

Script API – Worley Noise.ffxml

Perlin Noise API

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:

Z-Animated Perlin Script Example

Z-Animated Perlin Script Output

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:

Seamless Perlin Script Example

Seamless Perlin Script Output

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:

Multi-Octave Perlin

Script API – Multi-Octave Perlin.ffxml

Filter Forge's amazing node based editor has been invaluable in giving us the power to create textures that make the most of today's real-time pixel shaders.

Karl Wickens
Visual Effects Lead Artist
Electronic Arts
www.ea.com

See All Testimonials

Get a 75% discount on any edition!
Expires soon!
Buy today – save up to $300!

“I'm thinking Filter Forge should come with a warning: 'This Product could be Habit Forming'.”

Nancy Schober
heedingthemuses.wordpress.com

“It's a powerful and logical way of creating effects that's relatively easy to learn by seeing how other effects are built. Creating filters from scratch is time-consuming, but for a wider user group, it's a great way to modify already-created effects.”

Neil Bennett
Digital Arts
www.digitalartsonline.co.uk

Follow filterforge on Twitter