Hi
I’m trying to use GLSL multi TOP to compute on a pixel data for anaother pixel without data concurrency. I want to try some SSBO architecture, but the documention and tuto are extremly poor on this subject. For instance how to use Buffers tab in GLSL TOP parameters?
Any help, info, example would be appreciated.
Cheers
Hey, can you be more specific about your usage case? Likely you’d want use a compute shader with shared memory, as that is the main way to have a thread cooperatively work with other threads in the workgroup.
Hi Malcolm
Thank u for taking in account my question.
Simplified Use case :
There is a set of particles for which I want to simulate gravity forces and mouvement (N Body problem). I have one texture for positions and mass. My need is to compute a density grid which is the sum of particles mass in a given region of space which one cell of the density grid.
To do that, one way is for each position pixel shader call, to increment the density grid cell a cording to the current pixel position.
Obviously in a cell there can be several particles. So it’s requiered to manage concurrency write. I had tried accumulation counter but without success… The TD doc is too poor about that… and about shared memory…
That’s why I’m looking for help 
Cheers
You’ll want to use a compute shader in that case. When in that mode your output textures are image2D etc, which you can use functions such as imageAtomicAdd() on.
The particlesGpu examples in the ‘Tools’ section of the palette also shows how to deal with persistent state between frames for complex simulations like this.
The ‘Buffers’ input on the GLSL TOP is just to gain access to reading buffers from POPs, it’s not a way to gain access to arbitrary spot to read/write data.
1 Like
Hi Malcom
Thank u for your advises and explanations. I will try atomic function asap.
See u