In an experiment I calibrated the luminance of full screen using a
glClearColor command (alpha=0). The luminance varied from 0.1 to 82
cd/m2 as rgb value varied from 0.002 to 1. I've been assuming using
glColor3f should produce the same effect. However, I just found NO
that is NOT the case! With glColor3f command, the screen remained
completely dark till rgb value increased to 0.032, and it jumped from
0 cd/m2 suddenly to about 3 cd/m2 once rgb value is above "threshold".
I also compared the produced luminance under glClearColor and glColor
commands. With the same rgb value 0.04, glClearColor produced
luminance of 2.5 cd/m2 while glColor produced luminance of 4.9 cd/m2!!
This discrepancy was a disaster for me...:( I was wondering if you
know whether what I observed and described above was correct. And
why???
Thanks a lot!
Xinmiao
> Hi,
>
> In an experiment I calibrated the luminance of full screen using a
> glClearColor command (alpha=0). The luminance varied from 0.1 to 82
> cd/m2 as rgb value varied from 0.002 to 1. I've been assuming using
> glColor3f should produce the same effect. However, I just found NO
> that is NOT the case! With glColor3f command, the screen remained
> completely dark till rgb value increased to 0.032, and it jumped from
> 0 cd/m2 suddenly to about 3 cd/m2 once rgb value is above "threshold".
> I also compared the produced luminance under glClearColor and glColor
> commands. With the same rgb value 0.04, glClearColor produced
> luminance of 2.5 cd/m2 while glColor produced luminance of 4.9 cd/m2!!
>
I once met something similar, (flat glColor3f produced different
results compared to glClearColor) at that time the cause was
dithering. Triangles were dithered but the clear-screen was not, I
think I came to the conlusion that this was an implementation bug, but
I am not 100% sure of this. Notice that dithering is active on OpenGL
by default.
On the other hand your results are somewhat opposite (I would have
expected a more even operation from glColor than glClearColor). Have
you double checked that you don't have any unwanted OpenGL features
active (lighting, texturing, ....)
Eero
I think you probably only have a 16 bit color mode.
Try it in 24 bit color.
--
<\___/>
/ O O \
\_____/ FTB.
> I once met something similar, (flat glColor3f produced different
> results compared to glClearColor) at that time the cause was
> dithering. Triangles were dithered but the clear-screen was not, I
> think I came to the conlusion that this was an implementation bug, but
> I am not 100% sure of this. Notice that dithering is active on OpenGL
> by default.
>
> On the other hand your results are somewhat opposite (I would have
> expected a more even operation from glColor than glClearColor). Have
> you double checked that you don't have any unwanted OpenGL features
> active (lighting, texturing, ....)
>
>
> Eero
Thanks! I checked my program and found that I disabled dithering.
glClearColor seems not affected by this and uses dithering anyway. But
glColor follows it, not too surprisingly. For luminance at too low
values, the system just can't do it without dithering... For all those
data I collected before!!!!
Thank you very much for your help...
Thanks! My graphic card is 24 bit.
I think I've figured out why. As Eero previously suggested, it's the
DITHERING! I've already posted a reply message, it hasn't shown up
yet. But in it I mentioned to disable GL_DITHER has different effects
on glClearColor and glColor. I take that back - sorry! That turned off
dithering in both cases.
In any event, with that information I found that only a small part of
my data were affected by the unfortunate careless programming. It was
a big relief.
Thanks a lot again and hope you all have a great week!!!
Xinmiao
Yes, I know that...bit if it's doing dithering then you
don't have it in a 24 bit color mode.
--
<\___/>
/ O O \
\_____/ FTB. The cheat is not dead! <just the claps...>
...... I know that my graphic card is 24 bit and I used the GLUT_RGB
mode. I'm assuming that that means a 24 bit color mode? I apologize
for not being too familiar with jargons since I'm not a very
experienced programmer.
I turned on dithering, and now it's working fine. ^-^
Again I appreciate all the help!
Xinmiao
Well, it is certainly possible to dither in 24-bit color mode,
but it is less likely and certainly less needed.
Xinmiao wrote:
> ...... I know that my graphic card is 24 bit and I used the GLUT_RGB
> mode. I'm assuming that that means a 24 bit color mode? I apologize
> for not being too familiar with jargons since I'm not a very
> experienced programmer.
>
> I turned on dithering, and now it's working fine. ^-^
The board may be capable of 24-bit color, but you may have selected
a mode that doesn't use it. Look at the "Settings" tab of the
"Display Properties" dialog box, then double check in OpenGL by
doing:
GLint sizeBits;
glGetIntegerv (GL_RED_BITS, &sizeBits);
std::cout << "Red bits " << sizeBits << std::endl;
(repeat for GREEN, BLUE and ALPHA)
--
Andy V (OpenGL Alpha Geek)
"In order to make progress, one must leave the door to the unknown ajar."
Richard P. Feynman, quoted by Jagdish Mehra in _The Beat of a Different Drum_.
OpenGL Technical FAQ: http://www.opengl.org/developers/faqs/technical.html
I checked it, it was 4 for all three, so 12 total. I guess that's
because I enabled double buffering? I suppose since I have to use the
double buffer mode to guarantee fast rendering, to dither is the only
way that I can get very low luminance output?
Thanks!!
Xinmiao
Maybe. It all depends on your hardware/OS (which you
haven't told us...)
> I suppose since I have to use the double buffer mode to
> guarantee fast rendering, to dither is the only
> way that I can get very low luminance output?
>
If you can't get 24 bits, then yes. If you want a dithered
screen clear then you might have to draw a big rectangle
instead of using glClear()
--
<\___/>
/ O O \
\_____/ FTB. The Cheat is not dead!
> I checked it, it was 4 for all three, so 12 total. I guess that's
> because I enabled double buffering? I suppose since I have to use the
> double buffer mode to guarantee fast rendering, to dither is the only
> way that I can get very low luminance output?
>
Actually double buffering does not usually drop your colour
resolution to 12 bits. It is more typical that you can get
full 24/32 bit rendering also with it.
But of course this dependes on you hardware and driver
(and operating system?)
Eero
Oops, that I forgot. It's an sgi Indy running IRIX 6.2. And the
graphic card:
Graphics board 0 is "NG1" graphics. Managed (":0.0") 1280x1024 24
bitplanes. ...So is that sufficient information to tell whether I can
get 24 bit even using double buffer mode?
> > I suppose since I have to use the double buffer mode to
> > guarantee fast rendering, to dither is the only
> > way that I can get very low luminance output?
> >
>
> If you can't get 24 bits, then yes. If you want a dithered
> screen clear then you might have to draw a big rectangle
> instead of using glClear()
Actually now I think my initial claim that "glClearColor and glColor
show different effects on displayed luminance" was presumptuous. By
turning on dithering or by default, glClear shows dither effect and
therefore is able to present semi-pseudo high resolution brightness,
and vise versa, and so is glColor. My problem was that in one of the
programs I carelessly disabled dithering and try to draw squares with
a wide range of luminance values including very, very low ones, yet
later found that threshold of luminance presentation thing (I was mad
at glClearColor because I calibrated the screen using that command in
a different program, in which I didn't disable the dithering, a fact
that I didn't realize at that time) By enabling dithering, I'm in a
basically good shape now. However, if I can get a 24 bit resolution
without dithering, that would get rid of the fine patterns (which is
not a big problem for my purpose) and it's like dressing up a
butterfly - making a beautiful thing even more beautiful...
Anyway, I have to thank you all for your kind help, and your patience
as well!!Have a wonderful day!!
Xinmiao
>>>I checked it, it was 4 for all three, so 12 total. I guess that's
>>>because I enabled double buffering?
>>
>>Maybe. It all depends on your hardware/OS (which you
>>haven't told us...)
>
>
> Oops, that I forgot. It's an sgi Indy running IRIX 6.2. And the
> graphic card:
> Graphics board 0 is "NG1" graphics. Managed (":0.0") 1280x1024 24
> bitplanes. ...So is that sufficient information to tell whether I can
> get 24 bit even using double buffer mode?
>
Bad luck. I'm pretty sure you can't get 24 bit double
buffered graphics on that machine.
> Actually now I think my initial claim that "glClearColor and glColor
> show different effects on displayed luminance" was presumptuous. By
> turning on dithering or by default, glClear shows dither effect and
> therefore is able to present semi-pseudo high resolution brightness,
> and vise versa, and so is glColor.
Ok, so no problem then (unless your sensor can resolve
a single pixel...)