
Rendering from Compressed High Dynamic Range Textures on Programmable Graphics Hardware Lvdi Wang Xi Wang Peter-Pike Sloan∗ Li-Yi Wei Xin Tong Baining Guo Microsoft Research Asia ∗Microsoft Corporation Abstract textures. This not only causes storage issues on commodity graph- ics hardware often equipped with limited texture memory, but also High dynamic range (HDR) images are increasingly employed in incurs significant performance penalties caused by poorer texture games and interactive applications for accurate rendering and illu- cache coherence and more memory bandwidth consumption. mination. One disadvantage of HDR images is their large data size; Unfortunately, current graphics hardware only supports com- unfortunately, even though solutions have been proposed for future pression of 8-bit textures, and to our knowledge there exists no hardware, commodity graphics hardware today does not provide suitable compression technique for floating-point HDR textures on any native compression for HDR textures. current generation graphics hardware. This makes the size disparity In this paper, we perform extensive study of possible methods for even bigger between compressed 8-bit and uncompressed HDR tex- supporting compressed HDR textures on commodity graphics hard- tures. Recently, various extensions have been proposed for support- ware. A desirable solution must be implementable on DX9 gener- ing compressed HDR textures on graphics hardware [Munkberg ation hardware, as well as meet the following requirements. First, et al. 2006; Roimela et al. 2006]. However, these solutions are not the data size should be small and the reconstruction quality must be immediately available, as the proposed extensions are not part of good. Second, the decompression must be efficient; in particular, current (DX9) or even future (DX10) graphics APIs or hardware. bilinear/trilinear/anisotropic texture filtering ought to be performed via native texture hardware instead of custom pixel shader filtering. The goal of our paper is to provide a solution that can be im- We present a solution that optimally meets these requirements. plemented on current generation GPUs as well game consoles. For Our basic idea is to convert a HDR texture to a custom LUVW games and other interactive applications, the solution must satisfy space followed by an encoding into a pair of 8-bit DXT textures. the following requirements. First, the data size should be small and Since DXT format is supported on modern commodity graphics the reconstruction quality must be good. Second, the decompres- hardware, our approach has wide applicability. Our compression sion must be efficient; in particular, bilinear/trilinear/anisotropic ratio is 3:1 for FP16 inputs, allowing applications to store 3 times texture filtering ought to be performed via native texture hardware the number of HDR texels in the same memory footprint. Our de- instead of custom pixel shader filtering. compressor is efficient and can be implemented as a short pixel program. We leverage existing texturing hardware for fast decom- One possibility is to encode a HDR image into a shared exponent pression and native texture filtering, allowing HDR textures to be format, RGBE [Ward 1994], via RGBA8 format on current graph- utilized just like traditional 8-bit DXT textures. Our reduced data ics hardware. However, since it is incorrect to linearly interpolate size has a further advantage: it is even faster than rendering from exponent values in the A channel, we will have to perform texture uncompressed HDR textures due to our reduced texture memory filtering via custom shader code. A similar format employed in the access. Given the quality and efficiency, we believe our approach game developer community is RGBS [Green and McTaggart 2006] suitable for games and interactive applications. where the A channel is interpreted as a scaling (hence the acronym S) factor of the RGB channels. Similar to RGBE, this format does Keywords: high dynamic range image, texture compression, not support direct filtering even though it is used as a render target games & GPUs, game programming, graphics hardware, texturing only. techniques In this paper, we perform extensive study and comparison of po- tential methods for supporting compressed HDR textures on pro- 1 Introduction grammable graphics hardware. Our solution represents an input HDR image with a pair of DXT5 textures. Since DXT is widely supported on commodity graphics hardware, our decompressor can HDR images are gaining popularity in games and interactive appli- be implemented as a pixel program without any hardware modi- cations, as both sources of illumination and intermediate results in fication. For HDR RGB textures in 16-bit floating point formats, multi-pass rendering. However, due to their range, HDR images we obtain a 3:1 compression ratio, meaning that applications uti- need to be stored as 16-bit or 32-bit floating point textures, taking lizing our technique can store 3 times the amount of HDR textures 2 to 4 times the amount of storage with respect to traditional 8-bit with the same amount of memory. This is achieved without ma- jor perceptual quality degradation, as rendering results using our technique visually match those rendered from original sources. We present a novel encoding scheme to allow native DXT texture hard- ware filtering without the need to simulate trilinear or anisotropic filtering by fetching multiple samples in a fragment program. Even more importantly, our technique runs faster than rendering from un- compressed HDR textures due to reduced texture memory traffic. Since both desktop and mobile GPUs as well as modern consoles (e.g. PS3 and XBOX360) all support DXT but not HDR compres- sion, we believe our technique provides significant benefit for many graphics applications. 2 Previous Work Input HDR Reconstructed HDR HDR Tone Mapping Significant research has been conducted in Color Space Conversion converting a HDR image into a LDR one so that it can be displayed (RGB to LUVW) on LDR devices [Li et al. 2005; Goodnight et al. 2003; Reinhard et al. 2005; Ward and Simmons 2004]. However, these techniques Fragment Program are mainly designed for dynamic range reduction (i.e. tone map- Range Quantization ping), a non-reversible process, not for data size reduction while attempting to preserve original dynamic range. DXT Encoding HDR Encoding and Compression OpenEXR [Industrial Compressed Output Light & Magic 2003] is a popular format for encoding HDR im- (2 DXT textures) ages in the film industry. However, it focuses on quality but not efficient decoding, which is crucial for real-time applications. In addition to tone mapping, [Li et al. 2005] can also be utilized as Figure 1: Overview of our algorithm pipeline. Down arrows indicate en- a compression technique; however, its complexity makes GPU im- coding, while up arrows indicate decoding. plementation infeasible. Utilizing compression standards, [Man- tiuk et al. 2004] compresses HDR videos via MPEG4 while [Xu et al. 2005] compresses HDR images via JPEG 2000; due to the Our encoding is conducted offline on a CPU, and is performed variable-rate nature of MPEG and JPEG, these techniques cannot only once. Given a HDR input, we first convert it from RGB into be easily implemented on graphics hardware. our custom LUVW color space where all the high dynamic range luminance information is concentrated in the L channel only. We GPU Texture Compression Unlike traditional image com- then quantize the LUVW channels so that they can be encoded into pression whose main concerns are quality and data size, techniques fixed-point DXT channels. Since L is the only channel that contains for GPU texture compression also needs to take into account speed, HDR information, we allocate more bits for L than UVW. Finally, random-accessibility, and implementation feasibility [Beers et al. we properly map the LUVW channels into the DXT channels to 1996]. To achieve these goals, a variety of techniques have been allow native hardware filtering and efficient decoding. Our decod- proposed [Strom and Akenine-Moller 2005; Fenney 2003; Beers ing process is simple and can be implemented on a GPU via pixel et al. 1996; Iourcha et al. 1997]; however, to our knowledge they program. are all designed for 8-bit LDR images, and therefore cannot be di- We describe the detailed process below. rectly applied to compress HDR textures. 3.1 Color Space Conversion DXT Compression Since our algorithm builds upon the DXT (aka S3TC) standard [Iourcha et al. 1997], we provide a brief sum- The goal of this step is to concentrate all the HDR information into mary here for completeness. There exist several variations of DXT, one color channel instead of three. Given a HDR image in floating but in our implementation we only utilize DXT1 (the one offering point format, we first convert it into our LUVW color space. The highest compression ratio) and DXT5 (twice the data size of DXT1 formula is: but with higher quality in alpha channel), so below we only describe these two. L = R2 + G2 + B2 DXT1 operates on individual 4 × 4 pixel blocks independently. U = R/L Each 4 × 4 block is represented by two 16-bit R5G6B5 colors, V = G/L and 2 bits per pixel to decide how to interpolate from these two W = B/L colors. (In other words, all colors in the block will lie on a line (1) in the color cube.) If the block is totally opaque, then the 2 bits provide 4 possible linear interpolations of the two extreme colors. Note that division-by-L concentrates all HDR information into If the block has some transparent (punch through) pixels, then the the L channel. This allows us to spend more bits for L than UVW encoding is slightly different. But in our algorithm, we only utilize in the subsequent process. However, since division-by-L is a non- the opaque mode. The total DXT1 data size is 64 bits per 4 × 4 linear operation, it is theoretically incorrect to perform native filter- pixel block.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages8 Page
-
File Size-