glColorTable on nVidia hardware (TNT2)

I know there has been some discussion about this before, but it hasn’t seemed to help me.

I’m trying to use paletted textures (duh). I get black polygons instead of what I should get. Its not my colormap because I tried memset the whole thing to white… No luck.

I am using glColorTable not glColorTableEXT on 1.2 drivers. In fact EXT_paletted_texture isn’t even supported in this driver (ARB_imaging however is).

Reading the documentation I am a little confused what I can pass into glColorTable, maybe someone can clear it up (this is probably my problem).

I call it like this:

glColorTable (GL_COLOR_TABLE, 4, 256, GL_RGBA, GL_UNSIGNED_BYTE, colormap);

Checking for an error yields that the width of the colormap is 0 (which happens when glColorTable fails). I get an invalid enum error. I’ve tried using GL_RGBA in place of the ‘4’, and it doesn’t error but I still get blackness where there should be rich and wonderful color.

Further error checking shows that my glTexImage2d (GL_TEXTURE_2D, 0, 1, width, height, 0, GL_COLOR_INDEX, GL_UNSIGNED_BYTE, data); works fine as well.

Does anyone have a clue what I’m doing wrong?

P.S. I guess I should mention I retrieve the glColorTable entry point with a call to wglGetProcAddress (“glColorTable”); because Microsoft doesn’t export it from their .dll (and rightly so as its a 1.1 .dll).

TNT/TNT2 does not support paletted textures. That would be why they aren’t in the extension string.

So I guess that means that you are trying to use the GL 1.2 functionality in the nVidia drivers, which means that you would be reverting to software rendering.

I can’t see why it wouldn’t work, albeit slowly.


[This message has been edited by j (edited 05-11-2001).]

I was somewhat sure that the TNT2 does support paletted textures.

If this is so, then I can’t see why nVidia exports ARB_imaging on TNT/TNT2. That means they don’t support glBlendColor, glColorTable, and probably something else that I haven’t discovered yet…

There’s not much more in ARB_imaging (that I’m aware) that would make it worth exporting… If this is the case it would be better to not export it at all.

Besides I should be kicked into software rendering because I’ve used glBlendColor and it does kick me into software. It doesn’t make sense for glBlendColor to go into software but glColorTable to not.

Therefore the TNT/TNT2 supports paletted textures … Haha. funny proof.

Anyone know for sure? (mcraighead I’m looking in your direction .

TNT2 does not support paletted textures, and ARB_imaging has absolutely nothing to do with paletted textures. It is for the pixel path only.

If you want to avoid the error on glColorTable, you need to pass in a valid internalformat. 4 is not an internalformat; GL_RGBA is.

  • Matt

That really chaps my ass.

I was so banking on TNT2 supporting palettized textures. And I guess I just assumed it did.

That sucks. I just wasted a week. haha.

That ruins my day. Oh well.