Worley

-·-- ·--·

Home
Soccer Ball
Beveled primitives
Skylights
Road Lines
Herringbones
Warp Turbulence
Worley
Cell FX
Musgrave
Extended Grid
Spherical Smear
Radial Smear
Planet Glow
Hair Direction

Materials Plugins

The Worley (v2.0)


Click here to download it (for A:M v8.5, Windows).
Copy the trb into your A:M turbulence folder.

The Worley Plugin is based on the work of Steven Worley who published an article in the SIGGRAPH 96 proceedings titled "A Cellular Texture Basis Function". 

The plugin is essentially the same algorithm as the CellTurb plugin but with all the properties discussed by Worley exposed to the user and with some more properties I added.

I invite you to take a look at a slide show type of presentation about the paper with nice pictures by Michael Monks.

Also take a look at my old Worley plugin page for more texture examples done with the plugin.

The basic idea of the function is to compute the distance from any render point on the surface of the object to some cell centers. In other words, you have a bunch of cells inside the 3D space. We know the location of each cells in the 3D space and each time we need to render a point on a surface, we take the XYZ coordinate of this point and compute the distance to the center of each of those cells and return the shortest distance we found. Of course, we don't compute the distance to all the cells. That would take infinite time. We use space partitioning tricks to limit the number of cells to look at.

If you want to have an idea of those cell, create a Worley material and set its scale to 500, the first attribute to white and the second to black. On the worley tab, check the "Rooted" and the "Inverse Distance" checkboxes and set the "Bias" to -25, the "Gain" to 127 and render.

In the material examples I show below, the material scale is set to 500, the first attribute is white and the second attribute is black.

Worley tab

Distance

There are 4 distance functions Euclidian, Manhattan, Camberra and Minkovsky. My goal here is not to give mathematical description of those distances.


Euclidian

Manhattan

Camberra

Minkovsky

Euclidian

The Euclidian distance computes the real straight line distance between two points. It produces round cells

Manhattan

The Manhattan distance computes the distance by adding the X, Y and Z distances. It is called Manhattan because of the similarity of having to walk around blocks in streets when you want to go from one point to another in a city. It produces diamond cells

Camberra

The Camberra distance is a statistical distance. It is not well implemented in my plugin but I haven't found a suitable implementation because it is too dependent on the origin coordinates. I shall rework it eventually or remove it. The reason it is there is because I haven't decided what to do with it yet.

Minkovsky

The Minkovsky distance is a exponent controllable distance function. When Exponent =1 you get the same result as Manhatan and when Exponent=2, you get the same result as Euclidian. As you go below 1, it produces stars cells and as you go higher than 2, it produces squarer cells.


Exponent = 5 (rooted)

Rooted

Rooted tells the distance function to compute the root of the otherwise unrooted computed distance. This is to accelerate the computation and comparison of distances. Normally, the distances are rooted but some different effects are achievable without rooting the output. Root is only applied to Euclidian and Minkovsky.

Inverse distance

Inverse distance inverses the value returned by the function. What should be 0 becomes 1 and vice-versa.

Plated

Plated assigns a constant value to each cell. It can be used with all distance functions.

C1, C2, C3, C4

Those are Worley constants. To understand them it is better to set the distance to Euclidian and Rooted.

C1, C2, C3 and C4 are respectively the distance from the render point to the nearest cell, to the second nearest cell, to the third nearest cell and to the fourth nearest cell.


C1=1
C2, C3, C4 = 0

C2=1
C1, C3, C4 = 0

C3=1
C1, C2, C4 = 0

C4=1
C1, C2, C3 = 0
Those constants are multipliers which mean that any distance where the multiplier is 0 is not taken into account in the output. when a multiplier is 1, the corresponding distance is added once to the result and when a multiplier is -1, it is subtracted once to the result. So you could add together 1/2 the distance to the nearest cell and 1/2 the distance to the next nearest cell by setting C1=0.5 and C2=0.5.

