Share via


Fog Color

Fog color for both pixel and vertex fog is set through the D3DRS_FOGCOLOR render state. The render state values can be any RGB color, specified as an RGBA color; the alpha component is ignored.

The following C++ code example sets the fog color to white.

/* For this example, the d3dDevice variable is
 * a valid pointer to an IDirect3DDevice8 interface.
 */
HRESULT hr;
 
hr = d3dDevice->SetRenderState(
                    D3DRS_FOGCOLOR,
                    0x00FFFFFF); // Highest 8 bits are not used.
 
if(FAILED(hr))
    return hr;

See Also

Fog

 Last updated on Thursday, April 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.