
384 V Mobile Devices
GL_FALSE ,
sizeof( XFormFeedbackParticle ),
0) ;
glVertexAttribPointer ( m_UpdatedParticleAttribLocation ,
4,
GL_FLOAT ,
GL_FALSE ,
sizeof( XFormFeedbackParticle ),
24) ;
glVertexAttribPointer ( m_UpdatedParticleLifeLocation ,
1,
GL_FLOAT ,
GL_FALSE ,
sizeof( XFormFeedbackParticle ),
40) ;
5. Render the particles (instances). The function allows to specify how many
vertices belong to each instance and how many instances we want to render.
Note that when using instancing, we are able to access a built-in variable
gl_InstanceID inside the vertex shader. This variable specifies the ID of
the instance we are currently rendering and can be used