nV News Forums

 
 

nV News Forums (http://www.nvnews.net/vbulletin/index.php)
-   NVIDIA Linux (http://www.nvnews.net/vbulletin/forumdisplay.php?f=14)
-   -   Antialiasing in GL contexts (http://www.nvnews.net/vbulletin/showthread.php?t=84293)

zap 01-15-07 02:39 AM

Antialiasing in GL contexts
 
Hello!

I guess this is not quite the exact forum to post this kind of questions, but first it's Linux-driver-specific, and second, the programmer forum seems quite empty and I guess nobody reads it :)

I'm trying to programmatically enable antialiasing in my program, and can't find any way to do it. The 'glxinfo' program displays GLX_ARB_multisample as a supported extension, however, if I pass "GLX_SAMPLE_BUFFERS_ARB, GL_TRUE" to glXChooseFBConfig(), it always returns an empty list of fbconfigs.

However, if I do "export __GL_FSAA_MODE=4" before launching my program, antialiasing works! And even if I call putenv ("__GL_FSAA_MODE=4") before creating the GLX context, it doesn't work, I guess nvidia driver's looking at some other environment.

So what's the matter here? It seems the required support is built into the driver, but for some reason it doesn't provide any FSAA-capable visuals? Is there any way to enable antialiasing, other than modifying the environment variable before launching the program? The reason I need this is that I would like to change this setting from a setup dialog in my program.

squeen 01-15-07 05:12 AM

Re: Antialiasing in GL contexts
 
the columns 'ns' and 'b' under 'ms' in glxinfo are the number of samples and buffers with multisample visuals. On Quadro FX 5500 cards I get ones like 16 1 and 8 1, for 'ms' and 'b' respectively. However, you point is right, even if you get a multisample visual with fbconfig, that's not enough like it was on the older SGI/IRIX system, you also need the environment variable set telling it which type of multisample you want to use (I prefer 7, 4x supersample, 4x multi).

So....there seem to be no way to toggle multi sample on/off programatically like on older systems that I've found. The OpenGL call, glEnable( GL_MULTISAMPLE ) also seems to have no effect, nor does glHint(GL_MULTISAMPLE_FILTER_HINT_NV, GL_NICEST) that I've detected. I found it an odd mechanism as well. And again, there's also a global override in the nvidia-settings control panel as well. I don't recall which of those two takes precedence. Seems like the method was created to cater to applications (especially games) which might not have considered multisample when they were created.

Hope that helps.

Thunderbird 01-15-07 11:03 AM

Re: Antialiasing in GL contexts
 
From my experience multisampling works fine as long as both the GLX context and the drawable you use have multisampling support. Though not all modes advertised in nvidia-settings are offered but it still works.

zap 01-15-07 12:26 PM

Re: Antialiasing in GL contexts
 
Quote:

Originally Posted by squeen
the columns 'ns' and 'b' under 'ms' in glxinfo are the number of samples and buffers with multisample visuals. On Quadro FX 5500 cards I get ones like 16 1 and 8 1, for 'ms' and 'b' respectively. However, you point is right, even if you get a multisample visual with fbconfig, that's not enough like it was on the older SGI/IRIX system, you also need the environment variable set telling it which type of multisample you want to use (I prefer 7, 4x supersample, 4x multi).

Hmm, strange, I don't get any of such modes in glxinfo output. Both 'ns' and 'b' are 0 in glxinfo output for all visuals (both on my dust-old GeForce 440MX as well on a newer GeForce 6200, drivers 9631), however multisampling for sure works with the environment variable. Thus I never was able to get an supersampled fbconfig.

The type of multisample you're talking about should be, as far as I understand, the 'ms' parameter. In the specs for the GLX_ARB_multisample extension it's said that "GLX_SAMPLES_ARB" is a vendor-specific parameter, so I assume it's the same as the __GL_FSAA_MODE env var.

Quote:

Originally Posted by squeen
The OpenGL call, glEnable( GL_MULTISAMPLE ) also seems to have no effect, nor does glHint(GL_MULTISAMPLE_FILTER_HINT_NV, GL_NICEST) that I've detected.

The glHint is told only to give a hint to the rendering system whenever you want more accurate or more fast rendering, but in any case multisample rendering should be enabled by glEnable().

Quote:

Originally Posted by Thunderbird
From my experience multisampling works fine as long as both the GLX context and the drawable you use have multisampling support. Though not all modes advertised in nvidia-settings are offered but it still works.

Hmm, what means "drawable has multisampling support"? The only place where I can request multisampling is in the GL context, but the X Window has no such attribute as "support for multisampling".

squeen 01-15-07 01:15 PM

Re: Antialiasing in GL contexts
 
Quote:

Originally Posted by zap
Hmm, strange, I don't get any of such modes in glxinfo output.

Strange indeed.

Quote:

The type of multisample you're talking about should be, as far as I understand, the 'ms' parameter. In the specs for the GLX_ARB_multisample extension it's said that "GLX_SAMPLES_ARB" is a vendor-specific parameter, so I assume it's the same as the __GL_FSAA_MODE env var.
No. Look in the drivers release notes under environment variables. It explains how each __GL_FSAA_MODE differs. Basicly, there are a few (different) algorithms and a combination of samples for each.

Quote:

The glHint is told only to give a hint to the rendering system whenever you want more accurate or more fast rendering, but in any case multisample rendering should be enabled by glEnable().
My experience is that the glENable() is totally overidden by the environment variable. There appears to be no way to toggle it on/off while a program is running like with the InfiniteReality systems.


All times are GMT -5. The time now is 01:07 PM.

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.