Game Engine Architecture by Jason Gregory
Author:Jason Gregory [Gregory, Jason]
Language: eng
Format: epub, pdf
Publisher: CRC Press
Published: 2014-08-14T21:00:00+00:00
506
10. The Rendering Engine
Figure 10.45. No antialiasing (left), 4× MSAA (center) and Nvidia’s FXAA, preset 3 (right). Image from Nvidia’s FXAA white paper by Timothy Lottes (http://bit.ly/1mIzCTv). (See Color Plate XVIII.) technique has unique performance, memory-usage and quality characteristics. Figure 10.45 shows a scene rendered first without antialiasing, then with
4× MLAA and finally with Nvidia’s FXAA technique.
10.2.7.1
Full-Screen Antialiasing (FSAA)
In this technique, also known as super-sampled antialiasing (SSAA), the scene is
rendered into a frame buffer that is larger than the actual screen. Once render-
ing of the frame is complete, the resulting oversized image is downsampled to
the desired resolution. In 4× supersampling, the rendered image is twice as
wide and twice as tall as the screen, resulting in a frame buffer that occupies
four times the memory. It also requires four times the GPU processing power
because the pixel shader must be run four times for each screen pixel. As you
can see, FSAA is an incredibly expensive technique both in terms of memory
consumption and GPU cycles. As such, it is rarely used in practice.
10.2.7.2
Multisampled Antialiasing (MSAA)
Multisampled antialiasing is a technique that provides visual quality com-
parable to that of FSAA, while consuming a great deal less GPU bandwidth
(and the same amount of video RAM). The MSAA approach is based on the
observation that, thanks to the natural antialiasing effect of texture mipmap-
10.2. The Rendering Pipeline
507
ping, aliasing tends to be a problem primarily at the edges of triangles, not in
their interiors.
To understand how MSAA works, recall that the process of rasterizing a
triangle really boils down to three distinct operations: (1) Determining which
pixels the triangle overlaps (coverage), (2) determining whether or not each
pixel is occluded by some other triangle (depth testing) and (3) determining
the color of each pixel, presuming that the coverage and depth tests tell us
that the pixel should in fact be drawn (pixel shading).
When rasterizing a triangle without antialiasing, the coverage test, depth
test and pixel shading operations are all run at a single idealized point within
each screen pixel, usually located at its center. In MSAA, the coverage and
depth tests are run for N points known as subsamples within each screen pixel.
N is typically chosen to be 2, 4, 5, 8 or 16. However, the pixel shader is only
run once per screen pixel, no matter how many subsamples we use. This gives
MSAA a big advantage over FSAA in terms of GPU bandwidth, because shad-
ing is typically a great deal more expensive than coverage and depth testing.
In N × MSAA, the depth, stencil and color buffers are each allocated to
be N times as large as they would otherwise be. For each screen pixel, these
buffers contain N “slots,” one slot for each subsample. When rasterizing a
triangle, the coverage and depth tests are run N times for the N subsamples
within each fragment of the triangle. If at least one of the N tests indicates
that the fragment should be drawn, the pixel shader is run once. The color
obtained from the pixel shader is then stored only into those slots that cor-
respond to the subsamples that fell inside the triangle. Once the entire
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(12585)
Hello! Python by Anthony Briggs(9920)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9799)
The Mikado Method by Ola Ellnestam Daniel Brolund(9782)
Dependency Injection in .NET by Mark Seemann(9343)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8305)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7768)
Grails in Action by Glen Smith Peter Ledbrook(7700)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7562)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(7121)
Microservices with Go by Alexander Shuiskov(6882)
Practical Design Patterns for Java Developers by Miroslav Wengner(6800)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6744)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6420)
Angular Projects - Third Edition by Aristeidis Bampakos(6155)
The Art of Crafting User Stories by The Art of Crafting User Stories(5681)
NetSuite for Consultants - Second Edition by Peter Ries(5612)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5423)
Kotlin in Action by Dmitry Jemerov(5070)
