caffeineviking / cnpf Goto Github PK
View Code? Open in Web Editor NEWCurl-Noise Particle Flow using OpenCL
License: MIT License
Curl-Noise Particle Flow using OpenCL
License: MIT License
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.
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).
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.
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.
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).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.