Microsoft DirectX 8.1 (Visual Basic) |
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. The D3DRS_FOGENABLE render state controls fog blending. Set this render state to 1 to enable fog blending as shown in the following example code. The default is 0.
' ' For this example, d3dDevice contains a valid ' reference to a Direct3DDevice8 object. ' On Local Error Resume Next Call d3dDevice.SetRenderState(D3DRS_FOGENABLE, 1) If Err.Number <> D3D_OK Then ' Code to handle error goes here. End If
You must enable fog blending for both pixel fog and vertex fog. For information about using these types of fog, see Pixel Fog and Vertex Fog.