OpenGL bitdepths

Started by
6 comments, last by mreiland 18 years, 9 months ago
When using OpenGL you have the ability to specify the exact bitdepth for the Red,Green, and Blue colors. I was just curious, how often do people actually use this to specify something other than the usual? And what were the specific reasons for doing so?
Advertisement
You can?
I thought there were just a few posibilites, depending on the video mode (16 or 24/32) and the video card itself (that's in the 16bpp modes).
Are you referring to the glColor functions?

If so, using glColor3b() - bytes - is going to give you a much lower memory footprint than glColor3f() - floats.
Sorry, I should have been more specific. I'm referring to the relevant WGL and GLX functions. PixelFormat for win32 and Visual for X Windows.
I know I'm probably just ignorant in this respect, but I would really appreciate it if someone would take the time to help me out :)
Quote:Original post by mreiland
I know I'm probably just ignorant in this respect, but I would really appreciate it if someone would take the time to help me out :)


I still don't understand your question.
Please give an example.
well, you can request different bitdepths (e.g. 5-blue, 6-green, 5-red) but they'll only be activated if the video card supports it. The prior is a popular 16-bit format, but if you were to request, say, 7-3-6 (b-g-r) you probably wouldn't get it. (which is why you should always check that what you've requested is actually enabled, and if not, what the bitdepths are that have been enabled.

These days, thanks to hardware advances, most people ask for 24 or 32 bit color (8-8-8 or 8-8-8-8, of course). Remember that these systems for changing the bitdepth were made "way back when" a lot of computer users had old video hardware or ran their display in palettized mode.

So, the answer to your question "what were the reasons for requesting a different bitdepth?", it was usually to get a better bitdepth than was currently being used, or to align the bitdepth with what the images were stored as, etc. It has much less use now than it did then.
Greenspun's Tenth Rule of Programming: "Any sufficiently complicated C or Fortran program contains an ad-hoc, informally-specified bug-ridden slow implementation of half of Common Lisp."
aha, that makes sense :) I had always seen it, and wondered what the use was since the "normal" was, as you said it was :)

Thanks for the response!

This topic is closed to new replies.

Advertisement