4

I

Geometric Antialiasing Methods

Emil Persson

4.1 Introduction and Previous Work

Recently a number of techniques have been introduced for performing antialiasing

as a postprocessing step, such as morphological antialiasing (MLAA) [Reshetov09,

Jimenez et al. 11], fast approximate antialiasing (FXAA) [Lottes 11], and subpixel

reconstruction antialiasing (SRAA) [McGuire and Luebke 11]. These techniques

operate on the color buﬀer and/or depth buﬀer and in the case of SRAA on super-

resolution buﬀers. Another approach is to use the actual geometry information to

accomplish the task [Malan 10]. This method relies on shifting vertices to cover

gaps caused by rasterization rules and approximates the edge distances using

gradients.

In this chapter, we discuss geometric postprocess antialiasing (GPAA) [Pers-

son 11a], which is an alternative approach that operates on an aliased image and

applies the antialiasing post-step using geometry information provided directly

by the rendering engine. This results in a very accurate smoothing that has none

of the temporal aliasing problems seen in MLAA or the super-resolution buﬀers

needed for SRAA or the traditional MSAA. Additionally, we will discuss geom-

etry buﬀer antialiasing (GBAA) [Persson 11b], which is based on a similar idea,

but is implemented by storing geometry information to an additional buﬀer. This

technique is expected to scale better with dense geometry and provides additional

beneﬁts, such as the ability to antialias alpha-tested edges.

4.2 Algorithm

Two geometric antialiasing methods will be discussed here. The ﬁrst method

operates entirely in a postprocess step and is called geometric postprocessing

antialiasing (GPAA). This method draws lines over the edges in the scene and

applies the proper smoothing. The second method is more similar to traditional

MSAA in that it lays down the required information during main scene render-

ing and does the smoothing in a ﬁnal resolve pass. This has scalability advan-

71

72 I Geometry Manipulation

tages over GPAA with dense geometry and provides additional opportunities for

smoothing alpha-tested edges, geometric intersection edges, etc. On the down

side, it requires another screen-sized buﬀer to hold the geometric information.

Hence, it is called geometry buﬀer antialiasing (GBAA).

4.2.1 Geometric Postprocessing Antialiasing

Overview. Provided there is an aliased image and geometric information available

in the game engine, it is possible to antialias the geometric edges in the scene.

The algorithm can be summarized as follows:

1. Render the scene.

2. Copy the backbuﬀer to a texture.

3. Overdraw aliased geometric edges in a second geometry pass and blend with

a neighbor pixel to produce a smoothed edge.

Steps 1 and 2 are straightforward and require no further explanation. Step 3

is where the GPAA technique is applied. For each edge in the source geometry

a line is drawn to the scene overdrawing that edge in the framebuﬀer. Depth

testing is enabled to make sure only visible edges are considered for antialiasing.

A small depth-bias will be needed to make sure lines are drawn on top of the

regular triangle-rasterized geometry. For best results, it is better to bias the

scene geometry backwards instead of pushing the GPAA lines forward since you

can apply slope depth-bias for triangles. However, if the edges are constructed

from a geometry shader, it is possible to compute the slope for the primitive

there, as well as for the adjacent primitives across the edge.

The antialiasing process is illustrated in Figure 4.1. Here, a geometric edge is

shown between two primitives. It may be adjacent triangles sharing an edge or a

foreground triangle somewhere over the middle of a background surface.

Figure 4.1. GPAA sample direction and coverage computation.

Start Free Trial

No credit card required