A filter effect that utilises the Perlin turbulence function.
This filter effect creates an image using the Perlin turbulence function. It allows the synthesis of artificial textures like clouds or marble. For a detailed description the of the Perlin turbulence function, see "Texturing and Modeling", Ebert et al, AP Professional, 1994. The resulting image will fill the entire filter primitive subregion for this filter primitive.
It is possible to create bandwidth-limited noise by synthesizing only one octave.
The following order is used for applying the pseudo random numbers. An initial seed value is computed based on Seed. Then the implementation computes the lattice points for R, then continues getting additional pseudo random numbers relative to the last generated pseudo random number and computes the lattice points for G, and so on for B and A.
Structure
The TurbulenceFX class consists of the following fields:
Access | Name | Type | Comment |
| FX | DOUBLE | The base frequency for noise on the X axis. |
---|
A negative value for base frequency is an error. The default value is zero.
|
| FY | DOUBLE | The base frequency for noise on the Y axis. |
---|
A negative value for base frequency is an error. The default value is zero.
|
| Octaves | INT | The numOctaves parameter for the noise function. |
---|
Defaults to 1 if not specified.
|
| Seed | INT | The starting number for the pseudo random number generator. |
---|
If the value is undefined, the effect is as if a value of 0 were specified. When the seed number is handed over to the algorithm it must first be truncated, i.e. rounded to the closest integer value towards zero.
|
| Stitch | INT | If TRUE , stitching will be enabled at the tile's edges. |
---|
By default, the turbulence algorithm will sometimes show discontinuities at the tile borders. If Stitch is set to TRUE then the algorithm will automatically adjust base frequency values such that the node's width and height (i.e., the width and height of the current subregion) contains an integral number of the Perlin tile width and height for the first octave.
The baseFrequency will be adjusted up or down depending on which way has the smallest relative (not absolute) change as follows: Given the frequency, calculate lowFreq = floor(width*frequency) / width and hiFreq = ceil(width * frequency) / width . If frequency/lowFreq < hiFreq/frequency then use lowFreq, else use hiFreq. While generating turbulence values, generate lattice vectors as normal for Perlin Noise, except for those lattice points that lie on the right or bottom edges of the active area (the size of the resulting tile). In those cases, copy the lattice vector from the opposite edge of the active area.
|
| Type | INT | Can be set to 'noise' or 'turbulence'. |
---|
| XMLDef | STRING | Returns an SVG compliant XML string that describes the effect. |
---|
Actions
The following actions are currently supported:
| Name | Comment | | Draw | Render the effect to the target bitmap. |
---|
| ERR acDraw(*Object, DOUBLE X, DOUBLE Y, DOUBLE Width, DOUBLE Height) Input | Description |
---|
X | The X position of the region to be drawn. | Y | The Y position of the region to be drawn. | Width | The width of the region to be drawn. | Height | The height of the region to be drawn. |
|