View Full Version : What is GL_DITHER?

03-03-2002, 02:20 AM

i have a simple question: What is dithering? I cant find any explanation about this in my books and no one in the MSDN library. My english lexicon says: "dither - not to know how to decide".
Great, that doesnt tell me anything.

So, can anyone of you tell me, what it is?


03-03-2002, 03:08 AM
GL_DITHER - If enabled, dither color components or indexes before they are written to the color buffer.

(from the MSDN!)

Dithering is a process whereby a limited colour palette is used to trick the eye into thinking there are more colours (or detail) within am image. A good example are old 16 colour computer games, where different combinations where used to make it look like there where more colours. A lot of printers use dithering to make an image look better.

If you have a reasonable paint program (PSP etc) and reduce the colour of an image from true colour to 8 bit colour you'll see the effect quite nicely.


03-03-2002, 03:16 AM
Ah, now i understand, thanks.

So, itīs no problem, if i disable it?

Because this is enabled by default, and itīs not that good for performance.


03-03-2002, 03:21 AM
It only works for colour indexed mode - in normal 16/32 bit mode I would hope (!) that it is ignored.

BTW - I could be wrong about GL_DITHER ... It might refer to mcraighead writing GL drivers http://www.opengl.org/discussion_boards/ubb/smile.gif

03-03-2002, 08:48 AM
The Red Book says dithering is used by default, in both indexed and RGBA mode.

Even though it might be useless in 32 bit more, remember that OpenGL does not deal with specific color depths. In 12 bit RGBA color buffers, where each channel has 4 bits, ditherring can be very usefull.

03-03-2002, 09:32 AM
So perhaps there is an argument for explicitly disabling it in 32 bit mode. I wonder if dithering applies to mip mapped textures ... hmmmm

03-04-2002, 12:07 AM
I think it's the drivers choise what to do when dithering is enabled or disabled. I think most cards do dithering in 15/16-bit color mode (if it is enabled), but not in 24/32-bit color mode. Basically, the card has a fixed precision in the pipeline (at least 8 bits per component). If the color buffer has a lower precision, the colors are dithered before they are written to the color buffer.