Simple Dotproduct3 Bump mapping on
the Radeon®
|
| |
The RadeonSimpleDOT3 sample uses EXT_texture_env_combine,
EXT_texture_env_dot3,
to demonstrate per-pixel lighting effects possible in
OpenGL®. It demonstrates per pixel diffuse lighting with
DOT3 Bumpmapping. For more information on the DOT3 Bumpmapping
technique employed by this demo, see the Dotproduct3
Bump Mapping with 3D Lightmapping demo.
Our lighing model in this demo: (N.L)*BASE
Figure 1 shows the final result.
|
| |
|
| |
Figure 1 - Final Per Pixel Diffuse
lighting with Dot3 Bumps
|
| |
The process begins by binding our DOT3 bump map to
one of the Radeon's texture unit's (the Radeon has 3 Texture
Units).
|
| |
|
| |
Figure 2 - DOT3 Bump Map
|
| |
The DOT3 Bump map: pre-filtered height map texture
(the N term in our lighting model).
|
| |
|
| |
Figure 3 - Light Vector displayed
as color
|
| |
A vector from vertex to light source is computed per
vertex and is scaled and biased, rotated into tangent
space, then packed into the vertex color. This color is
interpolated between vertices so we essentially get a
per pixel L vector.
The texture combiners are then configured to calculate
(N.L)*Base per pixel.
|
| |
|
| |
Figure 5 - Here is the what the
Base texture map looks like before any lighting is calculated.
|
| |
| |
- RadeonSimpleDOT3 Controls
-
- T - Cycle through the different textures/Bump
maps
- W - Toggle wire frame
- B - Show base map only
- L - Show L map only (light vector in tangent
space as color)
- N - Show N map only (Pre-filtered DOT3 Bump
map)
- UP/DOWN ARROW - Zoom In/Out
- LEFT + MOUSE - Rotate Object
- RIGHT + MOUSE - Rotate Light
- SPACE - Toggle Auto Motion
- ESC - Quit
|
| |
Downloads
|
| |
RadeonSimpleDot3.zip
Back
to Samples Page
|
| |