Microsoft DirectX 8.0 (Visual Basic)

Fog Color

Fog color for both pixel and vertex fog is set through the D3DRS_FOGCOLOR render state. The render state values can be any RGB color, as returned by the D3DColorXRGB function.

The following Microsoft® Visual Basic® example sets the fog color to white.

'
' For this example, the d3dDevice variable is
' a valid reference to a Direct3DDevice8 object.
'
On Local Error Resume Next

Call d3dDevice.SetRenderState( _
                    D3DRS_FOGCOLOR, _
                    D3DColorXRGB(1#, 1#, 1#))
 
If Err.Number <> D3D_OK Then
    ' Code to handle error goes here.
End If