You just need to mulitply the vertex position with the scale factor and add the sphere's world position. Hardly an expensive operation, 3 MADs.
Do you have the correct buffer (not texture) bound to GL_TEXTURE_BUFFER at the time?
I didn't! Nice catch, thank you. So here's the updated version:
Code:
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_BUFFER, TBO_TEX_ID);
glBindBuffer(GL_TEXTURE_BUFFER, TBO_ID);
glBufferData(GL_TEXTURE_BUFFER, sphere_array_size, spheres, GL_DYNAMIC_DRAW);
// spheres is an array of floats, containing the positions of the spheres, laid out as such:
// sphere0x, sphere0y, sphere0z, sphere1x, sphere1y, sphere1z, sphere2x, sphere2y, sphere2z, etc.
glTexBuffer(GL_TEXTURE_BUFFER, GL_RGB32F, TBO_ID);
glUniform1i(u_TBO_ID, 0);
The error is gone. However, my TBO still appears to contain only zeros, as read in the shader.
Edit: never mind, problem fixed, it was a stupid error related to the size of my array of data.
Last edited: