TextureGutterHelper.ResampleTexture Method

Language:

Resamples a texture into this gutterhelper's parameterization.

Definition

Visual Basic Public Sub ResampleTexture( _
    ByVal texture As Texture, _
    ByVal mesh As Mesh, _
    ByVal usage As DeclarationUsage, _
    ByVal usageIndex As Integer, _
    ByVal textureOut As Texture _
)
C# public void ResampleTexture(
    Texture texture,
    Mesh mesh,
    DeclarationUsage usage,
    int usageIndex,
    Texture textureOut
);
C++ public:
void ResampleTexture(
    Texture texture,
    Mesh mesh,
    DeclarationUsage usage,
    int usageIndex,
    Texture textureOut
);
JScript public function ResampleTexture(
    texture : Texture,
    mesh : Mesh,
    usage : DeclarationUsage,
    usageIndex : int,
    textureOut : Texture
);

Parameters

texture Microsoft.DirectX.Direct3D.Texture
A Texture object that corresponds to the original parameterization stored in mesh. This texture will be used to create textureOut.
mesh Microsoft.DirectX.Direct3D.Mesh
A Mesh object containing the original and new parameterizations. It is required to store the new parameterization in TextureCoordinate index 0.
usage Microsoft.DirectX.Direct3D.DeclarationUsage
A DeclarationUsage object (used in combination with usageIndex) which identifies the component of the vertex declaration that contains the original parameterization in mesh.
usageIndex System.Int32
Zero-based index (used in combination with usage), which identifies the component of the vertex declaration that contains the original parameterization in mesh. The combination of TextureCoordinate and index 0 is required for the new parameterization; any other usage/index combination may be used.
textureOut Microsoft.DirectX.Direct3D.Texture
The resampled Texture object.

Remarks

A parameterization in the case of this function is a set of texture coordinates that maps the triangles of a mesh to the triangles on a texture. The new parameterization is the set of texture coordinates contained in the gutter helper interface, and the original parameterization is the set of texture coordinates contained within the input mesh.

It is assumed that texture coordinates are between 0 and 1, inclusive, and the new parameterization must be declared in the vertex declaration as texture coordinate index 0. The original texture and the resampled texture must have the same width and height.

One common scenario might be to use UVAtlas to create a texture atlas and then use ResampleTexture to resample the texture into the new parameterization.


Send comments about this topic to Microsoft. © Microsoft Corporation. All rights reserved.

Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center