Platform SDK: DirectX |
When the system performs vertex fogging, it applies fog calculations at each vertex in a polygon, then interpolates the results across the face of the polygon during rasterization. Vertex fog effects are computed by the Direct3D lighting and transformation engine. For more information, see Fog Parameters.
If your application doesn't use Direct3D for transformation and lighting, it must perform fog calculations on its own. In this case, your application can place the fog factor it computes in the alpha component of the specular color for each vertex. You are free to use whatever formulas you desire—range-based, volumetric, or otherwise. Direct3D uses the supplied fog factor to interpolate across the face of each polygon. Applications that do not use Direct3D transformation and lighting need not set vertex fog parameters, but must still enable fog and set the fog color through the associated render states. For more information, see Fog Parameters.
Note Applications that perform their own transformation and lighting must also perform their own vertex fog calculations. As a result, such an application need only enable fog blending and set the fog color through the associated render states, as described in Fog Blending and Fog Color.