Upcoming Events
Southwest Gaming Expo
11/20 - 11/22 @ Dallas, TX

Workshop on Network and Systems Support for Games (NetGames 2009)
11/23 - 11/25 @ Paris, France

ICIDS 2009 Interactive Storytelling
12/9 - 12/11 @ Guimarăes, Portugal

Global Game Jam
1/29 - 1/31  

More events...


Quick Stats
6711 people currently visiting GDNet.
2341 articles in the reference section.

Help us fight cancer!
Join SETI Team GDNet!



Link to us

Link to us

  Intel sponsors gamedev.net search:   

High Dynamic Range Environment Mapping On Mainstream Graphics Hardware


I. Introduction

The computer graphics industry has seen dramatic leaps in visual fidelity due to advances in hardware, memory density, and display resolution in the past decade. Researchers in computer graphics have been exploring the dynamic range of the visual display and how to best make use of its limited display range for some time now. Rendering algorithms that utilize high dynamic range imagery is one way to better utilize the display. With programmable graphics hardware widely deployed, game developers can take advantage of these effects in their game engines.

This article discusses the capture, storage, and display of high dynamic range images. The capability to display and process high dynamic range imagery is widely available today - for example, in mainstream computer graphics chipsets such as the Intel® 915G Express Chipset. The article also demonstrates the ability to use high dynamic range images without support for floating point texture formats. This is demonstrated by environment mapping objects in a scene with HDR textures in real-time on integrated graphics processors.


Figure 1. The images above demonstrate the advantage of tone mapping with high dynamic range images. In the left image the image is clamped for high values. By applying the tone mapping operations described in this article we are able to get an image shown in the right. Notice areas that are saturated in the left image appear clearly in the image at the right, in particular the areas outside the window.

The article first presents background on high dynamic range imagery and describes the theory and the mathematics of high dynamic range image capture and display with emphasis on Erik Reinhard's photographic tone reproduction operator. The authors then describe their own implementation of HDR environment mapping provided with this article including an SSE optimized HDR image loader, SSE optimized image key calculator, and a Pixel Shader 2.0 implementation of high dynamic range tone mapping. An example of the results can be seen in Figure 1. The authors obtained a >20% speedup on HDR image loading and a >30% speedup on image key calculations using SSE2 optimized routines. Performance is based on a wide variety of factors including hardware, software, and system configuration - your results may vary.

II. Background

2.1 A trip down the image acquisition pipeline


Figure 2. The figure above depicts the path photons take from the real world to be mapped into a RGB image.

Figure 2 depicts a simplified image acquisition pipeline inspired by [Debevec97]. After passing through the lens, photons travel through the shutter to a light sensor, typically a CCD. The shutter is used to control the amount of time the light sensor accumulates photons and the lens is used to focus the incoming photons onto the light sensor. After arriving at the light sensor the photons are converted into digital values by passing through an analog digital converter (ADC). These digital values will travel through some final adjustments depending on the camera manufacturer and camera settings and be written to an image as RGB values.

2.2 Dynamic Range


Figure 3. In the figure above, the range of light intensities we experience relative to the total amount of light in the real world is compared. Nature varies in absolute range by about 10 orders of magnitude [Ferwerda96]. The human visual system is capable of seeing differences over about 3 orders of magnitude and the dynamic range of a typical display is around 2 orders of magnitude [Seetzen04].

In Figure 3 we can see the variations in dynamic range of the human visual system compared to the dynamic range of visible light and LCD display range. The human visual system adapts the amount of incoming light via moderation of the pupil as well as chemical and neural processes in the photoreceptors and neurons. Photographic devices mimic this behavior via a lens aperture and exposure time.

However, in doing so, the remainder of the information outside the range of the lens and exposure combination is forever lost - a significant blow to the use of these images for real-time rendering purposes, where the conditions under which the light is perceived may warrant modification. In other words, we may want to capture all the information in of the full dynamic range in a scene, and only later chose which parts to discard. As we'll demonstrate in this article, the use of high dynamic range images allows for the storage of more lighting information in the source image, and therefore runtime modification of the end users perception of this lighting information

2.3 Storage of HDR Images

After creating an HDR image, it will need to stored for later retrieval, processing, and display. [Ward03] has a summary of different formats for storing HDR images. Examples include Pixar's 33 bit log encoded TIFF, Radiance's 32-bit RGBE and XYZE, IEEE 96-bit TIFF and Portable FloatMap, LogLuv TIFF, and ILM's 48-bit OpenEXR format. Each format has its own set of advantages and disadvantages including file size, dynamic range, and quantization. For our work we have used the RGBE file format. Ultimately, the format you choose will be dependent on the context of your work and the tools available. We need a tool to manage and manipulate HDR images. Fortunately there is a tool available on-line to help in this effort, HDRShop. Since HDRShop exports RGBE files and RGBE files have an acceptable displayable range we chose to use them for our work [HDRShop04]. Commercial software packages are also available, including Version 2.0 of HDRShop and Photogenics [Photogenics04].





Theory


Contents
  Introduction
  Theory
  Implementation
  Future Work

  Source code
  Printable version
  Discuss this article