An open API service indexing awesome lists of open source software.

https://github.com/diwi/pixelflow

A Processing/Java library for high performance GPU-Computing (GLSL). Fluid Simulation + SoftBody Dynamics + Optical Flow + Rendering + Image Processing + Particle Systems + Physics +...
https://github.com/diwi/pixelflow

antialiasing cloth-simulation filters fluid-simulation glsl opengl postprocessing processing-ide skylight softbody-dynamics

Last synced: about 1 month ago
JSON representation

A Processing/Java library for high performance GPU-Computing (GLSL). Fluid Simulation + SoftBody Dynamics + Optical Flow + Rendering + Image Processing + Particle Systems + Physics +...

Awesome Lists containing this project

README

        

![PixelFlow Header](http://thomasdiewald.com/processing/libraries/pixelflow/PixelFlow_header.jpg)

# PixelFlow
**A Processing/Java library for high performance GPU-Computing (GLSL).**


## Features

```
+ Fluid Simulation (GLSL)
- Jos Stam, Real-Time Fluid Dynamics for Games
- Particle Sytems
- Flow Field Visualisation
- Streamlines
- ...
+ Flow Field Particles (GLSL)
- Collision Detection, Particle <-> Particle
- Collision Detection, Particle <-> Obstacle
- Cohesion
- Verlet Integration
- FlowField/SDF(Signed Distance Field) based
- Streamlines
- ...
+ Softbody Dynamics (CPU, GLSL is coming)
- 2D and 3D
- Collision Detection
- Cloth, Grids, Chains, Rigid Folding ...
- Particle Systems
- ...
+ Skylight Renderer (GLSL)
- Interactive/Realtime Viewport Renderer
- Ambient Occlusion
- Diffuse Shading
- ShadowMapping
- ...
+ PostProcessing Filters (GLSL)
- Box Blur
- Binomial Blur
- Gauss Blur
- Gauss Blur Pyramid
- Median
- Bilateral Filter
- Custom Convolution Kernel
- DoG (Difference of Gaussian)
- BackgroundSubtraction
- Difference
- Laplace
- Sobel
- Gamma Correction
- Luminace
- Thresholding
- Harris Corner Detection
- Optical Flow
- Bloom
- Depth of Field (DoF)
- Liquid FX Filter
- Summed Area Table (SAT)
- Distance Transform (Jumpflood), Voronoi, Distance Map
- Min/Max (global)
- Min/Max (local)
- Merge Shader
- FlowField
- Line Integral Convolution (LIC) / Streamlines
- ...
+ AntiAliasing (GLSL)
- MSAA (Processing Default)
- FXAA
- SMAA
- GBAA/DEAA
+ Shadertoy (GLSL)
- Wrapper for running existing Shadertoy sketches inside Processing.
+ Utils
- HalfEdge
- Subdivision Polyhedra
- Sampling
- GLSL-Shader PreProcessor (#define, #include)
- GLSL-Shader Uniform Caching
- ...
```

JavaDoc: http://thomasdiewald.com/processing/libraries/pixelflow/reference/index.html


## Download
+ [Releases](https://github.com/diwi/PixelFlow/releases)
+ [PixelFlow Website](http://thomasdiewald.com/processing/libraries/pixelflow)
+ Processing IDE -> Library Manager


## Videos / Examples / Demos / Applications

#### Skylight Renderer
[alt text](https://vimeo.com/238654801 "Skylight Renderer - Ambient Occlusion / Soft Shadows")
[alt text](https://vimeo.com/206696210 "Skylight - Cloth Simulation")
[alt text](https://vimeo.com/206696738 "Skylight - Poisson Spheres")
[alt text](https://vimeo.com/218485498 "Rigid Body - Menger Sponge")
[alt text](https://vimeo.com/211395605 "Rigid Origami Simulation")

#### Softbody Dynamics
[alt text](https://vimeo.com/184854758 "SoftBody Dynamics 3D - Playground, Cloth Simulation")
[alt text](https://vimeo.com/184854746 "SoftBody Dynamics 3D - Cloth Simulation")
[alt text](https://vimeo.com/184853892 "SoftBody Dynamics 2D - Playground")

#### Computational Fluid Dynamics
[alt text](https://vimeo.com/184850259 "WindTunnel")
[alt text](https://vimeo.com/184850254 "StreamLines")
[alt text](https://vimeo.com/184849960 "Verlet Particle Collision System")
[alt text](https://vimeo.com/184849959 "Fluid Particles")
[alt text](https://vimeo.com/184849892 "Liquid Painting - M.C. Escher")
[alt text](https://vimeo.com/184849880 "Liquid Text")

#### Optical Flow
[alt text](https://vimeo.com/184850333 "Optical Flow - Fluid Simulation - MovieClip")
[alt text](https://vimeo.com/225484146 "MovieWall")
[alt text](https://vimeo.com/225671748 "VoxelCapture")

#### Flow Field Particle Simulation
[alt text](https://vimeo.com/236955859 "Flow Field Particles - Trails HD")
[alt text](https://vimeo.com/236964112 "Flow Field Particles - Trails HD - 100K Particles")
[alt text](https://vimeo.com/236821149 "Flow Field Particles - DevDemo [R&D]")

#### Flow Field - LIC
[alt text](https://vimeo.com/237766186 "LIC - WindTunnel")
[alt text](https://vimeo.com/237491566 "LIC - First Results")

#### Realtime 2D Radiosity - Global Illumination (GI)
[alt text](https://vimeo.com/243877934 "Tetris + Realtime Radiosity")
[alt text](https://vimeo.com/244191105 "Radiant Poisson Disks")
[alt text](https://vimeo.com/226554155 "Realtime GI - LiquidFun/Box2D")
[alt text](https://vimeo.com/226784500 "Realtime GI - LiquidFun/Box2D")
[alt text](https://vimeo.com/226939350 "Realtime GI - LiquidFun/Box2D")
[alt text](https://vimeo.com/214264003 "Realtime GI - Random Modelling")
[alt text](https://vimeo.com/226790885 "Realtime GI - Cornell Box")

#### Space Syntax

[alt text](https://vimeo.com/228387816 "SpaceSyntax - Realtime Local Evaluations")
[alt text](https://vimeo.com/232981476 "SpaceSyntax - Realtime Global Evaluations")
[alt text](https://vimeo.com/232576820 "FlowField Pathfinding - Particle Simulation")


More Videos on [Vimeo](https://vimeo.com/user56436843).


## Getting Started - Fluid Simulation

```java

// FLUID SIMULATION EXAMPLE
import com.thomasdiewald.pixelflow.java.DwPixelFlow;
import com.thomasdiewald.pixelflow.java.fluid.DwFluid2D;

// fluid simulation
DwFluid2D fluid;

// render target
PGraphics2D pg_fluid;

public void setup() {
size(800, 800, P2D);

// library context
DwPixelFlow context = new DwPixelFlow(this);

// fluid simulation
fluid = new DwFluid2D(context, width, height, 1);

// some fluid parameters
fluid.param.dissipation_velocity = 0.70f;
fluid.param.dissipation_density = 0.99f;

// adding data to the fluid simulation
fluid.addCallback_FluiData(new DwFluid2D.FluidData() {
public void update(DwFluid2D fluid) {
if (mousePressed) {
float px = mouseX;
float py = height-mouseY;
float vx = (mouseX - pmouseX) * +15;
float vy = (mouseY - pmouseY) * -15;
fluid.addVelocity(px, py, 14, vx, vy);
fluid.addDensity (px, py, 20, 0.0f, 0.4f, 1.0f, 1.0f);
fluid.addDensity (px, py, 8, 1.0f, 1.0f, 1.0f, 1.0f);
}
}
});

pg_fluid = (PGraphics2D) createGraphics(width, height, P2D);
}

public void draw() {
// update simulation
fluid.update();

// clear render target
pg_fluid.beginDraw();
pg_fluid.background(0);
pg_fluid.endDraw();

// render fluid stuff
fluid.renderFluidTextures(pg_fluid, 0);

// display
image(pg_fluid, 0, 0);
}

```


## Installation, Processing IDE

- Download [Processing 3](https://processing.org/download/?processing)
- Install PixelFlow via the Library Manager.
- Or manually, unzip and put the extracted PixelFlow folder into the libraries folder of your Processing sketches. Reference and examples are included in the PixelFlow folder.

- Also make sure you have the latest graphics card driver installed!

#### Platforms
Windows, Linux, MacOSX


## Dependencies, to run the examples

- **Video, by the Processing Foundation**

https://processing.org/reference/libraries/video/index.html

- **ControlP5, by Andreas Schlegel**

http://www.sojamo.de/libraries/controlP5

- **PeasyCam, by Jonathan Feinberg**

http://mrfeinberg.com/peasycam

- **HE_Mesh, by Frederik Vanhoutte**

https://github.com/wblut/HE_Mesh


## Processing/Java Alternatives

### JRubyArt
[JRubyArt](https://github.com/ruby-processing/JRubyArt) is a ruby wrapper for processing by [Martin Prout (monkstone)](https://github.com/monkstone)
- Blog: https://monkstone.github.io/
- Setup: http://ruby-processing.github.io/JRubyArt/
- Demos: [JRubyArt Pixelflow Examples](https://github.com/ruby-processing/JRubyArt-examples/tree/master/external_library/java/PixelFlow)