color banding

hey, i have a quick question. so i’m drawing a quad with lighting and smooth shading enabled (no texturing & a 32 bit color buffer). when i take a screen capture and zoom in on the quad, i’m getting banding. example:

http://www.graphics.cornell.edu/~letteh/gl/colorBanding.jpg

since each color band (which is multiple pixels in height) differs by more than 1 in the green channel, i’m not sure why opengl isn’t interpolating further? the quad is all one color/material and it only has a single normal. where is this banding coming from? any ideas? thanks!
-lost hope

What’s your color quality in the display properties -> settings?

Failing that it could be limited precision in the interpolants in your particular OpenGL implementation.

my display is set to 32 bit color, and i’m using the latest drivers from nvidia (FX5900 & opengl 1.5). the image i posted is zoomed in pretty far, but regardless, there is definite banding that could be further interpolated. there must be something simple i’m missing. hmmm?

Even in 32 bit color, banding is still possible. To convince yourself it’s not the GL’s fault, create a gradient fill pattern in your paint program with a difference of one in green, say (0,128,0),(0,127,0),(0,126,0),(0,125,0). I can see banding with these 4 bars spread across a 256 pixel wide image. Even with pixel-perfect linear interpolation, banding is still visible.

yes, that case makes sense to me, because the colors are changing by a single value in the green channel (128->127->126->125). but what i’m seeing are the following bands:
(0, 148, 0)
(0, 151, 0)
(0, 153, 0)
(0, 157, 0)
(0, 160, 0)
etc…
where each band is a few pixels in height. i guess i was expecting GL to interpolate the intermediate values across the bands.

Just an idea : are you screencapturing directly to Jpeg ? Because this format has a poor color resolution.

hey there,
no, i’m just using the standard “printscreen” button, and then pasting the image into photoshop. in some cases, you can actually seen the banding (very slight, mind you) as the program is running – so i’m pretty certain it isn’t a screen capture issue. maybe i’m just being overly critical, and this isn’t even an issue at all, but rather normal GL behavior? i just thought somebody might have seen/wondered about this before and knew the answer.
-lost hope

I made a quick test case on this, both with a gradient made by colors and by normals, and even if I can see a very faint banding, the progression was only one by one in the green component, as described by Q.

GF3ti200 detonator 45.23

Really sure your desktop is in 32 bit mode ? Really sure Photoshop is not 16bit by default ?

ok, sorry – i’m a bit of an idiot =) that image i posted was contrast enhanced (in photoshop), so that was what was causing the extreme banding. the reason i jacked up the contrast, was that i noticed subtle banding… and i wanted to see whether it was my imagination or not. stupid =) so i took another screenshot, and although there are still some visible bands, the values are changing by 1 (just like you described). thanks for checking that out, zbuffer! it made me go back and evaluate what i was doing :wink:

the reason i jacked up the contrast, was that i noticed subtle banding… and i wanted to see whether it was my imagination or not.
This used to drive me crazy too. The basic problem is that 256 shades of green aren’t enough to fool the eye completely (the eye is mighty sensitive to changes in intensity). Maybe someday we’ll have 64 bit color in our displays(64K shades of green!).

He stated that he has >1 diff between bands. Yes, depending on gamma 8 bit may not be enough, however, this looks like there’s more quantizing than you would expect from 8 bit.