This means that all of the particles can move ballistically, which is much simpler to compute. The randomized collisions are implemented by taking all of the particles within a certain region of space (a grid cell, lets say) and rotating their velocities relative to the center of mass velocity of the cell by a random amount. So, why does this work? Basically, by removing the average component of their velocities, what’s left is something that is ignored anyhow by continuum fluid approaches – a specific distribution of fluctuations around the average. So in the limit of the continuum fluid, it doesn’t matter all that much what we do to this distribution so long as it doesn’t persist on long timescales. This process is basically the ‘particle-based’ version of the collision step in the Lattice-Boltzmann algorithm. It serves to let particles influence each other in a general way without worrying about the details of the interactions. The main downside of SRD is that its somewhat hard to do anything other than a simple uniform fluid with it (e.g. its difficult to model something like surface tension). You can however get some spectacular bugs when you try.īecause we’re basically going to be simulating particles on the GPU, we have to take a step back and think about how we’re going to pack the data in. There are two main steps to the algorithm – streaming the particles according to their velocity, and then gather particles in each grid cell and rotate them around the grid’s average velocity.Įach particle has an x and y coordinate as well as an x and y velocity. We probably need more precision than a single byte color offers, so I’m going to use the OES_float_texture extension for WebGL, that lets us have 4 byte per color floating point textures.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |