J6/OpenGL/Antialias

From J Wiki
Jump to navigation Jump to search

Full screen antialiasing (FSAA) is a feature of the graphics card, which reduces jagged oblique edges of geometry in 3D graphics such as OpenGL. This is typically achieved by applying a blurring raster filter on the rendring buffer using a vicinity of 2 or 4 etc. adjacent pixels.

Examples

Box.png Box2.png
Straight oblique lines
Super.png Super2.png
Wireframe with light
Font.png Font2.png
Geometry based on curved font lines

Enabling

OpenGL extesions with support from platform-specific API (AGL, WGL, XGL) allow to discover and enable FSAA from the application, though it requires complex and non-portable coding.

It is possible to control FSAA on a specific platform with a particular graphics card from the display control panel. For example on Windows, from Control Panel (or desktop context menu) select Display Properties | Settings | Advanced. Select your graphics card. Select 3D OpenGL settings. Locate Antialiasing.

Display win.png

There may be performance penalty proportional to enhanced quality.

Texture Antialias

The antialiasing settings may not affect textures. However, a specially prepared texture can reduce jagged lines. Typically, a smoothing filter, such as Gaussian 3x3 or 5x5 convolution can do the job.

Texture.png

When defining the texture with gsgentexture2D, it provides override possibility to parameters like GS_TEXWRAP and GS_TEXFILTER. To make smooth textures, use

GS_TEXFILTER=: GL_LINEAR

Issues

Java front end does not show geometry antialising, probably because it uses software OpenGL. However, Java Native OpenGL does show it, e.g.

Atlantis.png