Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Velfi/Gray-Scott-Reaction-Diffusion

Repository files navigation

Gray Scott Reaction Diffusion

Reaction–diffusion systems are mathematical models which correspond to several physical phenomena: the most common is the change in space and time of the concentration of one or more chemical substances: local chemical reactions in which the substances are transformed into each other, and diffusion which causes the substances to spread out over a surface in space. Wikipedia

If that sounds like gibberish, just know that it's an algorithm for modeling the processes that create lots of natural patterns. For more cool patterns in nature, see here.

Example 1 Example 2 Example 3 Example 4 Example 5

Running The Visualizer

You'll need to have Rust and cargo installed. Then, run cargo run --release in your terminal of choice.

Controls

  • Left Mouse Button: Click and drag to seed the reaction
  • Right Mouse Button: Click and drag to erase/create voids in the reaction
  • Z: Toggle psychedelic mode (randomly cycles through LUTs)
  • X: Clear the screen
  • N: Fill the screen with noise
  • G: Cycle through different color gradients (hold SHIFT to cycle backwards)
  • P: Cycle through different reaction presets (hold SHIFT to cycle backwards)
  • U: Cycle through different nutrient patterns (hold SHIFT to cycle backwards)
  • Arrow Keys: Adjust feed rate (left/right) and kill rate (up/down) in Custom preset (hold SHIFT for finer control)
  • ? or \: Toggle help overlay
  • ESC: Exit the application

Reaction Presets

The simulation comes with several built-in presets that create different patterns:

  • BRAIN_CORAL
  • FINGERPRINT
  • MITOSIS
  • RIPPLES
  • SOLITON_COLLAPSE
  • U_SKATE_WORLD
  • UNDULATING
  • WORMS
  • CUSTOM (Interactive: use arrow keys to adjust feed and kill rates, hold SHIFT for finer control)

Nutrient Patterns

The simulation also includes various nutrient patterns that affect how the reaction spreads:

  • Uniform
  • Checkerboard
  • Diagonal Gradient
  • Radial Gradient
  • Vertical Stripes
  • Horizontal Stripes
  • Noise

About

A Rust and WGPU implementation of Gray-Scott Reaction-Diffusion.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •