GithubHelp home page GithubHelp logo

caffeineviking / cnpf Goto Github PK

View Code? Open in Web Editor NEW
21.0 7.0 0.0 83.81 MB

Curl-Noise Particle Flow using OpenCL

License: MIT License

Makefile 0.42% C++ 82.31% Lua 1.77% GLSL 5.97% C 9.53%
curl-noise rendering gpu visualization vector-field fluid particles opencl

cnpf's Issues

Timer for particles

I think we need a timer for the particles. Probably implemented as a cl::Buffer with a float for each particle. Each frame we call a kernel which checks if the value for a given particle is below 0 and re-randomize the position of the particle.

Curl-Noise "Black Hole" Behaviour

When attempting to apply velocities to the particles in respect to the generated curl-noise we get these "black holes", where all particles seem to converge to a singular point around them. Martin has fixed the issue with the "particle lines" that seemed to happened before, now only this issue remains.

We need to figure our what's the source of the problem. Rasmus has created a Processing demo of the particle simulation using curl-noise, and seems to be getting the correct behaviour. My suggestion is that we analyze both the curl-noise implementation and the particle system implementation of his demo and try to see if there are any discrepancies in the results we get (alternatively we can see what other people seem to be getting by applying curl to the simplex noise). In particular, I suggest we do the following: we generate the curl-noise in the Processing application, since we know that it produces a valid curl vector field, write it to an image, and load it in our C++ implementation. If the particles behave better, then we need to look into where our C++ curl-noise implementation differs from the Processing one and fix it, or, if the behaviour is still wrong in our C++ implementation, despite having the correct curl vector field, then in the particle system we must have missed something or made some erronous assumption about the field.

It would be nice if we could get some images of the problems here so we can discuss it better, I still have problems with my open-source drivers which I'll try to fix in the weekend (alternatively, I'll implement a software backend for the particle simulation). We should discuss this problem, and see if anyone can find a solution or motivation why we get these weird particle "black holes" (alt. motivate why they are correct).

Particles doesn't follow background field perfectly

When not mixing background field with noise the particles doesn't follow the field correctly. It still respects boundaries but seems to be slightly offset in relation to the direction of the background field. It is probably caused either by the curl implementation in the OpenCL kernel or by the camera implementation.

Preprocessing of vector fields

Since we aren't using hardware acceleration for the construction of the vector fields we probably have to fetch them from preprocessed images if we want live demo.

Non-Accelerated Particle Simulation

For easier project building and better support/portability, we should also implement a software back-end for the particle simulation. Since the OpenCL kernel isn't especially complicated, it shouldn't be very hard to implement it (but might be hard to make they work alongside each other). I'll try to implement this in a weekend, by providing a build flag telling what back-end we should use (i.e. DISABLE_OPENCL) and also an extra flag telling (if OpenCL is enabled) which hardware accelerator should be used (i.e. CLDEVICE).

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.