[wx-dev] [ wxwindows-Patches-1915804 ] Full Scene Anti Aliasing (using multisample) for wxGLCanvas.

SourceForge.net noreply at sourceforge.net
Fri May 2 04:23:30 PDT 2008


Patches item #1915804, was opened at 2008-03-16 22:38
Message generated for change (Comment added) made by g00fy
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=309863&aid=1915804&group_id=9863

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: OpenGL
Group: new feature
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Olivier Playez (olivier_playez)
Assigned to: Nobody/Anonymous (nobody)
Summary: Full Scene Anti Aliasing (using multisample) for wxGLCanvas.

Initial Comment:
This patch adds the support for Full Scene Anti Aliasing (FSAA) to the wxGLCanvas widget (using the multisample extension).
It works on mac/carbon, gtk and msw.

It adds two flags (namely WX_GL_SAMPLE_BUFFERS and WX_GL_SAMPLES) allowing for 2x2 or 4x4 hardware accelerated full scene anti aliasing on most recent graphics cards (including nVidia and ATI).

The documentation was updated accordingly.

--------

You might remember this description, it's from the patch [ 1844855 ] Full Scene Anti Aliasing (FSAA) for wxGLCanvas.

I rewrote the patch because it failed to create a valid context if multisample is  requested on a card that doesn't support it. It's very platform specific to query for multisample support, so it has to be included in wxGLCanvas.
With this new patch, if multisample is requested but not available, the wxGLCanvas will be created without multisample. You can use wxGLCanvas::IsDisplaySupported() to check if the display you requested is supported (and decide to quit or continue).

I added multisample support in the penguin sample.

This patch is for the following snapshot http://biolpc22.york.ac.uk/pub/Daily_HEAD/files/wxWidgets-2008-03-15.tar.gz

Anti Aliasing is an important feature. As you can read in the nVidia GPU programming guide (http://developer.download.nvidia.com/GPU_Programming_Guide/GPU_Programming_Guide.pdf), page 31 :
"GeForce FX, GeForce 6 Series, and GeForce 7 Series GPUs all have powerful antialiasing engines. They perform best with antialiasing enabled, so we recommend that you enable your applications for antialiasing."

The multisample extension is supported by most graphics cards, here is a list :
http://www.delphi3d.net/hardware/extsupport.php?extension=GL_ARB_multisample

I tested this patch on  :
- WinXP with a GeForce FX 5200 (supports FSAA)
- WinXP with an i915 (doesn't support FSAA).
- Mac OS X 10.4.11 with an ATI Rage 128 (doesn't support FSAA).
- Xubuntu 7.10 with a GeForce FX 5200 (supports FSAA, with nvidia drivers).


----------------------------------------------------------------------

Comment By: Steven Van Ingelgem (g00fy)
Date: 2008-05-02 13:23

Message:
Logged In: YES 
user_id=569271
Originator: NO

Hi,


I converted this patch (at least for MSW) to trunk.
It would be nice to see this included into wx.

Please find it here:
https://sourceforge.net/tracker/index.php?func=detail&aid=1956090&group_id=9863&atid=309863


Greetings

----------------------------------------------------------------------

Comment By: Olivier Playez (olivier_playez)
Date: 2008-04-08 20:47

Message:
Logged In: YES 
user_id=1719616
Originator: YES

I forgot to say I fixed an issue in the unix version (for the trunk and
v2.8.7)
File Added: GLCanvasFSAA_287v2_GLXfix.patch

----------------------------------------------------------------------

Comment By: Olivier Playez (olivier_playez)
Date: 2008-04-08 20:44

Message:
Logged In: YES 
user_id=1719616
Originator: YES

1. done

2. pixelFormatMultiSample has been renamed and commented in the header
file.

2. trivial accessor and 3. : it was used for the IsDisplaySupported()
feature introduced by the patch 1879906. I removed them in this new version
of patch, support for this feature should be added later, preferably by
it's author.

4. fixed

5. unused WGL_XXX_ARB constants have been removed

File Added: GLCanvasFSAAv2_GLXfix_noIDS.patch

----------------------------------------------------------------------

Comment By: Vadim Zeitlin (vadz)
Date: 2008-04-06 15:43

Message:
Logged In: YES 
user_id=71618
Originator: NO

The patch looks globally good, thanks, but I have several questions:

1. Would it be possible to put IsExtensionSupported() in wxGLCanvasBase
instead of duplicating it in all ports? We really want to avoid having to
maintain the same code in several places. 

2. The logic behind pixelFormatMultiSample in wxMSW version is not really
clear, could you please describe it in a comment somewhere (e.g. what
values it can have and what do they mean)? Also, please call it
ms_pixelFormatMultiSample to conform to wx convention. And, finally, the
trivial accessor to it doesn't seem to be necessary as most of the code
just uses it directly anyhow (OTOH an accessor would be helpful if it's
initialized on demand...). And if this could be somehow simplified it would
be great.

3. A comment about the meaning of "fullTest" parameter would be
appreciated too, it's really not clear what does it mean.

4. In Unix and Mac versions it doesn't seem to be necessary to always call
IsExtensionSupported(wxT("GL_ARB_multisample"), it's only needed when
WX_GL_SAMPLE[_BUFFERS] is specified, isn't it?

5. The MSW code defines tons of WGL_XXX_ARB constants only a few of which
are used in the code, could we cut down on the unneeded ones?

Thanks in advance!

----------------------------------------------------------------------

Comment By: Olivier Playez (olivier_playez)
Date: 2008-03-20 20:07

Message:
Logged In: YES 
user_id=1719616
Originator: YES

File Added: GLCanvasFSAA_287.patch

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=309863&aid=1915804&group_id=9863


More information about the wx-dev mailing list