Getting ready
Create and allocate three pairs of buffers. The first pair will be for the particle positions, the second for the particle velocities, and the third for the age of each particle. For clarity, we'll refer to the first buffer in each pair as the A buffer, and the second as the B buffer.
Create two vertex arrays. The first vertex array should link the A position buffer with the first vertex attribute (attribute index 0), the A velocity buffer with vertex attribute one, and the A age buffer with vertex attribute two.
The second vertex array should be set up in the same way using the B buffers. The handles to the two vertex arrays will be accessed via the GLuint array named particleArray.
Initialize the A buffers with appropriate ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access