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
 
Shadow Map
 

Figure 1 - Shadows and Per Pixel Shading

The shadows provide very important visual clues that can be used to enhance realism of rendered scenes. Without them scenes look flat, which makes it difficult to determine spatial relationship between objects in the scene. There're two most frequently used methods for generating shadows in real-time rendering -- shadow volumes and shadow mapping. The later uses depth maps rendered from the light position to find out is object or its part is in shadow or not.

The ShadowMap sample demonstrates the use of 1.4 pixel shaders to render antialiased shadows using depth shadow maps. The shadow antialiasing is achieved by implementing custom filtering technique in the pixel shader.

The ShadowMap sample renders scene depth from the light source position into a texture and later uses this texture with depth information to compute shadow visibility query. One of the problems of such approach is a lack of high-precision renderable texture formats that results in poor shadow quality. The sample solves this problem by packing depth values into multiple channels of the depth texture, raising the depth resolution from 8-bit to 11-bit. A look-up texture is used to perform such conversion. The fact that Radeon 8500 and newer cards supporting 1.4 pixel shaders have higher than 8-bit precision in the shader pipe allow us to make this trick work.

Another pixel shader is used to render scene with shadows by sampling shadow maps and performing shadow visibility test on a per-pixel basis. The shader unpacks multi-channel depth information into a single depth value and uses it for depth testing. To antialias shadows four samples are processed in the pixel shader with a special filter. The percentage closer filtering is used as described in Rendering Antialiased Shadows with Depth Maps paper by William T. Reeves, David H. Salesin and Robert L. Cook. The texture coordinates for all four samples are computed in the vertex shader using four different transformation matrices setup by the application.

For the reference the sample visualizes the shadow map in a small overlay displayed in the top-left corner of the window.

 
The following keys are implemented. The dropdown menus can be used for the same controls.
ShadowMap Controls
  • [ENTER] - Starts and stops the scene
  • [SPACE] - Advances the scene by a small increment
  • [F2] - Prompts user to select a new rendering device or display mode
  • 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