Share via


Fog Blending

Fog blending refers to the application of the fog factor to fog and object colors to produce the final color that appears in a scene (as discussed in Fog Formulas). The RenderStateManager.FogEnable property controls fog blending. The default value is false; set this render state to true to enable fog blending, as shown in the following C# code example.

          [C#]
          

// For this example, device is a valid Device object.
    
// Get the device's render states object.
RenderStates rs = device.RenderState;

rs.FogEnable = true;

Fog blending must be enabled for both pixel fog and vertex fog. For information about using these types of fog, see Pixel Fog and Vertex Fog.