Skip to content

AtwoodDeng/Physarum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Physarum(Unity Demo)

Intro

This is a Unity Demo for the Physarum Simulation. Inspired by Sage Jenson's Procedural Art, this project implemented the evolution of Physarum networks by using some CG techniques including compute shader, GPU particles and volume raymarching. A brief introduction will be presented as below.

image image image image image

Features

Editable Parameters

All Parameter in the simulation is editable.

image

Real-Time Rendering

Support up to 500,000 particles with the trail resolution of 256 * 256 * 256.

image

(My Device : GPU 1080Ti 11G, CPU Intel i7-8700)

Init Particle by Texture (2D Only)

Our system supports initilize the particle system through a texture.

image


Implemetation

Algorithm

image As the image upon, the simulation contains 6 step.

  • Particle Related
  1. SENSE: read the data from Trail map (Render Texture)
  2. ROTATE: update the particle velocity
  3. MOVE: update the particle position
  • Trail Related
  1. DEPOSIT: change the Trail value according to the distrubution of particle
  2. DIFFUSE: 'Blur' the Trail map
  3. DECAY: Reduce the Trail value

Data Structure

image

Particle

ComputeBuffer, a List of ParticleInfo(particle position + particle velocity) For 2D: the z value is always zero. x,y repeat in [-Size,Size]

For 3D: x,y,z repeat in [-Size,Size]

Trail

For 2D: 2D Render Texture * 3 TrailRead/TrailWrite: two render texture for trail update Deposit : an additional render texture used in deposit step

For3D: 3D Render Texture * 3 The same as 2D

Visualization

Particle

The GPU particle is used to visulize the cell. The implementation is similar to Robert-K's project. See the code in the project.

image

2D Trail

The trail texture is used as a main texture in a unlit shader. A LUT is added to exhibit the variation of the density. See the code

image

3D Trail

3D Trail's visulization is volume raymarching. It's basically a post-process effect, which used to visulize the 3D Trail render texture. See the code

Reference

[1]Physarum, Sage Jenson,(https://sagejenson.com/physarum)

[2]Physarum, Entagma, (https://entagma.com/physarum-slime-mold/)

[3]Characteristics of pattern formation and evolution in approximations of Physarum transport networks, Jeff Jones, 2011 (https://uwe-repository.worktribe.com/output/980579)

[4]GPU Particle, Robert-K(https://github.com/Robert-K/gpu-particles/blob/master)

License

License: CC BY-SA 4.0

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published