Access Texture Buffer Object from Vertex shader

Hi all,

I’m a bit confused about accessing a TBO using a shader. Do they actually bind to a texture number? (glActiveTexture(GL_TEXTURE1)). I’m currently working with the new samplerBuffer sampler. Problem is that I want to provide 2 TBO’s to my vertex shader. How do I provide them as a uniform variable to my shader?

Thanks in advance!

If you mean textures, it’s the same like for fragment shader. Remember that for the GF6/7 only 32 bit floatingpoint textures are supported…

I did not tested the TBO yet however from the extension specification it looks that you associate texture object with TBO using something like:

GLuint texture_id ;
glGenTextures( 1, &texture_id ) ;
glBindTexture( GL_TEXTURE_BUFFER_EXT, texture_id ) ;
glTexBufferEXT( GL_TEXTURE_BUFFER_EXT, GL_RGBA8, TBOid ) ;

For rendering you use them like any other texture by binding the texture_id to texture unit using the GL_TEXTURE_BUFFER_EXT target and setting the sampler uniform to index of that unit.

Thank for the replies. I’m slowly getting the hang of how TBO’s work. Is there a way to copy buffer objects GPU-side? So without mapping the buffer, or copying to CPU.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.