Platform SDK: DirectX

Blending Weights

A blending weight (sometimes called a "beta weight") controls the extent to which a given world matrix affects a vertex. Blending weights are floating-point values that range from 0.0 to 1.0, encoded in the vertex format, where a value of 0.0 means the vertex is not blended with that matrix, and 1.0 means that the vertex is affected in full by the matrix.

[C++]

Geometry blending weights are encoded in the vertex format, appearing immediately after the position for each vertex, as described in About Vertex Formats. You communicate the number of blending weights in the vertex format by including one of the D3DFVF_XYZB1 through D3DFVF_XYZB5 flexible vertex format flags in the vertex description that you provide to the Direct3D rendering methods.

[Visual Basic]

Geometry blending weights are encoded in the vertex format, appearing immediately after the position for each vertex, as described in About Vertex Formats. You communicate the number of blending weights in the vertex format by including one of the D3DFVF_XYZB1 through D3DFVF_XYZB5 flexible vertex format flags in the vertex description that you provide to the Direct3D rendering methods.

The system performs a linear blend between the weighted results of the blend matrices. The following is the complete blending formula.

In the preceding formula, vBlend is the output vertex, the v-elements are the vertices produced by the applied world matrix (D3DTRANSFORMSTATE_WORLDn). The W elements are the corresponding weight values within the vertex format. A vertex blended between n matrices can have n–1 blending weight values, one for each blending matrix, except the last. The system automatically generates the weight for the last world matrix such that the sum of all weights is 1.0, expressed in sigma notation here. This formula can be simplified for each of the cases currently supported by Direct3D:

The preceding are the simplified forms of the complete blending formula for the two, three, and four blend matrix cases (the only cases currently supported).

Note  Although Direct3D includes flexible vertex format descriptors to define vertices that contain up to five blending weights, only three can be used in this release of DirectX.