Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Fog Blending
Collapse the table of content
Expand the table of content

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.
HRESULT hr;
hr = g_pDevice->SetRenderState(
                    D3DRS_FOGENABLE,
                    TRUE);
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).

 

 

Community Additions

ADD
Show:
© 2015 Microsoft