But things starts to be interesting when you subtract the nearest distance from the next nearest distance by setting C1=-1 and C2=1. This setting is the basic setting for flagstone type of material. You will discover nice textures by experimenting with adding and subtracting cell distances.


C1= 1, C2 = -1

C1= 1.5, C2 = -1

C1= 1, C2 = -2

C1 = 1, C2 = -1,
C3 = 1, C4 = -1

Gain

Gain is used to amplify the values output by the function. It may be used in conjunction with the ">>" button which displays the current minimum and maximum values output by the function.

One of the use of the Gain property is to get the most out of the output. For instance, if you take the basic flagstone material with C1=-1 and C2=1, and click the >> button, you will see that the valued output by the function are from 0 to 55.5 while the optimal range of values would be from 0 to 100. You can increase the range of values by increasing the Gain. For instance with a Gain of 180, you get range of values from 0 to 99.8.

Another use of this property is to amplify the output in order to exaggerate some attributes. For instance, if you enter a Gain of 5000, you get a more convincing flagstone texture. However, the lines separating the stones are too thin.
C1 = 1, C2 = -1,
Gain = 180

C1 = 1, C2 = -1,
Gain = 5000

Bias

We may enlarge those lines by shifting the function in the negative range and we do that by entering a negative value in the Bias property. For instance, entering -200 in the Bias will enlarge the space between the stones. However, because the negative values goes well under 0, the lines are not black.


C1 = 1, C2 = -1,
Gain = 5000,
Bias = -200

Use Limiter

A function output value of -100 have the same effect as an output value of 100. More generally, negative values have the same effect on the attribute mixing as positive values. This is why the lines between the stones are not black. The "Use limiter" will bring all negative values to 0. So if you check the "Use Limiter", the lines between the stones will fill in black.


C1 = 1, C2 = -1,
Gain = 5000,
Bias = -200
Use Limiter

Multiplier

This property does not do what it was intended to do yet. I shall work on it later.

>>

The >> button displays the range of values actually produced by the function. Note that you will get better estimates if the Material preview window is opened when you change the combiner properties or after you have quick-rendered your object or group. Otherwise, the samples are taken from the tiny square in the material tree.

Distr + Turb tab

Distribution

For those familiar with statistics and a normal distribution, you will get the idea right away. For all the others, those properties controls the distribution of cells in the 3D space. The default values of 5 and 5 means that there are a mean of 5 cells in each 1cm cube of space but he number can vary somewhat from 1 up to about 10 but still 5 most of the time.

Mean

Mean controls the average number of cells per cm3.

Var

Var controls the variation in the number of cells. For instance, if you where to enter a Variance of 0.01, you would be almost assured that almost all 1cm cube of space will be filled with 5 cells thus producing a much more uniform distribution of cells. Conversely, if you enter a Variance of 20, you would have a wide variation in the number of cells in each cm cube of space including possibly no cell at all producing a very non uniform cell distribution.

Octave, Lacunarity and Dimension

I am not satisfied with the Fractal combination of the Cells Layers yet. As it is now, it may be useful for some applications but I don't guarantee that future versions of the plugin will combine the layers in the same way although I might probably add a v2 compatibility checkbox.

I refer you to my Octave description page for those properties. As a note, don't forget to adjust both Bias and Gain when playing with those settings.

Perturbation

When you look at the basic Flagstone texture, even though we increased the gain and lowered the bias, those straight lines are still not that convincing. We can add perturbation in those straight lines through those properties.


Scale = 40,
Amplitude = 5

Scale = 40,
Amplitude = 5
+ Scale = 4,
Amplitude = 0.5

Scale

Scales the perturbation, Larger scale will produce whide perturbations while smaller scales wii produce small ripples.

Amplitude

Increase or decrease the amount of perturbation on the texture. Large amplitude can give wild texture effects.

© Yves Poissant, 2002