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).
Related topics
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for