Here’s what I’d like to do, maybe someone can help me out.
I have a 3D texture loaded in texture memory.
I have a grid of vertices rendered as GL_POINTS
In a vertex shader I want to load texels at the
right texture coordinate to change the
vertex/point color in the shader.
For one thing I can not change gl_FrontColor in the vertex shader as soon as I enable my 3D texture. Furthermore I can’t seem to fetch the correct texel (or actually voxel) from my 3D texture.
Texture access from vertex shader is hardware accelerated only if:
-GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS > 0
-texture is 1D or 2D
-texture has FLOAT32 format
-texture has no border texels
Also:
-the bias parameter is not accepted in a vertex shader
-if a mipmapped texture is accessed from a vertex shader, the base texture is used.
These restrictions are true for GeForce 6 and 7.
GeForce 8 has unified shader architecture.
No Radeon currently available can do that. The upcoming GPU from ATI surely will.
So, if you want hardware acceletration and copatibility with current ATI GPU’s you have no alternative but to use ARB_pixel_buffer_object.
Does enabling the texture…
Actually, shaders replace fixed functionality so you don’t have to enable texture - just bind it. For the same reason your vertex shader must pass color and texture coordinates to fragment shader if it uses these.