Go Back   nV News Forums > Linux Support Forums > NVIDIA Linux

Newegg Daily Deals

Reply
 
Thread Tools
Old 01-15-07, 02:39 AM   #1
zap
Registered User
 
Join Date: Feb 2003
Location: St. Petersburg, Russia
Posts: 20
Default 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.
zap is offline   Reply With Quote
Old 01-15-07, 05:12 AM   #2
squeen
Registered User
 
Join Date: Dec 2006
Location: Greenbelt, MD
Posts: 33
Default 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.
squeen is offline   Reply With Quote
Old 01-15-07, 11:03 AM   #3
Thunderbird
 
Join Date: Jul 2002
Location: Netherlands, Europe
Posts: 2,105
Default 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.
Thunderbird is offline   Reply With Quote
Old 01-15-07, 12:26 PM   #4
zap
Registered User
 
Join Date: Feb 2003
Location: St. Petersburg, Russia
Posts: 20
Default 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".

Last edited by zap; 01-15-07 at 12:39 PM.
zap is offline   Reply With Quote
Old 01-15-07, 01:15 PM   #5
squeen
Registered User
 
Join Date: Dec 2006
Location: Greenbelt, MD
Posts: 33
Default 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.
squeen is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
High resolution versus antialiasing JemyM NVIDIA GeForce 7, 8, And 9 Series 43 10-06-02 03:28 PM
Antialiasing bug in 31.00 drivers? Mark_fox NVIDIA Windows Graphics Drivers 7 08-26-02 02:48 PM
How do you get the 10% antialiasing and anisotropy increase with the 30.30 drivers? imtim83 NVIDIA Windows Graphics Drivers 12 08-25-02 10:01 AM

All times are GMT -5. The time now is 10:10 AM.


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