€0+

Reaction Diffusion (Blender Geometry-Nodes)

4 ratings
I want this!

Reaction Diffusion (Blender Geometry-Nodes)

4 ratings

A Blender file with Geometry-Nodes (GN) modifiers to run and visualize Reaction-Diffusion (RD) simulation.

Requires Blender >=4.3.

Have questions or want to share your results? Reach out on Twitter/X or Threads.

The setup allows simulation of Reaction-Diffusion: a mathematical model for interacting substances, that can be used for abstract animations or to simulate real physical phenomena like stripes and animals patterns formation, or bacteria interaction and growth. Small changes in the model parameters can lead to a wide variety of complex organic patterns.

Summary of the Setup

In the provided file you can find a reaction_diffusion_obj with two modifiers slots: a Reaction Diffusion Main for the base simulation and a Render for rendering the results. You can start playing with these and get results right away!

The simulation includes two core implementations (and respective node-groups): reaction_diffusion_sim and gray_scott_sim (premium version only). The first is a general simplistic implementation of the RD model, relying on a single substance and basic image processing logic. The second implements the Gray-Scott model, where two different substances interact with each other (see theory here). Multiple presets for the latter are also provided.

While the above will return the raw results of the simulation, we also provide some utilities to visualise and render the results. RD 2D Renderer gives the control to use the sim results for plane displacement and shader control. RD Volume Renderer (premium version only) allows instead to render results as volume or full 3D mesh.

The sim resolution depends on the resolution of the target mesh. A higher face count gives more details but requires more computation.

Sim Parameters

For the Reaction Diffusion node-tree, we exposed the most relevant parameters to play with, but you can simply edit manually the values of the core simulation group (e.g. reaction_diffusion_sim) to explore the full range of results.

Sim Substeps controls how many steps are run in a frame. The higher, and the faster the simulation will run, while requiring more time to be computed.

For reaction_diffusion_sim we suggest the following ranges:

  • Mul 1 Value: from 1.1 to 1.9
  • Blur 2 Iter : from 2 to 10. Higher values allows for faster diffusion, but require more computation
  • Mul 2 Value: from 2.9 to 3.4

Results vary drastically with even minor parameter adjustments (e.g. +/-0.01). Many configurations may not produce compelling results, so experimentation through trial and error is essential.

You can control the substance initialization and parameters via texture or images by editing directly the content of the Reaction Diffusion node-tree. In the premium version we provide a variety of ready examples that you can tweak and connect as needed.

Brush

You can also find a brush object that can be animated or moved in real time to influence the substances of the simulation. Currently, it act as an eraser. When close enough to a point it will zero-out the substances. You can scale it in real-time to affect the area of influence.

Extra content for Premium version

In the premium version you will additionally find the Gray-Scott model implementation, simulation presets, option to run and render a 3D version of the simulation, texture/image conditioning examples, plus a richer set of input base meshes.

Gray-Scott Model

The Gray-Scott model is a more complex and rich implementation of the reaction-diffusion phenomena, (see theory here). We provide multiple presets for this implementation. You can select them from the Gray-Scott Preset menu.

When using this model, we suggest to tick the Use substance_b option in the Render modifier.

3D

To run the RD sim in 3-dimensions, you need to use one of the provided "volN" objects as input geometry. The "N" indicated the resolution of the volume, higher resolution means more detailed results but slower generation. You also need to use the provided RD Volume Renderer node-tree for the Render modifier. Currently, the 3D version cannot be run on custom meshes or volumes.

Input mesh and Conditioning

You can run the 2D version on an arbitrary mesh by selecting the Obj option from the Mesh Menu input and passing your target object. Remember that the resolution of the sim depends on the resolution of the target mesh.

You can also test some of the conditioning examples present in the Reaction Diffusion node-tree by selecting from the various menus, or by manually connecting to the preferred input socket.Tweaking of the range of values is fundamental when trying on different input parameters.

Technical Considerations

Laplacian Approximation

The diffusion process relies on the Laplacian operator, which can be obtained via custom convolution kernels. Here we simply used the Blur Attribute node and approximate the Laplacian in a dedicated node-tree. Its parameters control the reaction_diffusion_sim, while for the gray_scott_sim we exposed only the parameters of the Gray-Scott model, and fixed the approximated Laplacian ones (you can edit them manually inside the node-tree). Because of this approximation, parameters for the gray_scott_sim won't match what you will find in online examples where Laplacian is used. We will work more on formalizing such similarities, and if you have knowledge or expertise regarding this, feel free to reach out.

Mesh Topology and Blur

Given that we rely on attributes at point level, the mesh topology will strongly influence simulation results. Think for example how differently the Blur Attribute node works when applied on triangular VS quadrilateral faces. We provide a "triangulate" option for some of the template input meshes, that increases the number of neighbors of a point from 4 to 8.

To run the simulation in 3D, given that we rely on the Blur Attribute, we created dedicated "fully connected 3D cubes". This means that each vertex is connected to its 26 neighbors. You can find few of such fully-connected-cubes at different resolutions (e.g. 32, 64) in the objects list.

I want this!
Copy product URL
30-day money back guarantee

Ratings

5
(4 ratings)
5 stars
100%
4 stars
0%
3 stars
0%
2 stars
0%
1 star
0%