D3DDECLMETHOD enumeration

Defines the vertex declaration method which is a predefined operation performed by the tessellator (or any procedural geometry routine on 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            = 5,
  D3DDECLMETHOD_LOOKUPPRESAMPLED  = 6
} D3DDECLMETHOD, *LPD3DDECLMETHOD;

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, but are always the same type.

D3DDECLMETHOD_PARTIALU

Computes the tangent at a point on the rectangle or triangle patch in the U direction. The input type can be one of the following:

  • D3DDECLTYPE_D3DCOLOR
  • D3DDECLTYPE_FLOAT3
  • D3DDECLTYPE_FLOAT4
  • D3DDECLTYPE_SHORT4
  • D3DDECLTYPE_UBYTE4

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 one of the following:

  • D3DDECLTYPE_D3DCOLOR
  • D3DDECLTYPE_FLOAT3
  • D3DDECLTYPE_FLOAT4
  • D3DDECLTYPE_SHORT4
  • D3DDECLTYPE_UBYTE4

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 two tangents. The input type can be one of the following:

  • D3DDECLTYPE_D3DCOLOR
  • D3DDECLTYPE_FLOAT3
  • D3DDECLTYPE_FLOAT4
  • D3DDECLTYPE_SHORT4
  • D3DDECLTYPE_UBYTE4

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 2D 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 one of the following:

  • D3DDECLTYPE_FLOAT2
  • D3DDECLTYPE_FLOAT3
  • 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 (Direct3D 9). 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 (Direct3D 9). This constant is supported only by the programmable pipeline on N-patch data, if N-patches are enabled. This method can be used only with D3DDECLUSAGE_SAMPLE.

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.

Requirements

Requirement Value
Header
D3D9Types.h

See also

Direct3D Enumerations