3 UVAtlasComputeIMTFromSignal
Chuck Walbourn редактировал(а) эту страницу 2022-01-20 17:45:00 -08:00
UVAtlas

Calculates per-triangle IMT's from a custom application-specified signal that varies over the surface of the mesh (generally at a higher frequency than vertex data), to be used as input to UVAtlasCreate or UVAtlasPartition. The signal is evaluated via a user-specified callback function.

HRESULT UVAtlasComputeIMTFromSignal(
    const XMFLOAT3* positions, const XMFLOAT2* texcoords, size_t nVerts,
    const void* indices, DXGI_FORMAT indexFormat, size_t nFaces,
    size_t signalDimension, float maxUVDistance,
    std::function <HRESULT(const DirectX::XMFLOAT2 *uv, size_t primitiveID,
        size_t signalDimension, void* userData, float* signalOut)> signalCallback,
    void *userData,
    std::function<HRESULT(float percentComplete)> statusCallBack,
    float* pIMTArray);

Parameters

signalDimension: How many floats per vertex to use in calculating the IMT.

maxUVDistance: The subdivision will continue until the distance between all vertices is at most this value.

signalCallback: Callback to use to get the signal. It is given the uv coordinates of a vertex, a face id, the number of floats to generate, and an optional userData pointer.

pIMTArray: The resulting IMT data which is passed to UVAtlasCreate or UVAtlasPack which is an array of 3 float values per face.

Remarks

This function requires that the input mesh contain a signal-to-mesh texture mapping (i.e.. texture coordinates). It allows the user to define a signal arbitrarily over the surface of the mesh.