D3DXSHPRTCompSplitMeshSC function

Used with compressed results of the vertex version of the precomputed radiance transfer (PRT) simulator. After D3DXSHPRTCompSuperCluster has been called, this function can be used to split the mesh into a group of faces/vertices per super cluster. Each super cluster contains all of the faces that contain any vertex classified in one of its clusters. All of the vertices connected to this set of faces are also included with the returned array ppVertStatus indicating whether or not the vertex belongs to the super cluster.

Syntax

HRESULT D3DXSHPRTCompSplitMeshSC(
  _In_    UINT                          *pClusterIDs,
  _In_    UINT                          NumVertices,
  _In_    UINT                          NumCs,
  _In_    UINT                          *pSClusterIDs,
  _In_    UINT                          NumSCs,
  _In_    LPVOID                        pInputIB,
  _In_    BOOL                          InputIBIs32Bit,
  _In_    UINT                          NumFaces,
  _Inout_ LPD3DXBUFFER                  *ppIBData,
  _Inout_ UINT                          *pIBDataLength,
  _Inout_ BOOL                          OutputIBIs32Bit,
  _Inout_ LPD3DXBUFFER                  *ppFaceRemap,
  _Inout_ LPD3DXBUFFER                  *ppVertData,
  _Inout_ UINT                          *pVertDataLength,
  _Inout_ UINT                          *pSCClusterList,
  _Inout_ D3DXSHPRTSPLITMESHCLUSTERDATA *pSCData
);

Parameters

pClusterIDs [in]

Type: UINT*

NumVertices cluster IDs (extracted from a compressed buffer.)

NumVertices [in]

Type: UINT

Number of vertices in original mesh.

NumCs [in]

Type: UINT

Number of clusters (input parameter to compression.)

pSClusterIDs [in]

Type: UINT*

Array of size NumCs that will contain super cluster IDs.

NumSCs [in]

Type: UINT

Number of super clusters allocated in D3DXSHPRTCompSuperCluster.

pInputIB [in]

Type: LPVOID

Raw index buffer for mesh. The format depends on InputIBIs32Bit.

InputIBIs32Bit [in]

Type: BOOL

If TRUE, the index buffer is set to 32 bit; otherwise, 16 bit.

NumFaces [in]

Type: UINT

Number of faces in the original mesh (pInputIB is 3 times this length.)

ppIBData [in, out]

Type: LPD3DXBUFFER*

Raw index buffer that will contain the resulting split faces. Format determined by InputIBIs32Bit. Allocated by function.

pIBDataLength [in, out]

Type: UINT*

Length of ppIBData, assigned in function.

OutputIBIs32Bit [in, out]

Type: BOOL

If TRUE, allocates an unsigned integer array; otherwise, allocates an unsigned short array.

ppFaceRemap [in, out]

Type: LPD3DXBUFFER*

Mapping of each face in ppIBData to original faces. Length is *pIBDataLength/3.

ppVertData [in, out]

Type: LPD3DXBUFFER*

New vertex data structure. Size of pVertDataLength.

pVertDataLength [in, out]

Type: UINT*

Number of new vertices in split mesh. Assigned in function.

pSCClusterList [in, out]

Type: UINT*

Array of length NumCs which pSCData indexes into (pClusterIDs* fields) for each supercluster, contains clusters sorted by supercluster.

pSCData [in, out]

Type: D3DXSHPRTSPLITMESHCLUSTERDATA*

Structure per super cluster. Contains indices into ppIBData, pSCClusterList, and ppVertData.

Return value

Type: HRESULT

If the function succeeds, the return value is D3D_OK. If the function fails, the return value can be one of the following: D3DERR_INVALIDCALL, D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

Requirements

Requirement Value
Header
D3DX9Mesh.h
Library
D3dx9.lib

See also

Precomputed Radiance Transfer Functions