164 II Rendering Techniques
appearance is represented by 16 texture tiles that were interpolated b ased on the
camera position as compared to the line direction. However, the trick used is still
noticeable when viewing a line along its direction.
This chapter presents three methods to render high-quality antialiased lines. The
ﬁrst method relies on the ﬁxed-width line-rendering possibility of the OpenGL API.
The last two methods exploit shaders in order to extrude geometry around the line
that will be shaded to achieve a volumetric appearance without aliasing.
11.2 Antialiased Lines Using Postprocess
One existing solution to rendering antialiased lines is to use the OpenGL line primi-
tives with hardware multisampling activated. The selected multisampling quality, 4,
8, or 16 times, will directly inﬂuence the required memory and bandwidth. As an
example, 8 times multisampling will require eight samples per pixel instead of one,
eight times more memory, and the execution of a resolve step computing ﬁnal pixel
color from samples.
Over the last year, researchers have proposed a new way to achieve real-time
antialiasing as a postprocess without requiring huge memory and with a low compu-
tational cost: postprocess antialiasing. A complete overview is presented in [Jimenez
et al. 11]. Basically, these methods use screen-space information such as color, depth,
normals, and geometry to detect edges in the rendered picture and a pply a smar t
blur ﬁlter, taking advantage of the hardware linear ﬁltering to reduce aliasing. Of
all the algorithms, FXAA [Lottes 11] is a good choice as it only relies on the color
buffer, and it only needs the luminance information. Another advantage is that the
full shader ﬁle provided can be used either in OpenGL, Direct3D, or on consoles,
Without FXAA With FXAA
Figure 11.1. OpenGL line primitives without and with postprocess antialiasing (FXAA).
The green rectangles represent the zoomed-in areas.