D3DXSHPRTCompSplitMeshSC
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.
HRESULT D3DXSHPRTCompSplitMeshSC(
UINT * pClusterIDs,
UINT NumVertices,
UINT NumCs,
UINT * pSClusterIDs,
UINT NumSCs,
LPVOID pInputIB,
BOOL InputIBIs32Bit,
UINT NumFaces,
LPD3DXBUFFER * ppIBData,
UINT * pIBDataLength,
BOOL OutputIBIs32Bit,
LPD3DXBUFFER * ppFaceRemap,
LPD3DXBUFFER * ppVertData,
UINT * pVertDataLength,
UINT * pSCClusterList,
D3DXSHPRTSPLITMESHCLUSTERDATA* pSCData
);
Parameters
- pClusterIDs
- [in] uNumVerts cluster IDs (extracted from a compressed buffer.)
- NumVertices
- [in] Number of vertices in original mesh.
- NumCs
- [in] Number of clusters (input parameter to compression.)
- pSClusterIDs
- [in] Array of size uNumC that will contain super cluster IDs.
- NumSCs
- [in] Number of super clusters allocated in D3DXSHPRTCompSuperCluster.
- pInputIB
- [in] Raw index buffer for mesh. The format depends on InputIBIs32Bit.
- InputIBIs32Bit
- [in] If TRUE, the index buffer is set to 32 bit; otherwise, 16 bit.
- NumFaces
- [in] Number of faces in the original mesh (pInputIB is 3 times this length.)
- ppIBData
- [in, out] Raw index buffer that will contain the resulting split faces. Format determined by bIBIs32Bit. Allocated by function.
- pIBDataLength
- [in, out] Length of ppIBData, assigned in function.
- OutputIBIs32Bit
- [in, out] If TRUE, allocates an unsigned integer array; otherwise, allocates an unsigned short array.
- ppFaceRemap
- [in, out] Mapping of each face in ppIBData to original faces. Length is *pIBDataLength/3.
- ppVertData
- [in, out] New vertex data structure. Size of pVertDataLength.
- pVertDataLength
- [in, out] Number of new vertices in split mesh. Assigned in function.
- pSCClusterList
- [in, out] Array of length uNumC which pSCData indexes into (Cluster* fields) for each supercluster, contains clusters sorted by supercluster.
- pSCData
- [in, out] Structure per super cluster. Contains indices into ppIBData, pSCClusterList, and ppVertData.
Return Values
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
Header: Declared in D3dx9mesh.h.