Giter Site home page Giter Site logo

physarum's Introduction

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

physarum's People

Contributors

atwooddeng avatar

Stargazers

 avatar craig avatar  avatar Justin Cobb avatar  avatar  avatar Jun seo Hahm avatar Namke avatar  avatar Hugo avatar  avatar

Watchers

James Cloos avatar Justin Cobb avatar  avatar

Forkers

waylandgod

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.