|
Improving Image Quality - AA/AF/HDR
As well as their normal job of producing a realistic virtual world in real-time, graphics cards are also often called upon to apply further image enhancements to improve the overall quality of the rendered scene (obviously they're not doing enough already?!). The most commonly used techniques for improving in-game realism will now be looked at.
Antialiasing
Graphics cards are very good at creating lines that go straight up & down, or across the screen. But when curves or
diagonal lines are needed (which they often are when modelling the real world), the computer produces lines that
resemble 'stair steps' instead of smooth lines.
 In this example, 1 is what the edge
should look like, and 2 is what the computer can actually produce (since it's confined to pixels).
Antialiasing (AA) can overcome this jagged edge problem to a large extent by simply tricking your eyes. It works by
sampling the colours of the pixels on either side of the edge of an object, it then uses these to create intermediate
colours which it can use along the boundary to give the impression of a softer edge.
 3 illustrates the same image
antialiased, with intermediate samples of the background and object colours used to give the impression of a softer edge.
This may look a little odd zoomed in quite so close, so here's a simple example at a normal magnification:

Left: The original Right: The same image after antialiasing (making the edges seem smoother).
By increasing the number of pixels that are sampled (2x, 4x, 6x etc..), the GPU can calculate a more accurate blend,
giving a cleaner looking edge (at the expensive of increased frame rendering time).
Anisotropic Filtering
Anisotropic filtering (AF) is a method of enhancing the image quality of textures on surfaces that are far away
and steeply angled with respect to the camera's point of view.
As a 3D object or scene stretches into the distance, less detail is required as the objects become further away,
so lower quality MIP maps are used. However, this is where more problems occur - all too often the changes between
MIP map levels are overly obvious on the screen. Textures therefore need to be filtered to make the transitions between
different levels smoother.
AF also increases the clarity of surfaces that are tilting into the distance - these surfaces display banding problems
(changes in the sharpness and colour that really stand out) and blurred textures, as the shape of the object is being
distorted. This problem gets even worse when the texture is made smaller as the object gets 'further away'.
Much like AA, AF improves the image quality by taking many samples of the surrounding texture elements, and applies
the result of this to the current pixel. The larger the samples (2x, 4x, 6x etc..), the sharper and more accurate the
result will be.
The following examples illustrate how MIP maps and AF effect the textures. The screenshots were taken while
using 3DMark 03's texture filtering tool.

No MIP maps or AF (click to
enlarge): Textures in the distance are sharp and high quality, but the frame rate is reduced. There's also some quite
nasty banding as the textures get smaller.

MIP maps applied with no
AF (click to enlarge): Textures are blurry as they get further away. The frame rate is increased and the banding
is reduced, but the image quality suffers a lot.

MIP maps and AF
applied (click to enlarge): MIP maps are much clearer with AF applied. Performance is still better than not
using MIP maps, and the image quality is much better than 'bare' MIP maps.
High Dynamic Range
High Dynamic Range (HDR) is a fairly new method of improving image quality, at least where computer games are concerned. HDR is a process that's designed to make in-game lighting more closely mirror what we normally see, more accurately representing the wide range of intensity levels found in the real
world, from direct sunlight to deep shadows.
HDR allows developers to represent brightness data beyond the capabilities of the users display to give a better end result.
For instance, a light bulb and the sun are very different brightness's, but with traditional rendering in a game they will both
be the same colour (mostly white, as this is the 'brightest' colour possible). In this example, HDR would make the sun look brighter than the bulb.
You're probably thinking "so how can HDR make my monitor brighter than its normal maximum?!". The truth is that it can't,
it's all a bit of a trick, as demonstrated by this very basic little example:
 Which deformed little bean-shaped thingy looks brighter, the one on the left or the one on the right?
 The inside of each bean-shaped thingy is actually the same colour (white), it's simply the surrounding
'glare' effect that makes the first one look brighter. (also, if you step back a bit, the two images together look like a robot head...)
Using HDR, internal light sources and objects in the game/application are represented by more brightness than can be displayed, then this data is
'tonemapped' down to the capabilities of the display.
In essence, HDR allows you to make objects in a scene brighter by allowing them to use the full brightness capabilities of the monitor (and not just the brightness level that they were initially shot (or rendered) with. For instance, consider an object reflecting the suns light in a game (e.g. water). The intensity of this light reflection can only ever be a percentage of the suns brightness, so the reflection can never reach the full brightness capabilities of the screen. HDR allows these reflections to be more 'intense', using the screen to its full potential.
HDR isn't all about making things look 'brighter' though, as techniques to make light 'spill' onto neighbouring pixels have been around for a while. HDR not only increases the brightness of whites, but it also ensures that blacks appear 'blacker' and deeper while enhancing the subtle
details of the image, making it look more natural. To understand how it can do this, I'm going to use a real-world example based on the fundamental exposure settings on a camera.
Imagine that you're taking a
photograph of a scene at night, but it's coming out very dark with the default settings. By increasing the exposure time (the time the
shutter is open), more light is exposed to the film/sensor. The result is a picture with greater depth, and many more details than you would have seen
with the previous image.
If a bright light or object is introduced into the scene however, the image will be 'over exposed', with the source of the light overpowering
the rest of the detail in the image. So a short exposure gives you more detail from bright objects, and a long exposure gives you details from
even the darkest, most poorly lit objects in the frame (but bright objects are over exposed with no detail). Obviously in a computer game we want the best of both worlds, high-detail from everything, and that's where HDR comes in.
Multiple shots of the same scene are taken, capturing varying levels of brightness (from dark to over exposed). These shots are then compared
to each other to build a 'radiance map' of the image being displayed on the screen. Each pixel on the screen can then be given an extra value
(besides the normal RGB) to signify its 'brightness value', allowing the graphics card to construct an image with both brighter lights, and more details at the same time.

Six individual exposures of the stained glass windows in the south alcove of Old Saint Paul's, Wellington, New Zealand. Sourced from the Wikimedia Commons.

Tone Mapped HDRI image of the same stained glass windows, made up from the previous 6 exposures. Sourced from the Wikimedia Commons.
HDR allows games developers to control the behaviour of light to a much more realistic level (such as changing the colour of light as it passes though coloured glass.
One effect that is often confused with a function of HDR is 'light blooming'. Light blooming works by radiating, or blooming, high intensity light around a very bright object, so that the light appears to be coming from around the object as well as from the object itself. This gives the illusion that the object is brighter than it really is.
Light blooming filters, while often used alongside HDR (in such games as Far Cry), are not an actual component of HDR. However, because of the 'softening' in the surrounding area that strong light blooms can produce, HDR makes a perfect accompaniment, allowing the bloom to be bright, while preserving a high level of detail in the nearby areas.
  Ubisoft's FarCry. Hover over the image to see its fancy Shader Model 3.0 effects. Move off of the image to see the scene without HDR.
<<< Previous
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13
Next >>>
Article Navigation:
|