DirectX SDK

LightMap Sample

[Visual Basic]

This topic pertains only to application development in C++. See Direct3D Immediate Mode Visual Basic Samples.

[C++]

Description

This sample shows how to use multitexturing and multipass techniques to create some complex lighting effects. It shows a light swinging in a room, which dynamically lights up the walls and ceiling as the light moves.

Path

Source: (SDK root)\Samples\Multimedia\D3dim\Src\LightMap

Executable: (SDK root)\Samples\Multimedia\D3dim\Bin\Lightmap.exe

User's Guide

On the Options menu, choose between multipass and multiple-texture blending. The latter is not available if your hardware does not support it.

Press F1 to see other available commands, or choose from the menu.

Programming Notes

There is no true lighting in this sample—everything is done with light maps. Light maps are extremely useful in games because they are much faster than real lighting. In addition, real lighting is calculated only at the vertices, so highly tessellated meshes are required.