next up previous
Next: Bibliography

Reaction-Diffusion Texture Synthesis

Jennifer de Kleine

December 12, 2000

Reaction-Diffusion texture synthesis is a procedural method based on the chemical process known as reaction-diffusion.

$\bullet$ chemical mechanism for pattern formation.
$\bullet$ first introduced by Alan Turing in 1952.
$\bullet$ possible mechanism by which cells of an embryo arrange themselves into patterns.
$\bullet$ two or more chemicals diffuse through an embryo and react with each other until the chemical concentrations reach some stable state.
$\bullet$ cells of different types may then develop in different positions based on these chemical concentrations, resulting in patterns.

The general form of a two-chemical reaction-diffusion system is:

$\frac{ \partial a}{\partial t} = F(a,b) + D_a \bigtriangledown^2_a$
$\frac{ \partial b}{\partial t} = F(a,b) + D_b \bigtriangledown^2_b$

where $a,b$ represent the two chemicals,
F(a,b) is the reaction between chemicals a and b,
$D_a, D_b$ are the diffusion rate constants of a and b,
the Laplacian $\bigtriangledown^2_a = \frac{ \partial^2 a}{\partial
x^2} + \frac { \partial ^2 a}{\partial y^2}$ is a measure of the concentration of a at one location with respect to it's concentration nearby.

$\bullet$ $D_a$ determines how fast a diffuses.
$\bullet$ $\bigtriangledown^2_a$ determines the direction in which a diffuses.
$\bullet$ if a has low concentration at some cell then $\bigtriangledown^2_a$ will be positive and a will diffuse toward this cell.
$\bullet$ if a has high concentration at some cell then $\bigtriangledown^2_a$ will be negative and a will diffuse away from this cell.

Key point: a small amount of variation in the initial concentrations gives an initially unstable system which may then be driven to a stable state in which the chemical concentrations vary across the surface, producing a pattern.

Previous work
$\bullet$ these systems have been studied by biologists and mathematicians to see what patterns may be formed.
$\bullet$ Andrew Witkin and Micheal Kass considered reaction-diffusion systems as a model for fingerprints.
$\bullet$ Many people have used reaction-diffusion derived algorithms to generate pretty pictures. You can get nice backgounds from The Wallpaper Machine by Roy Williams and Bruce Spears. Also Andrew Witkin and Micheal Kass won the Prix Ars Electronica 1992 for their picture 'RD Texture Buttons'. link
$\bullet$ Greg Turk looks at generating textures using a cascade of multiple reaction-diffusion systems.
$\bullet$ Greg Turk also introduces a method by which the texture is generated directly over an arbitrary surface.

Reaction-Diffusion on a grid

$\bullet$ each square on the grid represents a cell
$\bullet$ each cell diffuses to each of its four neighbours
$\bullet$ the concentration of each chemical is represented by a 2-D array of discrete values, one value for each cell on the grid
$\bullet$ simulate reaction-diffusion by solving partial differential equations over the grid

System for generating spots proposed by Turing:

$\bigtriangleup a_{ij} = s(16 - a_{ij}b_{ij}) + D_a(a_{i+1 j} + a_{i-1 j} +
a_{i j+1} + a_{i j-1} - 4a_{ij})$
$\bigtriangleup b_{ij} = s(a_{ij}b_{ij} - b_{ij} - \beta _{ij}) + D_b(b_{i+1
j} + b_{i-1 j} + b_{i j+1} + b_{i j-1} - 4b_{ij})$

where s is the source density constant.
Small values of s result in a slower reaction relative to diffusion which gives us larger spots.
Larger values give us smaller spots.
Beta is the parameter which is used to introduce the small amount of variation into the system making it unstable.
The more beta varies, the more irregular in shape the spots become.

After running this system on a grid, the concentration can be mapped to some colour values to generate texture. I chose a very straightforward simple mapping:

  1. find minimum and maximum concentration values
  2. map $x \in$ [min,max] to $c \in$ [0,255]
  3. $c = ((x-min)/(max-min))*255$
  4. set R = G = B = c
In the above system, mapping the concentration of a to colour gives us dark spots where the concentration of a is high.

Another system which I have implemented is a 5-chemical system proposed by Meindhart for the generation of stripe patterns:

$\frac{ \partial a}{\partial t} = \frac{kea^2}{c} - s_1a + D_a
\bigtriangledown^2_a + \rho _0$

$\frac{ \partial b}{\partial t} = \frac{kdb^2}{c} - s_1b + D_a
\bigtriangledown^2_b + \rho _0$

$\frac{ \partial c}{\partial t} = kea^2 + kdb^2 - \beta c$

$\frac{ \partial d}{\partial t} = s_2(a - d) + D_d \bigtriangledown^2_d + \rho _1$

$\frac{ \partial e}{\partial t} = s_2(b - e) + D_d \bigtriangledown^2_e + \rho _0$

Multiple reaction-diffusion systems

$\bullet$ More complex patterns can be generated by combining the above two systems.
$\bullet$ First one chemical system is run producing an initial pattern, which is then refined by simulating another system.
$\bullet$ Jonathon Bard suggested that this process may be responsible for coat patterns of some mammals.

Cheetah spots

Leopard spots

Lionfish stripes

Giraffe reticulation

Zebra stripes

Greg Turk's results

Here are some pictures that were produced by simulating these reaction-diffusion systems directly over a mesh.

next up previous
Next: Bibliography
Jennifer de Kleine 2000-12-12