Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Fog Blending (Direct3D 9)

Fog blending refers to the application of the fog factor to the fog and object colors to produce the final color that appears in a scene, as discussed in Fog Formulas (Direct3D 9). The D3DRS_FOGENABLE render state controls fog blending. Set this render state to TRUE to enable fog blending as shown in the following example code. The default is FALSE.

// For this example, g_pDevice is a valid pointer
// to an IDirect3DDevice9 interface.
hr = g_pDevice->SetRenderState(
if FAILED(hr)
    return hr;

You must enable fog blending for both pixel fog and vertex fog. For information about using these types of fog, see Pixel Fog (Direct3D 9) and Vertex Fog (Direct3D 9).



Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.