Platform SDK: DirectX

Enabling Geometry Blending

[C++]

Geometry blending is disabled by default. To enable geometry blending, simply call the IDirect3DDevice7::SetRenderState method to set the D3DRENDERSTATE_VERTEXBLEND render state to a value from the D3DVERTEXBLENDFLAGS enumerated type. The following code fragment shows what this call might look like when setting the render state for a blend between two world matrices.

pd3dDevice->SetRenderState( D3DRENDERSTATE_VERTEXBLEND, D3DVBLEND_1WEIGHT );

When D3DRENDERSTATE_VERTEXBLEND is set to any value other than D3DVBLEND_DISABLE, the system assumes that the appropriate number of blending weights will be included in the vertex format. It is your responsibility to provide a compliant vertex format, and to provide a proper description of that format to the Direct3D rendering methods. For more information, see Defining Vertices for Blending.

When enabled, the system performs geometry blending for all objects rendered by the DrawPrimitive rendering methods.

[Visual Basic]

Geometry blending is disabled by default. To enable geometry blending, simply call the Direct3DDevice7.SetRenderState method to set the D3DRENDERSTATE_VERTEXBLEND render state to a value from the CONST_D3DVERTEXBLENDFLAGS enumeration. The following code fragment shows what this call might look like when setting the render state for a blend between two world matrices.

Call d3dDevice.SetRenderState(D3DRENDERSTATE_VERTEXBLEND, D3DVBLEND_1WEIGHT)

When D3DRENDERSTATE_VERTEXBLEND is set to any value other than D3DVBLEND_DISABLE, the system assumes that the appropriate number of blending weights will be included in the vertex format. It is your responsibility to provide a compliant vertex format, and to provide a proper description of that format to the Direct3D rendering methods. For more information, see Defining Vertices for Blending.

When enabled, the system performs geometry blending for all objects rendered by the DrawPrimitive rendering methods.