TEXTURE_3D Help

Hi!

I’m trying to use a 3D texture for blending, so I upload four textures into the 3D Texture.

I would assume that I could use the third texture coordinate to switch between the different layers in the 3D texture. For instance if I wanted to use the first layer the third texture coordinate value would be 0.0f, and if wanted to use the last layer the coordinate would 1.0f is that not possible??? Or did I really miss something here. :confused:

That’s how it works.

That is pretty odd then. I’m using vertex arrays, but i also just wrote a small immediate mode test program like this:

glBegin(GL_QUADS);
glTexCoord3f(0,0,0);
glVertex3f(0,0,0);
glTexCoord3f(0,1,0);
glVertex3f(0,0,1000);
glTexCoord3f(1,1,0);
glVertex3f(1000,0,1000);
glTexCoord3f(1,0,0);
glVertex3f(1000,0,0);
glEnd();

So this should give me the first texture right?
But I’m actually getting the last? Any ideas why?

do you bind the texture with GL_TEXTURE_3D ?

For the behavior you want, I think you want to be clamping to the edge. If the texture is set to repeat, z=0 will be a blend between the top and bottom planes, I think.

Maybe you’ve set a texture matrix that are changing your texcoords. Try loading the identity to the texture matrix.