Share via


Light Objects (Windows Embedded CE 6.0)

1/6/2010

Microsoft® Direct3D® Mobile employs two types of lights: point lights and directional lights. You choose the type of light you want when you create a set of light properties. The illumination properties and the resulting computational overhead varies with each type of light source.

Do not confuse light sources in a scene with the concept of an ambient light level. For more information, see Direct Light vs. Ambient Light, Light Properties and Using Lights.

Point Lights

Point lights have color and position within a scene, but no single direction. They give off light equally in all directions, as shown in the following illustration.

Ee490743.6fe13cde-ec5d-4ead-accf-bdfc54435d96(en-US,WinEmbedded.60).gif

A light bulb is a good example of a point light. Point lights are affected by attenuation and range, and illuminate a mesh on a vertex-by-vertex basis. During lighting, Microsoft® Direct3D® Mobile uses the point light's position in world space and the coordinates of the vertex being lit to derive a vector for the direction of the light, and the distance that the light has traveled. Both are used, along with the vertex normal, to calculate the contribution of the light to the illumination of the surface.

Directional Lights

Directional lights have only color and direction, not position. They emit parallel light. This means that all light generated by directional lights travels through a scene in the same direction. Imagine a directional light as a light source at near infinite distance, such as the sun. Directional lights are not affected by attenuation or range, so the direction and color you specify are the only factors considered when Microsoft® Direct3D® Mobile calculates vertex colors. Because of the small number of illumination factors, these are the least computationally intensive lights to use.

See Also

Concepts

Lights