?/TD>
Microsoft DirectX 9.0

D3DDECLMETHOD Enumerated Type


Defines the vertex declaration method. The method tells the tessellator what data needs to be generated from the vertex data during tessellation.

Syntax

typedef enum _D3DDECLMETHOD {
    D3DDECLMETHOD_DEFAULT = 0,
    D3DDECLMETHOD_PARTIALU = 1,
    D3DDECLMETHOD_PARTIALV = 2,
    D3DDECLMETHOD_CROSSUV = 3,
    D3DDECLMETHOD_UV = 4,
    D3DDECLMETHOD_LOOKUP,
    D3DDECLMETHOD_LOOKUPPRESAMPLED
} D3DDECLMETHOD;

Constants

D3DDECLMETHOD_DEFAULT

Default value. The tessellator copies the vertex data (spline data for patches) as is, with no additional calculations. When the tessellator is used, this element is interpolated. Otherwise vertex data is copied into the input register. The input and output type can be any value.

D3DDECLMETHOD_PARTIALU

Computes the tangent at a point on the rectangle or triangle patch in the U direction. The input type can be D3DDECLTYPE_FLOAT3, D3DDECLTYPE_FLOAT4, D3DDECLTYPE_D3DCOLOR, D3DDECLTYPE_UBYTE4, D3DDECLTYPE_SHORT4. The output type is always D3DDECLTYPE_FLOAT3.

D3DDECLMETHOD_PARTIALV

Computes the tangent at a point on the rectangle or triangle patch in the V direction. The input type can be D3DDECLTYPE_FLOAT3, D3DDECLTYPE_FLOAT4, D3DDECLTYPE_D3DCOLOR, D3DDECLTYPE_UBYTE4, or D3DDECLTYPE_SHORT4. The output type is always D3DDECLTYPE_FLOAT3.

D3DDECLMETHOD_CROSSUV

Computes the normal at a point on the rectangle or triangle patch by taking the cross product of the two tangents. The input type can be D3DDECLTYPE_FLOAT[43], D3DDECLTYPE_D3DCOLOR, D3DDECLTYPE_UBYTE4, or D3DDECLTYPE_SHORT4. The output type is always D3DDECLTYPE_FLOAT3.

D3DDECLMETHOD_UV

Copy out the U, V values at a point on the rectangle or triangle patch. This results in a 2-D float. The input type must be set to D3DDECLTYPE_UNUSED. The output data type is always D3DDECLTYPE_FLOAT2. The input stream and offset are also unused (but must be set to 0).

D3DDECLMETHOD_LOOKUP

Look up a displacement map. The input type can be D3DDECLTYPE_FLOAT2, D3DDECLTYPE_FLOAT3, or D3DDECLTYPE_FLOAT4. Only the .x and .y components are used for the texture map lookup. The output type is always D3DDECLTYPE_FLOAT1. The device must support displacement mapping. For more information about displacement mapping, see Displacement Mapping. This constant is supported only by the programmable pipeline on N-patch data, if N-patches are enabled.

D3DDECLMETHOD_LOOKUPPRESAMPLED

Look up a presampled displacement map. The input type must be set to D3DDECLTYPE_UNUSED. The stream index and the stream offset must be set to 0. The output type for this operation is always D3DDECLTYPE_FLOAT1. The device must support displacement mapping. For more information about displacement mapping, see Displacement Mapping. This constant is supported only by the programmable pipeline on N-patch data, if N-patches are enabled.

Remarks

The tessellator looks at the method to determine what data to calculate from the vertex data during tessellation. Mesh data should use the default value. Patches can use any of the other implemented types.

Vertex data is declared with an array of D3DVERTEXELEMENT9 structures. Each element in the array contains a vertex declaration method.

In addition to using D3DDECLMETHOD_DEFAULT, a normal mesh can use D3DDECLMETHOD_LOOKUP and D3DDECLMETHOD_LOOKUPPRESAMPLED methods when N-patches are enabled.

Enumerated Type Information

Headerd3d9types.h
Minimum operating systems Windows 98


© 2002 Microsoft Corporation. All rights reserved.