View Full Version : Access Texture Buffer Object from Vertex shader

04-18-2007, 06:35 AM
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!

04-18-2007, 08:05 AM
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...

04-18-2007, 04:08 PM
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.

04-27-2007, 02:55 AM
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.