📄 d3dx9mesh.h
字号:
LPD3DXBUFFER *ppErrorsAndWarnings);
UINT WINAPI
D3DXGetFVFVertexSize(DWORD FVF);
UINT WINAPI
D3DXGetDeclVertexSize(CONST D3DVERTEXELEMENT9 *pDecl,DWORD Stream);
UINT WINAPI
D3DXGetDeclLength(CONST D3DVERTEXELEMENT9 *pDecl);
HRESULT WINAPI
D3DXDeclaratorFromFVF(
DWORD FVF,
D3DVERTEXELEMENT9 pDeclarator[MAX_FVF_DECL_SIZE]);
HRESULT WINAPI
D3DXFVFFromDeclarator(
CONST D3DVERTEXELEMENT9 *pDeclarator,
DWORD *pFVF);
HRESULT WINAPI
D3DXWeldVertices(
LPD3DXMESH pMesh,
DWORD Flags,
CONST D3DXWELDEPSILONS *pEpsilons,
CONST DWORD *pAdjacencyIn,
DWORD *pAdjacencyOut,
DWORD *pFaceRemap,
LPD3DXBUFFER *ppVertexRemap);
typedef struct _D3DXINTERSECTINFO
{
DWORD FaceIndex; // index of face intersected
FLOAT U; // Barycentric Hit Coordinates
FLOAT V; // Barycentric Hit Coordinates
FLOAT Dist; // Ray-Intersection Parameter Distance
} D3DXINTERSECTINFO, *LPD3DXINTERSECTINFO;
HRESULT WINAPI
D3DXIntersect(
LPD3DXBASEMESH pMesh,
CONST D3DXVECTOR3 *pRayPos,
CONST D3DXVECTOR3 *pRayDir,
BOOL *pHit, // True if any faces were intersected
DWORD *pFaceIndex, // index of closest face intersected
FLOAT *pU, // Barycentric Hit Coordinates
FLOAT *pV, // Barycentric Hit Coordinates
FLOAT *pDist, // Ray-Intersection Parameter Distance
LPD3DXBUFFER *ppAllHits, // Array of D3DXINTERSECTINFOs for all hits (not just closest)
DWORD *pCountOfHits); // Number of entries in AllHits array
HRESULT WINAPI
D3DXIntersectSubset(
LPD3DXBASEMESH pMesh,
DWORD AttribId,
CONST D3DXVECTOR3 *pRayPos,
CONST D3DXVECTOR3 *pRayDir,
BOOL *pHit, // True if any faces were intersected
DWORD *pFaceIndex, // index of closest face intersected
FLOAT *pU, // Barycentric Hit Coordinates
FLOAT *pV, // Barycentric Hit Coordinates
FLOAT *pDist, // Ray-Intersection Parameter Distance
LPD3DXBUFFER *ppAllHits, // Array of D3DXINTERSECTINFOs for all hits (not just closest)
DWORD *pCountOfHits); // Number of entries in AllHits array
HRESULT WINAPI D3DXSplitMesh
(
LPD3DXMESH pMeshIn,
CONST DWORD *pAdjacencyIn,
CONST DWORD MaxSize,
CONST DWORD Options,
DWORD *pMeshesOut,
LPD3DXBUFFER *ppMeshArrayOut,
LPD3DXBUFFER *ppAdjacencyArrayOut,
LPD3DXBUFFER *ppFaceRemapArrayOut,
LPD3DXBUFFER *ppVertRemapArrayOut
);
BOOL WINAPI D3DXIntersectTri
(
CONST D3DXVECTOR3 *p0, // Triangle vertex 0 position
CONST D3DXVECTOR3 *p1, // Triangle vertex 1 position
CONST D3DXVECTOR3 *p2, // Triangle vertex 2 position
CONST D3DXVECTOR3 *pRayPos, // Ray origin
CONST D3DXVECTOR3 *pRayDir, // Ray direction
FLOAT *pU, // Barycentric Hit Coordinates
FLOAT *pV, // Barycentric Hit Coordinates
FLOAT *pDist); // Ray-Intersection Parameter Distance
BOOL WINAPI
D3DXSphereBoundProbe(
CONST D3DXVECTOR3 *pCenter,
FLOAT Radius,
CONST D3DXVECTOR3 *pRayPosition,
CONST D3DXVECTOR3 *pRayDirection);
BOOL WINAPI
D3DXBoxBoundProbe(
CONST D3DXVECTOR3 *pMin,
CONST D3DXVECTOR3 *pMax,
CONST D3DXVECTOR3 *pRayPosition,
CONST D3DXVECTOR3 *pRayDirection);
//D3DXComputeTangent
//
//Computes the Tangent vectors for the TexStage texture coordinates
//and places the results in the TANGENT[TangentIndex] specified in the meshes' DECL
//puts the binorm in BINORM[BinormIndex] also specified in the decl.
//
//If neither the binorm or the tangnet are in the meshes declaration,
//the function will fail.
//
//If a tangent or Binorm field is in the Decl, but the user does not
//wish D3DXComputeTangent to replace them, then D3DX_DEFAULT specified
//in the TangentIndex or BinormIndex will cause it to ignore the specified
//semantic.
//
//Wrap should be specified if the texture coordinates wrap.
HRESULT WINAPI D3DXComputeTangent(LPD3DXMESH Mesh,
DWORD TexStage,
DWORD TangentIndex,
DWORD BinormIndex,
DWORD Wrap,
CONST DWORD *pAdjacency);
HRESULT WINAPI
D3DXConvertMeshSubsetToSingleStrip(
LPD3DXBASEMESH MeshIn,
DWORD AttribId,
DWORD IBOptions,
LPDIRECT3DINDEXBUFFER9 *ppIndexBuffer,
DWORD *pNumIndices);
HRESULT WINAPI
D3DXConvertMeshSubsetToStrips(
LPD3DXBASEMESH MeshIn,
DWORD AttribId,
DWORD IBOptions,
LPDIRECT3DINDEXBUFFER9 *ppIndexBuffer,
DWORD *pNumIndices,
LPD3DXBUFFER *ppStripLengths,
DWORD *pNumStrips);
//============================================================================
//
// D3DXOptimizeFaces:
// --------------------
// Generate a face remapping for a triangle list that more effectively utilizes
// vertex caches. This optimization is identical to the one provided
// by ID3DXMesh::Optimize with the hardware independent option enabled.
//
// Parameters:
// pbIndices
// Triangle list indices to use for generating a vertex ordering
// NumFaces
// Number of faces in the triangle list
// NumVertices
// Number of vertices referenced by the triangle list
// b32BitIndices
// TRUE if indices are 32 bit, FALSE if indices are 16 bit
// pFaceRemap
// Destination buffer to store face ordering
// The number stored for a given element is where in the new ordering
// the face will have come from. See ID3DXMesh::Optimize for more info.
//
//============================================================================
HRESULT WINAPI
D3DXOptimizeFaces(
LPCVOID pbIndices,
UINT cFaces,
UINT cVertices,
BOOL b32BitIndices,
DWORD* pFaceRemap);
//============================================================================
//
// D3DXOptimizeVertices:
// --------------------
// Generate a vertex remapping to optimize for in order use of vertices for
// a given set of indices. This is commonly used after applying the face
// remap generated by D3DXOptimizeFaces
//
// Parameters:
// pbIndices
// Triangle list indices to use for generating a vertex ordering
// NumFaces
// Number of faces in the triangle list
// NumVertices
// Number of vertices referenced by the triangle list
// b32BitIndices
// TRUE if indices are 32 bit, FALSE if indices are 16 bit
// pVertexRemap
// Destination buffer to store vertex ordering
// The number stored for a given element is where in the new ordering
// the vertex will have come from. See ID3DXMesh::Optimize for more info.
//
//============================================================================
HRESULT WINAPI
D3DXOptimizeVertices(
LPCVOID pbIndices,
UINT cFaces,
UINT cVertices,
BOOL b32BitIndices,
DWORD* pVertexRemap);
#ifdef __cplusplus
}
#endif //__cplusplus
//===========================================================================
//
// Data structures for Spherical Harmonic Precomputation
//
//
//============================================================================
typedef enum _D3DXSHCOMPRESSQUALITYTYPE {
D3DXSHCQUAL_FASTLOWQUALITY = 1,
D3DXSHCQUAL_SLOWHIGHQUALITY = 2,
D3DXSHCQUAL_FORCE_DWORD = 0x7fffffff
} D3DXSHCOMPRESSQUALITYTYPE;
typedef enum _D3DXSHGPUSIMOPT {
D3DXSHGPUSIMOPT_SHADOWRES256 = 1,
D3DXSHGPUSIMOPT_SHADOWRES512 = 0,
D3DXSHGPUSIMOPT_SHADOWRES1024 = 2,
D3DXSHGPUSIMOPT_SHADOWRES2048 = 3,
D3DXSHGPUSIMOPT_HIGHQUALITY = 4,
D3DXSHGPUSIMOPT_FORCE_DWORD = 0x7fffffff
} D3DXSHGPUSIMOPT;
// for all properties that are colors the luminance is computed
// if the simulator is run with a single channel using the following
// formula: R * 0.2125 + G * 0.7154 + B * 0.0721
typedef struct _D3DXSHMATERIAL {
D3DCOLORVALUE Diffuse; // Diffuse albedo of the surface. (Ignored if object is a Mirror)
BOOL bMirror; // Must be set to FALSE. bMirror == TRUE not currently supported
BOOL bSubSurf; // true if the object does subsurface scattering - can't do this and be a mirror
// subsurface scattering parameters
FLOAT RelativeIndexOfRefraction;
D3DCOLORVALUE Absorption;
D3DCOLORVALUE ReducedScattering;
} D3DXSHMATERIAL;
// allocated in D3DXSHPRTCompSplitMeshSC
// vertices are duplicated into multiple super clusters but
// only have a valid status in one super cluster (fill in the rest)
typedef struct _D3DXSHPRTSPLITMESHVERTDATA {
UINT uVertRemap; // vertex in original mesh this corresponds to
UINT uSubCluster; // cluster index relative to super cluster
UCHAR ucVertStatus; // 1 if vertex has valid data, 0 if it is "fill"
} D3DXSHPRTSPLITMESHVERTDATA;
// used in D3DXSHPRTCompSplitMeshSC
// information for each super cluster that maps into face/vert arrays
typedef struct _D3DXSHPRTSPLITMESHCLUSTERDATA {
UINT uVertStart; // initial index into remapped vertex array
UINT uVertLength; // number of vertices in this super cluster
UINT uFaceStart; // initial index into face array
UINT uFaceLength; // number of faces in this super cluster
UINT uClusterStart; // initial index into cluster array
UINT uClusterLength; // number of clusters in this super cluster
} D3DXSHPRTSPLITMESHCLUSTERDATA;
// call back function for simulator
// return S_OK to keep running the simulator - anything else represents
// failure and the simulator will abort.
typedef HRESULT (WINAPI *LPD3DXSHPRTSIMCB)(float fPercentDone, LPVOID lpUserContext);
// interfaces for PRT buffers/simulator
// GUIDs
// {F1827E47-00A8-49cd-908C-9D11955F8728}
DEFINE_GUID(IID_ID3DXPRTBuffer,
0xf1827e47, 0xa8, 0x49cd, 0x90, 0x8c, 0x9d, 0x11, 0x95, 0x5f, 0x87, 0x28);
// {A758D465-FE8D-45ad-9CF0-D01E56266A07}
DEFINE_GUID(IID_ID3DXPRTCompBuffer,
0xa758d465, 0xfe8d, 0x45ad, 0x9c, 0xf0, 0xd0, 0x1e, 0x56, 0x26, 0x6a, 0x7);
// {06F57E0A-BD95-43f1-A3DA-791CF6CA297B}
DEFINE_GUID(IID_ID3DXTextureGutterHelper,
0x6f57e0a, 0xbd95, 0x43f1, 0xa3, 0xda, 0x79, 0x1c, 0xf6, 0xca, 0x29, 0x7b);
// {C3F4ADBF-E6D2-4b7b-BFE8-9E7208746ADF}
DEFINE_GUID(IID_ID3DXPRTEngine,
0xc3f4adbf, 0xe6d2, 0x4b7b, 0xbf, 0xe8, 0x9e, 0x72, 0x8, 0x74, 0x6a, 0xdf);
// interface defenitions
typedef interface ID3DXTextureGutterHelper ID3DXTextureGutterHelper;
typedef interface ID3DXTextureGutterHelper *LPD3DXTEXTUREGUTTERHELPER;
typedef interface ID3DXPRTBuffer ID3DXPRTBuffer;
typedef interface ID3DXPRTBuffer *LPD3DXPRTBUFFER;
#undef INTERFACE
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -