Back to Blog
Particle illusion 3.0 smoke tutorial6/18/2023 ![]() The second component is crucial for a good looking particle system - a procedural 3D noise field. To eliminate the singularity at the origin, we add a small epsilon term e. The result is a field which is divergence-free everywhere but the origin. The velocity can be computed directly by taking the gradient of this function. Where r is the distance from the origin of the point evaluated. ![]() We generate this by using a source potential from ideal-flow theory, which is a scalar function defined as The first is a repulsive component close to the object that will push the smoke away. Luckily for us though, it turns out that we can find such a field easily with some clever mathematics! First of all, our field will consist of two parts. ![]() This is the mathematical way of saying that the particles don't clump together into a single spot or drift far apart anywhere. For fluids that are incompressible, it's important that this field is divergence-free. The velocity field is a 3D vector function, which tells us how fast a particle is moving at any point in space. We simulate the flow by generating a velocity field for our scene. ![]() The source for this sample can be found in the folder of the SDK. After simulation, the particles are sorted using a GPU-accelerated radix sort, and then rendered as alphablended sprites with volumetric shadows. We use a combination of potential flow theory and procedural noise, to simulate the turbulent wake of smoke moving around an interactive object. This sample uses OpenGL ES 3.1 and compute shaders to seamlessly advect tens of thousands of particles.
0 Comments
Read More
Leave a Reply. |