Writing new rules

As a first step, try changing the parameters of some of the rules. This can give very different behavior. Read Robert Munafo's pages about Gray-Scott, for example, and try out some of the parameters he discusses on this pattern: GrayScott1984/self-replicating_spots.vti.

Formulas and kernel rules

Ready also allows you to reprogram rules completely. For formula and kernel rules, hit 'edit' next to the formula/kernel and then see what effect your change has. Some changes will cause an error when you try to run or step forward, and will show you a message box saying what went wrong.

Keywords for formula rules on images:
laplacian_aA Laplacian kernel applied to chemical 'a' (or 'b', etc.).
bilaplacian_aA bi-Laplacian kernel applied to chemical 'a' (or 'b', etc.). Equivalent to applying the Laplacian kernel twice.
trilaplacian_aA tri-Laplacian kernel applied to chemical 'a' (or 'b', etc.). Equivalent to applying the Laplacian kernel three times.
gaussian_aA Gaussian kernel of sigma=1 applied to chemical 'a' (or 'b', etc.).
sobelN_a, sobelE_a, sobelNE_a, etc.A Sobel filter applied to chemical 'a' (or 'b', etc.) pointing in the compass directions.
x_gradient_aThe gradient of chemical 'a' (or 'b', etc.) in the x-direction.
y_gradient_aThe gradient of chemical 'a' (or 'b', etc.) in the y-direction.
z_gradient_aThe gradient of chemical 'a' (or 'b', etc.) in the z-direction.
x_deriv2_a, etc.The second derivative of chemical 'a' (or 'b', etc.) in the x-direction (or y, or z).
x_deriv3_a, etc.The third derivative of chemical 'a' (or 'b', etc.) in the x-direction (or y, or z).
gradient_mag_squared_aThe squared magnitude of the gradient of chemical 'a' (or 'b', etc.). For a 2D pattern this is equal to x_gradient_a^2 + y_gradient_a^2.
x_posThe location of the cell in the x-direction, in the range 0 to 1.
y_posThe location of the cell in the y-direction, in the range 0 to 1.
z_posThe location of the cell in the z-direction, in the range 0 to 1.
a_n, a_ne, a_n2, a_une, etc.The neighboring cells. Indexed as u=up/d=down Z cells, n=north/s=south Y cells, e=east/w=west X cells: a_[u/d][Z][n/s][Y][e/w][X]. The digit is omitted if it is one. The digit and the direction are omitted if the digit is zero. Currently we allow indices up to 10 - if you want to go further then write a kernel instead.

The grid spacing (sometimes denoted by h) of the Laplacian and Gaussian stencils is controlled by parameter dx. If there is no parameter called dx then the default value of 1 is used.

To understand how the formula is used, try View > View Full Kernel to see the OpenCL kernel code that is assembled. You'll see for example how the timestep parameter is used at the end during the forward Euler step. Any formula rule can be permanently converted to a kernel rule by using Action > Convert to Full Kernel.

For speed we process the image in blocks of 4x1x1, stored as float4. All of the above keywords are float4 values. While doing it this way makes Ready run faster, it can complicate the way we have to write rules - see the examples and please get in touch for more help.

Images in Ready can be 1D, 2D or 3D. The keywords in the formulas generate stencils of the appropriate dimensionality.

Ready also supports running formulas on meshes. However not all of the above keywords are well-defined on arbitrary meshes. The table below shows those keywords that are supported:

Keywords for formula rules on meshes:
laplacian_aA Laplacian kernel applied to chemical 'a' (or 'b', etc.).

Initial pattern generator

For more details on how the patterns are specified, including how the initial pattern generator works, open the pattern files in a text editor (right-click on them) (example). The format is documented here.

Share your findings

If you come up with interesting patterns then please share them with the world! The best patterns submitted to us will be included in the next release of Ready - see our pattern competition.