PDA

View Full Version : GL_ARB_multisample questions



Harvey_Birdman
01-26-2007, 11:40 AM
1) I have a laptop with an older nVidia GPU that states it is running GL Ver. 1.3.1. I thought the multisampling extension was promoted to the core @ 1.3, but this unit doesn't support the necessary extensions. It has WGL_ARB_pixel_format, but it doesn't have GL_ARB_multisample or WGL_ARB_multisample. What's the deal? Is it a non-compliant implementation?

2) Does anyone have any authoritative information regarding the use of the PIXELFORMATDESCRIPTOR structure when calling SetPixelFormat with multisample pixel formats? It seems redundant (at best), as the pixel parameters are set when calling wglChoosePixelFormatARB, and experimentation shows that passing NULL instead of a pointer to a PFD structure works fine.

robosport
01-26-2007, 06:12 PM
I don't have an answer regarding the version number but I have found it to be hit and miss. The only time I've seen it change in this case is when the driver has been updated. I always check for extensions and verify the function pointers pulled for those extensions.

There is no support for multisample when using PIXELFORMATDESCRIPTOR. I believe this is because it was locked back in 1.1. I use it just to create a temporary DC to get to the function pointers for the ARB_pixel_format extension, or I use it if I verify at runtime the multisample extensions aren't available anyway.

The only technique I've seen to set the multisample level in the pixel format on Windows (since your question includes wgl) is to use the ARB_pixel_format extension (wglChoosePixelFormatARB with attributes array) and not with OS's ChoosePixelFormat (with PIXELFORMATDESCRIPTOR).

zed
01-26-2007, 08:28 PM
IIRC nvidia only stick the extension in the extension string if it runs natively in hardware,
if it saiz 1.3 it should work (if its part of gl1.3) though will be very slow.
though i can see multisample as being an exception to the rule

Harvey_Birdman
01-26-2007, 09:01 PM
Thanks for your replies, guys.

This is why I've always steered clear of extensions and targeted the least common denominator: there is just no consistency. As it is, I check the rev level first, then the extension strings, then if all seems well I acquire function pointers and test them. Works great - safest possible approach. However, if, as zed suggests, nVidia doesn't play by the rules, then I'm not taking advantage of a feature the driver supports (even if it's in software) because the extension string isn't complete. It seems that the most pragmatic approach is to ignore both rev level and extension strings and just try to acquire function pointers, then test them. The rest is pointless if the rules aren't followed.

Robosport: I understand the use of the PFD structure when choosing a pixel format. The question relates to its use in the subsequent SetPixelFormat call. As I'm sure you recall, SetPixelFormat accepts a pointer to the PFD used when acquiring the format number via ChoosePixelFormat. That's my point - if you use wglChoosePixelFormatARB instead of the older ChoosePixelFormat, the PFD parameter passed to SetPixelFormat (which is called afterwards either way) is meaningless, I think. I'd like to be sure, though.

V-man
01-26-2007, 09:03 PM
It depends on the nVidia GPU. It's been a long time but I think I remember that the Geforce 2 MX supported 2x multisample and supported 1.3, but it was not possible to setup multisample. It had to be done through the control panel.
Like I said, I could be wrong about that.

If it says 1.3, then it supports multisample.
You will have to use glSampleCoverage instead of glSampleCoverageARB
And tokens like GL_MULTISAMPLE_ARB become GL_MULTISAMPLE

Overmind
01-27-2007, 05:58 AM
The GL_ARB_multisample extension was promoted to core in 1.3, but you still need the WGL_ARB_multisample extension to setup a multisample capable pixel format.

zed
01-27-2007, 05:19 PM
nVidia doesn't play by the rules, then I'm not taking advantage of a feature the driver supports (even if it's in software) because the extension string isn't complete. It seems that the most pragmatic approach is to ignore both rev level and extension strings and just try to acquire function pointers, then test them. The rest is pointless if the rules aren't followed.they do mostly follow the rules (im not to sure about multisample since its been years since ive looked at it)
but to give a similar case

until recently i had a geforce fx, this doesnt do NPOT in hardware (non power of two texture unless u use texture_rect)
now in the extension string GL_ARB_texture_non_power_of_two isnt there but because its a part of opengl2.0
u can set it up + use NPOT sized textures with a gffx (the problem though is your framerate will drop to < 1fps since its done in software)

thus the basic method is
if >= gl version then u can do whatever is aviable in that version
but if the extension is not in the extension string then its done in software