What is GL_DITHER?


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?


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.


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.


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

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.

So perhaps there is an argument for explicitly disabling it in 32 bit mode. I wonder if dithering applies to mip mapped textures … hmmmm

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.