how to use PFNGLCOLORTABLEEXTPROC??
I want to use a look_up table for the texture pixels. now i found that "glColorTableEXT" might help.
my code is :
glEnable(GL_COLOR_TABLE);
glEnable(GL_SHARED_TEXTURE_PALETTE_EXT);
glTexImage2D(GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, pack->width, pack->height,
0, GL_COLOR_INDEX, GL_UNSIGNED_BYTE, pack->texture);
and use:
PFNGLCOLORTABLEEXTPROC glColorTableEXT = (PFNGLCOLORTABLEEXTPROC) wglGetProcAddress("glColorTableEXT");
glColorTableEXT (GL_SHARED_TEXTURE_PALETTE_EXT, GL_RGBA, 256, GL_RGBA, GL_UNSIGNED_BYTE, rgba_table);
to set the lookup table, but the question is that i dont know how to set the rgba_table of the glColorTableEXT? what is that "void* parameter" 's structure?
How can i construct the rgba_table? and how opengl look up a color through the table?
Can anyone help me? thx~~~~~~
I think that should be
glColorTableEXT(GL_TEXTURE_2D, GL_RGBA8, 256, GL_RGBA, GL_UNSIGNED_BYTE, rgba_table);
and rgba_table should be an array of 256 elements
GLubyte rgba_table[256];
glColorTableEXT(GL_TEXTURE_2D, GL_RGBA8, 256, GL_RGBA, GL_UNSIGNED_BYTE, rgba_table);
and rgba_table should be an array of 256 elements
GLubyte rgba_table[256];
does that mean the pixel value range of the texture image is 0~255?
so an table of 256 entries will work...
so an table of 256 entries will work...
GL_EXT_shared_texture_palette extension seems not supported on my GeForce 8500GT graphic card........
i just want to implement a feature that the texture could be dynamicly modified based on a lookup table, which pixel value of the image is a index and corresponding entry is the color.so i can just change the table and texture will be changed.....
anyone have any idea to implement it without using the GL_EXT_shared_texture_palette????
thx~~~~~
i just want to implement a feature that the texture could be dynamicly modified based on a lookup table, which pixel value of the image is a index and corresponding entry is the color.so i can just change the table and texture will be changed.....
anyone have any idea to implement it without using the GL_EXT_shared_texture_palette????
thx~~~~~
Quote:Original post by alexsando
GL_EXT_shared_texture_palette extension seems not supported on my GeForce 8500GT graphic card........
i just want to implement a feature that the texture could be dynamicly modified based on a lookup table, which pixel value of the image is a index and corresponding entry is the color.so i can just change the table and texture will be changed.....
anyone have any idea to implement it without using the GL_EXT_shared_texture_palette????
thx~~~~~
Well you can do it using GLSL Shaders.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement