Volume texture problems!

I’m having a hard time trying to get a volume texture onto a model and I can’t figure out why. Here’s some background info:

  • The volume texture is created with glTexImage3D(). I did a glGetTexImage() at the time of drawing just to verify if the image bits are correct and they seem to be.

  • The model data already contains texture coords for 2 textures. I’m using ARB vertex program to do the transform and also generate a 3rd texture coord for the volume texture.

  • GL_TEXTURE_3D enabled, STR set to repeat and texture bound (properly I hope).

When I render this model, the volume texture portion doesn’t appear (the other textures are fine). Then as a test, I did a passthru of the volume texture coords (GL_PASS_THROUGH_NV) and “colors” appeared, which to my understanding means that there are coordinate values for this texture channel at the verts!

So any idea why I’m just getting black? Any educated guesses for things to check? I’d settle for getting a wrong image right about now! :wink:


Make sure you have the filtering set correctly.
Defaults are mipmaps even for 3D textures. Use GL_NEAREST or GL_LINEAR first.

The rest could be more easily seen by showing the relevant code excerpts (3D texture object init and vertex and fragment program used.

With GL_PASS_THROUGH_NV you mean you have something setup for NV_texture_shader?

Try to removing anything except the 3D texture related code.

An invalid texture object or texture environment setup should result in white rather than black, because the texture unit should act as if though disabled if something’s wrong with your setup.

It’s hard to guess what might be wrong without more information. What size/format is your texture? Does it fit in video memory? Do you use mipmapping? Are you using vertex/fragment programs or anything fancy like that? What does your texture environment setup look like?

– Tom

Thanks for the quick replies!

D’oh! Relic, your suggestion did the trick! I used LINEAR for the MIN filter and that worked! MAG is already LINEAR.

Yes, as a test I set up NV_texture_shader and output the tex coords via Passthrough, just to see if my vertex program was outputing them correctly - which it was.

Thanks again!