Based on the Curl-Noise for Procedural Fluid Flow by Bridson et al. from 2007, we designed an implemented an application which enables the simulation and visualization of particles in real-time by calculating each curl-noise iteration purely on the GPU by using OpenCL kernels. We did this by generating a 3-D Simplex noise, and converted it to a vector field by finding the gradient in each point in space. Afterwards, we apply the curl operator on the vector field, which provides a divergence-free vector field (and no particles will therefore get stuck together at any point in space). With this, we can in each step, for every particle, calculate the new position of the particle by assuming a point in the curl-field is the velocity (e.g. in a fluid) of a particle in that position. Since we apply these steps on the GPU by using OpenCL (for the simulation) and OpenGL (for the visualization), and share the buffer state by OpenCL-OpenGL buffer interoperability, we never leave GPU-space, and can therefore do this in real-time, even when rendering a huge number of particle billboards.
You can find our very short article describing this technique over here: Fluid Animation in Real-Time using 3-D Curl-Noise
- Download and place premake5 in your path.
- Install MinGW with everything except ADA and Fortan under
C:\MinGW
(should be default location). - Download GLM and place the
glm
folder with all includes intoC:\MinGW\include
. - Fetch the latest OpenCL headers and find your runtimes (usually the drivers).
- Download the pre-compiled GLFW binaries.
- Copy the
include
directory intoC:\MinGW\include
. - Copy the content of
lib-mingw
intoC:\MinGW\lib
except theglfw3.dll
which you will place under thebin
folder for this repo.
- Copy the
- Download the source for GLEW and copy the
compile_glew.bat
from themisc
folder provided with this repo to the root of the glew source folder.- Run the bat and copy the libraries from
lib
intoC:\MinGW\lib
. Copy theglew32.dll
into theC:\Windows
folder.
- Run the bat and copy the libraries from
- Download CUDA for Nvidia devices.
- Copy content of
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\lib\Win32
toC:\MinGW\lib
. - Copy
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include\CL
to toC:\MinGW\include
.
If you encounter a run-time error about some basic_string funcitonallity, it's caused by the wrong libstdc++-6.dll is first in the path. The easiest solution is to copy it from C:\MinGW\bin to C:\Windows, or to the folder where the binaries are run from.
- Using your favorite package manager, install:
- GLFW with development packages.
- GLEW with development packages.
- Maybe OpenCL hardware runtimes.
- Oh yea, the OpenCL headers too.
- The standard MESA schenanigans.
- AntTweakBar by building source.
- The Premake5 build system.
- If it doesn't work, ask Erik!!
- Make sure library dependencies are in your path.
- Place yourself in the root directory of this project.
- Acquire the latest version of the premake5 build system (add it to your PATH in windows).
- Thereafter, execute
premake5 gmake
if building on Make. - Finally, issue the command
make -C build
and wait. - When complete, either
bin
orlib
are built. - Tests can be run with
bin/*-tests
program. - Shortcuts:
make run
andmake test
.
- See if there any updates upstream:
git remote update
- If you are already working on a feature branch, jump to step 4.
- Create a new branch for your feature:
git branch <feature>
- Change to the feature branch by:
git checkout <feature>
- Start/continue building the feature. Jump to 7 if done.
- Push your changes to your remote feature branch with:
git add -A
(everything) orgit add -u
(updates).git commit -m "Message describing the additions."
- Publish remotely:
git push origin <feature>
- Go back to step 1 or 5 (if working quickly).
- Your feature is done (single/many commits).
- Fetch the changes from upstream first:
- Go to master:
git checkout -b master
- Pull changes:
git pull origin master
- Go to master:
- Rebase your changes on top of
master
:- Back to feature:
git checkout <feature>
- Thereafter, issue:
git rebase master
- Fix any conflicts that may happen...
- Changes now on top of the Git tree.
- Back to feature:
- Finally, go to GitHub and issue PR.
- Listen in on other's feedback!
- Make changes if necessary.
- Back to the master:
git checkout master
- Pat yourself on the back, then goto 1 again.
assets
: contains all resources required at runtime (shaders, textures,...).bin
: contains the built software and accompanying testing suite.build
: stores intermediate object files and generated GNU Make files.obj
: has all of the generated object files given under compilation.Makefile
: automatically generated by executingpremake5 gmake
.*.make
: program specific make config for augmentingMakefile
.
docs
: any generated documentation for this project is over here.include
: both external and internal project headers are here.foreign
: any foreign headers which should be included.project directories
: internal headers for the project.
lib
: any generated libraries from the project reside here.license.md
: please look through this very carefully.premake5.lua
: configuration file for the build system.readme.md
: this file, contains information on the project.share
: any extra data that needs to be bundled should be here.src
: all source code for the project should be located below here.project directories
: source code for specific project build.foreign
: any external source files which might be needed.
tests
: source code for the project's testing suite, using Catch syntax.project directories
: project specific testing suite for one build.