views:

441

answers:

2

I'm using OpenGL ES on a low-resolution, embedded device.

I've applied a vertical color gradient, using vertex coloring, to a large polygon serving as a backdrop to my rendered scene. I can see clear visible banding artifacts in the color gradient.

My main experience is using software renderers. With software renderers it is common to dither away mach bands and other banding artifacts. We often do this during the quantization step of rendering a frame, where the floating point, high-precision representations of colors are transformed to a lower-precision output (usually with integer components). We achieve dithering by randomly rounding the final integer component either up or down, to insert just the tiniest bit of noise in the image with which to fool the eye into seeing a continuos and smooth blend between colors.

My question is whether I can achieve this using OpenGL ES? Is this kind of dithering part of the OpenGL pipeline, or should I skip vertex-coloring and render the gradient to a texture and apply a bit of noise to it?

A: 

I have never heard of the effect you describe being in the OGL pipe. My knowledge is a bit dated at this point, though, so I may be wrong. I'd give the render to texture a shot if you can.

Paul Nathan
A: 

Have you tried glEnable(GL_DITHER)? It's normally initially enabled, but I've never worked with GL ES or on an embedded device. It may also depend on the color depth you're using in the frame buffer, you're going to get artifacts if you've only got 4 bits per channel.

Lee Baldwin