Using for particle system entirely on the GPU

    Jan 10 2017 | 5:08 pm
    I'm currently working on some experiments where I'm using to run a particle system which stays entirely on the GPU. I'm pleased with what I'm seeing so far, but have hit a bit of a dead end and have been banging my head against a brick wall trying to get past this, so wondered if somebody with some more or glsl experience could help me out...
    The principle appears to work fine, and I've been able to make nice looking particle systems with well over 500,000 points that run at 30fps on my iMac, with a single texture holding particles x, y, age and opacity. However, I'm now wanting to use the particle x and y positions to look up data from another texture, and this is where I'm hitting trouble. The attached patch illustrates this: I am taking a camera input, passing this into a texture, and then I want the particles to take their opacity value from the nearest corresponding pixel in the camera image. I can achieve the effect that I want when I have the particles arranged in a nice neat grid (with coordinates generated from a jit.gencoord ) but when I use noise to generate the particle positions, it reveals that there's something going wrong in the sampling process. In the attached patch, I'd like the image from the camera to remain readable even as the particles positions become randomly spread: the is supposed to be sampling the camera texture based on the x and y positions of each particle. Try crossfading from the noise to the grid and see what happens.
    Any input on this would be very much appreciated! I'm planning to combine this with a stam fluid implementation on the GPU and will share here if I get it all working!
    code for texturetogeo shader:
    Geometry from texture

    • Jan 10 2017 | 5:23 pm
      OK. Why is it that 5 minutes after asking for help here, I always seem to find the solution? At least, I think I've found the solution. The problem was not with the at all, but with the shader that was transforming the texture data into vertex data: it was interpolating the incoming texture, and I found on the forums that sending a message 'sendoutput filter none' to the immediately before the solved the problem. Hope this might be useful for somebody else in the future...
    • Jan 10 2017 | 7:01 pm
      Asking for help teaches humility. Finding the solution for yourself 5 minutes after being humble teaches you patience and impulse control. :-)
    • Jan 11 2017 | 11:24 am
      I'm sure it also has something to do with turning my usual chaotic patchers into something that I hope that other people might be able to understand: in doing so, I begin to understand them a little more myself...
    • Feb 19 2017 | 6:15 am
      Hey Tom, I saw on your Vimeo page that you got this particle system linked up to a GPU fluid solver. The clips that you posted look fantastic! Would you consider posting your patch here? I've been looking at other GPU-based fluid sims (most recently, the one posted over here: ) and would love to see what's going on in your implementation.
    • Feb 20 2017 | 3:09 pm
      Hi Syrinx,
      I'm planning to share the patch here, but will need to do some tidying up first... once my current project calms down a bit I hope to get on to it.