Jump to content
  • Advertisement
Sign in to follow this  
alexsando

OpenGL how to use PFNGLCOLORTABLEEXTPROC??

This topic is 3786 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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~~~~~~

Share this post


Link to post
Share on other sites
Advertisement
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];

Share this post


Link to post
Share on other sites
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~~~~~

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!