PDA

View Full Version : wglChoosePixelFormatARB attribute question



pixelita
01-16-2011, 12:32 AM
Hi

How can I know how many max bits to pass as parameters in attributes for
WGL_ALPHA_BITS_ARB,
WGL_DEPTH_BITS_ARB,
WGL_STENCIL_BITS_ARB,
WGL_SAMPLES_ARB,
I use all of these.Is there any limitation of total number of bits they can take together?


Thanks

Aleksandar
01-16-2011, 04:49 AM
I don't quite understand what you meant with "max bit to pass". All attributes you have mentioned are values not flags.

Generally, you can iterate through all supported pixel formats and find a format that suites your needs best.

pixelita
01-16-2011, 05:29 AM
I meant bits and not bit
What are maximal number of bits for these attributes and can I just pass maximal number of bits for each of these attributes?
Is there any side effects of passing maximal values?
I'm a beginner and I can't find any material explaining how to know these correct values.I remember I once read about z-buffer - that if we can afford then better to pass as much as we can (even 32 bits). I dont understand - why I could not afford to have 32 bits for z-bufer?

Thanks

ZbuffeR
01-16-2011, 08:00 AM
Realistic values are 8 bits for alpha and stencil.
24 for depth. 32 bits depth only exists as offscreen buffers.

Number of supported and/or useful samples vary wildly between cards. Using 2 or 4 is good value for decent hardware, drop to 0 if too slow. Can be much larger on some cards, but "available" does not mean "fast enough to be usable".

pixelita
01-16-2011, 09:55 AM
Thank you!

But regards multisampling, what do you mean "if too slow drop to 0" - then will be no multisampling ? I'm using it for polygon antialiasing. Did you mean it makes little difference having 2 samples or not all?

Alfonse Reinheart
01-16-2011, 10:10 AM
He's saying that multisampling costs performance, and therefore if it is too slow for your application, you should turn it off by asking for 0 samples.