title: How to do particle binning in OpenGL?
body: <p>Currently I'm creating a particle system and I would like to transfer most of the work to the GPU using OpenGL, for gaining experience and performance reasons. At the moment, there are multiple particles scattered through the space (these are currently still created on the CPU). I would more or less like to create a histogram of them. If I understand correctly, for this I would first translate all the particles from world coordinates to screen coordinates in a vertex shader. However, now I want to do the following:</p>
  
  <p><a href="https://i.stack.imgur.com/OQQIv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OQQIv.png" alt="enter image description here"></a> </p>
  
  <p>So, for each pixel a hit count of how many particles are inside. Each particle will also have several properties (e.g. a colour) and I would like to sum them for every pixel (as shown in the lower-right corner). Would this be possible using OpenGL? If so, how?</p>