I’m trying to port some volume rendering code from the sgi to a linux/GeForce3 machine. I’m not having much luck as my textures appear as white boxes. All of the necessary extensions seem to be in place and I don’t appear to be creating any glErrors either. I’m trying to use the paletted_textures extension.
I’m wondering if someone could point me to some example code or maybe comment on either what’s missing or what’s wrong with my colorTable and texture loading code below.
Thank you,
Kurt Zimmerman
P.S. Here is my ColorTable code for both sgi and linux respectively:
#ifdef __sgi
glColorTable(GL_TEXTURE_COLOR_TABLE_SGI,
GL_RGBA,
256,
GL_RGBA,
GL_UNSIGNED_BYTE,
my_transfer_function);
#else
ASSERT(glColorTableEXT != NULL);
glColorTableEXT(GL_TEXTURE_3D_EXT,
GL_RGBA,
256,
GL_RGBA,
GL_UNSIGNED_BYTE,
my_transfer_function);
#endif
Here is my sgi and linux texture loading code:
#ifdef __sgi
// set up the texture
glTexImage3D(GL_TEXTURE_3D_EXT, 0,
GL_INTENSITY8,
my_texture->dim1(),
my_texture->dim2(),
my_texture->dim3(),
0,
GL_RED,
GL_UNSIGNED_BYTE,
my_texture->address());
#else
glTexImage3D(GL_TEXTURE_3D_EXT, 0,
GL_COLOR_INDEX8_EXT,
my_texture->dim1(),
my_texture->dim2(),
my_texture->dim3(),
0,
GL_COLOR_INDEX,
GL_UNSIGNED_BYTE,
my_texture->address());
#endif