D3DLIGHTSTATETYPE

The D3DLIGHTSTATETYPE enumerated type defines the light state for the IDirect3DDevice3::SetLightState method. This enumerated type is part of the D3DSTATE structure.

typedef enum _D3DLIGHTSTATETYPE { 
    D3DLIGHTSTATE_MATERIAL   = 1, 
    D3DLIGHTSTATE_AMBIENT    = 2, 
    D3DLIGHTSTATE_COLORMODEL = 3, 
    D3DLIGHTSTATE_FOGMODE    = 4, 
    D3DLIGHTSTATE_FOGSTART   = 5, 
    D3DLIGHTSTATE_FOGEND     = 6, 
    D3DLIGHTSTATE_FOGDENSITY = 7, 
    D3DLIGHTSTATE_COLORVERTEX       = 8,
    D3DLIGHTSTATE_FORCE_DWORD     = 0x7fffffff, 
} D3DLIGHTSTATETYPE; 
 

Members

D3DLIGHTSTATE_MATERIAL
Defines the material that is lit and used to compute the final color and intensity values during rasterization. The default value is NULL. This value must be set when you use textures in ramp mode. When no material is selected (NULL), the Direct3D lighting engine is disabled.
D3DLIGHTSTATE_AMBIENT
Sets the color and intensity of the current ambient light. If an application specifies this value, it should not specify a light as a parameter. The default value is 0.
D3DLIGHTSTATE_COLORMODEL
One of the values for the D3DCOLORMODEL data type. The default value is D3DCOLOR_RGB.
D3DLIGHTSTATE_FOGMODE
One of the members of the D3DFOGMODE enumerated type. The default value is D3DFOG_NONE.
D3DLIGHTSTATE_FOGSTART
Defines the starting value for fog. The default value is 1.0.
D3DLIGHTSTATE_FOGEND
Defines the ending value for fog. The default value is 100.0.
D3DLIGHTSTATE_FOGDENSITY
Defines the density setting for fog. The default value is 1.0.
D3DLIGHTSTATE_COLORVERTEX
Enables or disables the use of the vertex color in lighting calculations for vertices whose vertex format (specified as a flexible vertex format) includes color information. The default value, TRUE, enables the use of the vertex color in lighting. Set this to FALSE to cause the system to ignore the vertex color. Per-vertex color is supported only by lights for which properties are defined by a D3DLIGHT2 structure.
D3DLIGHTSTATE_FORCE_DWORD
Forces this enumerated type to be 32 bits in size.

Remarks

When programming for execute buffers, this enumerated type is used with the D3DOP_STATELIGHT opcode.

Setting D3DLIGHTSTATE_COLORVERTEX to FALSE instructs the geometry pipeline to ignore part of each vertex (the vertex color). The only reason to use this light state is to change the appearance of the geometry without respecifying it in a different vertex format.

If D3DLIGHTSTATE_COLORVERTEX is set to TRUE and a diffuse vertex color is present, the output alpha is equal to the diffuse alpha for the vertex. Otherwise, output alpha is equal to the alpha component of diffuse material, clamped to the range [0, 255].

You can disable or enable lighting by including or omitting the D3DDP_DONOTLIGHT flag when calling a standard IDirect3DDevice3 rendering method, such as IDirect3DDevice3::DrawPrimitive. If you are using vertex buffers, disable or enable lighting by ommiting or including the D3DVOP_LIGHT flag when you call the IDirect3DVertexBuffer::ProcessVertices method.

QuickInfo

  Windows NT/2000: Requires Windows NT 4.0 SP3 or later.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in d3dtypes.h.

See Also

D3DOPCODE and D3DSTATE, Light Properties