Package com.ms.com.directX Previous
Previous
Microsoft Packages
Microsoft Packages
Index
Index
Next
Next

Class d3dLightStruc

public final class d3dLightStruc {
  public int dwSize;
  public int dltType;
  public float dcvColorR;
  public float dcvColorG;
  public float dcvColorB;
  public float dcvColorA;
  public float dvPositionx;
  public float dvPositiony;
  public float dvPositionz;
  public float dvDirectionx;
  public float dvDirectiony;
  public float dvDirectionz;
  public float dvRange;
  public float dvFalloff;
  public float dvAttenuation0;
  public float dvAttenuation1;
  public float dvAttenuation2;
  public float dvTheta;
  public float dvPhi;
}

Defines the light type in calls to methods such as SetLight and GetLight.

Fields

dwSize
Size, in bytes, of this class.
dltType
Type of the light source. This is one value of light type.
dcvColorR, dcvColorG, dcvColorB, and dcvColorA,
Color of the light.
dvPositionx, dvPositiony, and dvPositionz
Position of the light in world space.
dvDirectionx, dvDirectiony, and dvDirectionz
Direction of the light in world space.
dvRange
Distance beyond which the light has no effect.
dvFalloff
Decrease in illumination between the umbra (the angle specified by the dvTheta field) and the outer edge of the penumbra (the angle specified by the dvPhi field). The intensity of the light at any point in the penumbra is described by the following equation:

In this equation, rho is the angle between the axis of the spotlight and the illuminated point.

dvAttenuation0
Constant light intensity. Specifies a light level that does not decrease between the light and the cutoff point given by the dvRange field.
dvAttenuation1
Light intensity that decreases linearly. The light intensity is 50 percent of this value halfway between the light and the cutoff point given by the dvRange field.
dvAttenuation2
Light intensity that decreases according to a quadratic attenuation factor.
dvTheta
Angle, in radians, of the spotlight's umbra—that is, the fully illuminated spotlight cone.
dvPhi
Angle, in radians, defining the outer edge of the spotlight's penumbra. Points outside this cone are not lit by the spotlight.

The system uses all three of the attenuation settings to determine how the effect of a light decreases with distance from the source. The following equation shows how the attentuation settings are interpreted. The value d here is the distance between the vertex being lit and the light:



Top© 1996 Microsoft Corporation. All rights reserved.