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.42)

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
 
Grass
 

Figure 1 - Vertex and Pixel shaders

The Grass sample demonstrates the use of vertex and pixel shaders to create the effect of a grass waving in the wind.
The availability of programmable vertex and pixel shaders has allowed programmers to re-examine how they implement passive background scene geometry. With the ability to transfer background scene animation over to the GPU, previously static background objects can now be animated, adding life and realism to the scene. In this sample, an approach is shown for realistically and inexpensively animating grass with a combination of vertex and pixel shaders.

The waving motion of the grass can be accomplished in the vertex shader. Using a traditional method the grass is rendered with randomly placed intersecting quads stored in a single vertex buffer. The quads are texture mapped and rendered with an alpha test. In the vertex shader, the top two vertices of each quad are animated using a combination of four sinusoidal waves. The waves are approximated using a Taylor Series approach. This combination of sine waves using various different frequencies creates a natural waving that does not look like an animation or overly repetitious.

When grass blades wave in the wind they also turn and change their orientation with respect to the sunlight. Because this method involves using a textured quad to represent various blades of grass it is impossible to change the lighting on individual grass blades. To simulate the change in color that would occur as the blades twist the wind, the same sine wave that was used to animate the grass is used to oscillate between two colors. In this case, the green channel of the color was changed to make the grass color change from intense green to a more yellowish-brown. The pixel shader combines this color with the grass texture to produce the final result

 
The following keys are implemented. The dropdown menus can be used for the same controls.
Grass 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  |  Careers  |  RSS Feeds  |  Terms and Conditions  |  Privacy  |  Trademark information  |  Site Map