ATI SDK

ATI Product Information

Support for Alternate OS's

Hardware partners

Software partners

RenderMonkey

Drivers


 
 

Highlights


GPU MeshMapper (V1.0)

GPU PerfStudio (V1.2)

Samples: CrossFire Detect (update)

Samples: PostTonemapResolve

The Compressonator (version 1.41)

GPU Shader Analyzer (V1.4)

RenderMonkey™
(version 1.81) (New)


ATI Compress (version 1.6)

AMD Tootle 2.0 (New)

AMD OpenGL ES 2.0 Emulator (V1.1) (New)

HLSL2GLSL (V0.9)

AMD at GDC 2007

ATI SDK


 
 
ATI Developer - Source Code
 
HighPrecisionNormalMaps
 

Figure 1 - Simple normal mapped quad

This sample application demonstrates the use of a variety of new and old texture formats to store normal information. The different formats can be used to store normals at varying levels of precision.  In this sample, up to 9 different textures will be created.  Each of these textures belong to one of four categories, each of which requires a different form of "decompression" inside of the pixel shader:

  1. Scale-and-biased 3-tuples
    • D3DFMT_A8R8G8B8
    • D3DFMT_A2R10G10B10
    • D3DFMT_A16B16G16R16
  2. Two's complement 3-tuples
    • D3DFMT_Q8W8V8U8
    • D3DFMT_A2W10V10U10
    • D3DFMT_Q16W16V16U16
  3. Scale-and-biased 2-tuple
    • D3DFMT_G16R16
  4. Two's complement 2-tuples
    • D3DFMT_V8U8
    • D3DFMT_V16U16

In the 2-tuple cases, the z component of the normal must be derived from +sqrt(1-x2-y2).  As a result, the z component is assumed to be positive and thus must be in surface local coordinates (aka "tangent space").  In the scale-and-biased cases, the sampled data is in the 0 to 1 range and must be scaled and biased into the -1 to 1 range by the pixel shader to be useable.

This sample creates 12 pixel shaders: specular, diffuse and specular + diffuse for all four categories of normal decompression.  With the Up/Down arrow keys, the user can select between texture formats.  The S key cycles between specular, diffuse and specular + diffuse lighting modes.  With the lower-precision formats such as D3DFMT_A8R8G8B8, precision artifacts are evident in the specular highlight.  These artifacts are eliminated when using higher precision formats such as D3DFMT_Q16W16V16U16 or D3DFMT_G16R16.  This added precision is also necessary when using an environment map of relatively high spatial frequency.  This is the case in the ATI Radeon 9700 Car Demo, which uses the D3DFMT_G16R16 format for its normal maps.

 
HighPrecisionNormalMaps Controls
  • Up/Down Arrows - Cycle through normal map formats
  • [S] - Cycles between specular, diffuse and specular + diffuse lighting modes
  • Mouse - move the light source object
  • Alt+[ENTER] - Toggles between fullscreen and windowed modes
  • [ESC] - Quit
 
Requirements
Download
 
 


 



©2008 Advanced Micro Devices, Inc.    |    Contact AMD    |    Terms and Conditions    |    Privacy    |    Trademark information    |    Site Map