   [solved] Volume texture won't render
  Hello, I'm working on an OpenGL project and am attemping to use a volume texture as a texture atlas. The problem is that when I try to test it by rendering one of the slices, I just get a white square. I know that the data in the atlas is correct because I exported it.Here are the relevent functions:uint32_t atlas_build( uint32_t type ){atlas_t* atlas;atlas = atlases[type];if( atlas->modified ){atlas->modified = 0;glDeleteTextures( 1, &atlas->handle );glGenTextures( 1, &atlas->handle );glBindTexture( GL_TEXTURE_3D, atlas->handle );glTexImage3D( GL_TEXTURE_3D, 0, 4, atlas->width, atlas->height, atlas->depth, 0, GL_RGBA, GL_UNSIGNED_BYTE, atlas->data );}return atlas->handle;}void video_initialize( int32_t count, int8_t** arguments ){video_parse( count, arguments  );if( SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ) == -1 ){log_print( LOG_ERROR, "SDL_GL_SetAttribute failed in video_initialize" );}if( SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 ) == -1 ){log_print( LOG_ERROR, "SDL_GL_SetAttribute failed in video_initialize" );}if( SDL_SetVideoMode( SCREENWIDTH, SCREENHEIGHT, 32, ( SDL_OPENGL | SDL_SWSURFACE ) ) == NULL ){log_print( LOG_ERROR, "SDL_SetVideoMode failed in video_initialize" );}glewInit();glShadeModel( GL_FLAT );glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );glClearDepth( 1.0f );glEnable( GL_DEPTH_TEST );glDepthFunc( GL_LEQUAL );glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST );glEnable( GL_TEXTURE_3D );glTexParameterf( GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );glTexParameterf( GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );glTexParameterf( GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE );glTexParameterf( GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );glTexParameterf( GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );glViewport( 0, 0, SCREENWIDTH, SCREENHEIGHT );glMatrixMode( GL_PROJECTION );glLoadIdentity();gluPerspective( 45.0f, (GLfloat)SCREENWIDTH / (GLfloat)SCREENHEIGHT, 0.1f, 1000.0f );glMatrixMode( GL_MODELVIEW );glLoadIdentity();return;}void video_run( void ){uint32_t error;glBindTexture( GL_TEXTURE_3D, atlas_build( ATLAS_TEXTURES ) );error = glGetError();glBegin( GL_QUADS );//glColor3f( 1.0f, 1.0f, 1.0f );glTexCoord3f( 0.0f, 0.0f, 0.0f );glVertex3f( -1.0f, -1.0f, -3.0f );glTexCoord3f( 1.0f, 0.0f, 0.0f );glVertex3f( 1.0f, -1.0f, -3.0f );glTexCoord3f( 1.0f, 1.0f, 0.0f );glVertex3f( 1.0f, 1.0f, -3.0f );glTexCoord3f( 0.0f, 1.0f, 0.0f );glVertex3f( -1.0f, 1.0f, -3.0f );glEnd();SDL_GL_SwapBuffers();return;}The dimensions are 2048*2048*2, which my video card does support. I've tried different formats for glTexImage3D, but nothing has worked. glGetError returns zero. I've tried Google, but there isn't a lot of info on 3D textures.[Edited by - Scet on April 21, 2010 3:16:26 PM]
  You are missing some calls when you create the textureglBindTexture( GL_TEXTURE_3D, atlas->handle );glTexImage3D( GL_TEXTURE_3D, 0, 4, atlas->width, atlas->height, atlas->depth, 0, GL_RGBA, GL_UNSIGNED_BYTE, atlas->data );See http://www.opengl.org/wiki/Common_Mistakes#Creating_a_TextureAlso, move into the modern agehttp://www.opengl.org/wiki/Common_Mistakes#Image_precision;  Thanks, problem was that building the texture resets the filter states.   ;  filters are not GL states. they are part of the texture objects. you must set them when you create a texture.   