[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: NVidia drivers and glPixelMap

Francesco Orsenigo wrote:
I'm drawing colored bitmap fonts, changing the color pattern with glPixelMap().
I call
//float table_r[], table_g[], table_b[], table_a[];
glPixelMapfv(GL_PIXEL_MAP_I_TO_R, 256, table_r);
glPixelMapfv(GL_PIXEL_MAP_I_TO_G, 256, table_g);
glPixelMapfv(GL_PIXEL_MAP_I_TO_B, 256, table_b);
glPixelMapfv(GL_PIXEL_MAP_I_TO_A, 256, table_a);

I do this both after and before changeing the raster position.
Then i call glDrawPixel() and draw the font bitmap.

With Mesa this works ok, but when i use the nvidia drivers, only the first set of glPixelMap() calls is considered: consequent calls take effect only when i reset the window (and so the GL context, i suppose) with freeglut.
I could not determine if this behavior follows the GL specification.
I tried with both nvidia drivers 1.0-5336 and 1.0-4496.
Is this a nvidia bug (if so, where may i submit a bug report?) or something else?
I would say there is a high probability that this is a bug - glPixelMap
is an extremely dark and dusty corner of the OpenGL API - you are probably
the first person I've ever come across who ever used it!

Then add to that that GL_PIXEL_MAP_I_TO_whatever modes are only applicable
to indexed-mode rendering...Indexed rendering went out of fashion about 10
years ago!

That low amount of testing could easily mean that Mesa or nVidia (or both!)
are broken.

I agree that this *should* work - but because it's such an unbelievable
WEIRD use of modern OpenGL, I'd be quite suprised if you could get anyone
very interested in fixing it.

You need to get out from using indexed mode rendering - in general, it's
very poorly supported.

IMHO, Bitmaps are a poor way to do fonts in OpenGL - use a luminance texture
map to modulate the intensity and/or alpha of a coloured polygon - use one
map to hold all the characters in the font, choose your texture coordinates
to select which letter is being drawn.

Bitmaps are inefficient because the bitmap has to be transferred over the
bus to the hardware for every character you draw.  With a texture, you only
send them once and they are there for as long as you need them.  Also, since
most programs are rendering TONS of textured polygons - and very few are using
bitmaps, textures are heavily optimised and bitmaps are typically not well

The second law of Frisbee throwing states: "Never precede any maneuver
by a comment more predictive than "Watch this!"...it turns out that
this also applies to writing Fragment Shaders.
Steve Baker                      (817)619-2657 (Vox/Vox-Mail)
L3Com/Link Simulation & Training (817)619-2466 (Fax)
Work: sjbaker@link.com           http://www.link.com
Home: sjbaker1@airmail.net       http://www.sjbaker.org