Preparing to Use a Light

The following steps are required, in order, to create and prepare a light for use in a scene. Note that these steps assume that you have already initialized the Direct3D sub-system and created a viewport.

To prepare a light for use in a scene

  1. Create a light object.

    Creating a light causes Direct3D to allocate internal data structures that will contain information about the light. For more information, see Creating a Light.

  2. Set the light properties.

    By setting the light properties, you are choosing the type of light you will use, and how Direct3D will calculate lighting effects generated by that object. For more information, see Setting Light Properties.

  3. Add the light to a viewport.

    The final step in preparing a light is to add it to the light list for a rendering viewport. For more information, see Adding a Light to a Viewport.