Billboarding |
When creating 3-D scenes, an application can sometimes gain performance advantages by rendering 2-D objects in a way that makes them appear to be 3-D. This is the basic idea behind the technique of billboarding.
A billboard in the normal sense of the word is a sign along a roadway. Microsoft Direct3D applications can create and render this type of billboard by defining a rectangular solid and applying a texture to it. Billboarding in the more specialized sense of 3-D graphics is an extension of this. The goal is to make 2-D objects appear to be 3-D, and the technique is to apply a texture that contains the object's image to a rectangular primitive. The primitive is rotated so that it always faces the user. It does not matter if the object's image is not rectangular. Portions of the billboard can be made transparent, so the parts of the billboard image that you do not want seen are not visible.
Many games employ billboarding for animated sprites. For instance, when the user is moving through a 3-D maze, he or she may see weapons or rewards that can be picked up. These are typically 2-D images textured on a rectangular primitive. Billboarding often is used in games to render images of trees, bushes, and clouds.
When an image is applied to a billboard, the rectangular primitive first must be rotated so that the resulting image faces the user. The application then must translate it into position, after which it can apply a texture to the primitive.
Billboarding works best for symmetrical objects, especially objects that are symmetrical along the vertical axis. It also requires that the altitude of the viewpoint does not increase too much. If the user is allowed to view the billboarded object from above, it becomes readily apparent that the object is 2-D rather than 3-D.
Send comments about this topic to Microsoft. © Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center