Efficient way to render particles to a texture using a compute shader

77 views Asked by At

I'm trying to render a particle sytem onto a texture (2048x2048, 2 channels of 16 bits floating precision) using compute shaders. Each particle is basically an 8x8 texture with a position and a scale that I write to it's corresponding place on the texture. Computations to write the texture should be pretty fast : it's a blending depending on the particle texture value.

The final size of each texture usually remain small (it can reach up to 20x20 pixels on the final texture).

The method I'm using is to draw each particle with a different thread. Therefore I draw n particles per work group. I've tried different workgroup sizes but it still feels slow. For something like 500 particles it can take 0.1ms on a 3090Ti (and when I draw bigger particles this delay increase really fast).

Am I doing something wrong here ? Also, I might draw bigger particles later so I'm looking for solution that work for small particles but I'm also interested for solutions to draw bigger ones.

0

There are 0 answers