# PixelFlow
**Repository Path**: bit2atom/PixelFlow
## Basic Information
- **Project Name**: PixelFlow
- **Description**: A Processing/Java library for high performance GPU-Computing (GLSL). Fluid Simulation + SoftBody Dynamics + Optical Flow + Image Processing + Particle Systems + Physics +...
- **Primary Language**: Java
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-08-29
- **Last Updated**: 2020-12-19
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README

# PixelFlow
**A Processing/Java library for high performance GPU-Computing (GLSL).**
## Features
```
+ Fluid Simulation (GLSL)
+ Fluid Particle Systems (GLSL)
+ Optical Flow (GLSL)
+ Harris Corner Detection (GLSL)
+ Image Processing Filters (GLSL)
- Bilateral Filter
- Box Blur
- Custom Convolution Kernel
- DoG (Difference of Gaussian)
- Gaussian Blur
- Laplace
- MedianFilter
- Sobel
- ...
+ Softbody Dynamics (CPU, GLSL is coming)
- 2D and 3D
- Collision Detection
- Cloth, Grids, Chains, ...
- Particle Systems
- etc ...
+ Utils
- HalfEdge
- Subdivision Polyhedra
```
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
#### Softbody Dynamics
[
](https://vimeo.com/184854758 "SoftBody Dynamics 3D - Playground, Cloth Simulation")
[
](https://vimeo.com/184854746 "SoftBody Dynamics 3D - Cloth Simulation")
[
](https://vimeo.com/184853892 SoftBody Dynamics 2D - Playground")
[
](https://vimeo.com/184853883 SoftBody Dynamics 2D - Connected Bodies")
#### Computational Fluid Dynamics
[
](https://vimeo.com/184850259 "WindTunnel")
[
](https://vimeo.com/184850254 "StreamLines")
[
](https://vimeo.com/184849960 "Verlet Particle Collision System")
[
](https://vimeo.com/184849959 "Fluid Particles")
[
](https://vimeo.com/184849892 "Liquid Painting - M.C. Escher")
[
](https://vimeo.com/184849880 "Liquid Text")
More Videos on [Vimeo](https://vimeo.com/user56436843).
## Getting Started
```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.2.1] (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.
#### 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