Projective Texture Mapping
|
Sections
|
Introduction Spotlights and Shadows Planar Reflection Mapping References and Links
|
|
|
Introduction
|
|
|
Projective texture mapping is a technique for generating texture coordinates dynamically via a projection of 3D geometry into a (usually 2D) texture map. In the same way that screen coordinates are generated by projecting 3D geometry onto your 2D screen, 3D geometry can be projected onto a texture map. This is done by using an appropriately-formed projective texture matrix. This feature has been a fundamental part of OpenGL® since 1.0 and was introduced into Direct3D® in DirectX® 7. On T&L-capable parts like Radeon®, this is done on-chip as part of transformation and lighting.
- We will cover two important applications of projective texture mapping in this tutorial:
-
- Spotlights / Shadows
- Planar Reflection Mapping
In both cases, the textures are often re-generated each frame by rendering into the texture map which is subsequently projected onto the scene geometry.
|
|
|
Spotlights and Shadows
|
|
|
As demonstrated in the RadeonSpotlightShadow sample, shadows can be simulated by rendering a black object into a texture map and projecting the image back into the scene. When properly combined with a light map and a constant ambient term, the results can be quite convincing, as shown in the image below:
|
|
|

|
|
|
Projective shadow and light mapping in action
|
|
|
It is also possible to cleverly author the light map to achieve different dramatic effects. For exmaple, the light can also be shaped for different effects, analogous to the way a cucaloris, gobo or "cookie" is used in theatrical stage lighting.
|
|
|

|
|
|
Projective shadow map used with a static gobo or "cookie" map
|
|
|
In the image above, notice that the cookie map is projected onto the chair, while the product of the cookie map and the shadow map are used on the floor. The cookie used is shown in the figure below:
|
|
|
|
|
|
Gobo or "Cookie" Map used above
|
|
|
Planar Reflection Mapping
|
|
|
Planar reflection mapping can be a useful way to render shiny planar surfaces. Planar floors, glass windows or approximately-planar water simulations can be easily texture mapped using renderable textures and projective texture mapping.
The image below is a screenshot from the Radeon's Ark™ demo created for the Radeon® product launch. The geometry of the environment and character are reflected through the reflecting planes (the glass and the floor, in this case) and rendered into a texture map. This texture map is then planar reflection mapped onto the glass and floor geometry.
|
|
|

|
|
|
Planar reflection mapping in Radeon's Ark™
|
|
|
In the case of the glass in the Radeon's Ark™ demo, the reflection mapped geometry (the glass) is additively blended with the frame buffer, thus representing a surface that is both transparent and reflective.
For the floors and even some of the walls in the Radeon's Ark™ demo, the reflection map is used as the environment map in environment mapped bump mapping. This causes the floors to be both shiny and bumpy.
Detailed explanation of a canned method for planar reflection mapping as done in Radeon's Ark™ is forthcoming.
|
|
|
- References
-
- Segal, Korobkin, van Widenfelt, Foran and Haeberli
"Fast Shadows and Lighting Effects Using Texture
Mapping," Computer Graphics, SIGGRAPH 1992, pp.
249-252.
|
|
|
|
|
|
|
- Links
-
|
|
|
|
|
|
|