UVAtlas.Pack Method

Language:

Packs the face partitioning data into a texture atlas.

Definition

Visual Basic Public Shared Sub Pack( _
    ByVal mesh As Mesh, _
    ByVal width As Integer, _
    ByVal height As Integer, _
    ByVal gutter As Single, _
    ByVal textureIndex As Integer, _
    ByVal callback As PercentageCompleteCallback, _
    ByVal callbackFrequency As Single, _
    ByVal facePartitioning As GraphicsStream _
)
C# public static void Pack(
    Mesh mesh,
    int width,
    int height,
    float gutter,
    int textureIndex,
    PercentageCompleteCallback callback,
    float callbackFrequency,
    GraphicsStream facePartitioning
);
C++ public:
static void Pack(
    Meshmesh,
    int width,
    int height,
    float gutter,
    int textureIndex,
    PercentageCompleteCallbackcallback,
    float callbackFrequency,
    GraphicsStreamfacePartitioning
);
JScript public static function Pack(
    mesh : Mesh,
    width : int,
    height : int,
    gutter : float,
    textureIndex : int,
    callback : PercentageCompleteCallback,
    callbackFrequency : float,
    facePartitioning : GraphicsStream
);

Parameters

mesh Microsoft.DirectX.Direct3D.Mesh
Input mesh used to calculate the atlas. The atlas must have a position channel and at least a 2-D texture channel.
width System.Int32
The width of the texture the atlas will be used on.
height System.Int32
The height of the texture the atlas will be used on.
gutter System.Single
The minimum distance, in texels between two charts on the atlas. The gutter is scaled by the width. For example, if a gutter of 2.5 is used on a 512x512 texture, then the minimum distance between two charts (in texels) will be 2.5 / 512.0 in UV space.
textureIndex System.Int32
Specifies which texture coordinate to write to in the output mesh (which is cloned from the input mesh). Useful if your vertex has multiple texture coordinates.
callback Microsoft.DirectX.Direct3D.PercentageCompleteCallback
A callback function that can be used to monitor progress.
callbackFrequency System.Single
How often the callback will be called. Use 0.0001f as a default value.
facePartitioning Microsoft.DirectX.GraphicsStream
A GraphicsStream that contains the final face partitioning data.

Remarks

Use UVAtlas.Partition to create an unpacked texture atlas.

Use UVAtlas.Partition to create multiple texture sizes. You may not modify the partitioning data before calling Pack.

Exceptions
Direct3DXException The operation failed.


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

Feedback? Please provide us with your comments on this topic.