diff options
author | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
commit | 15740faf9fe9fe4be08965098bbf2947e096aeeb (patch) | |
tree | a730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/Filters/Mesh/MeshSkinning.h |
Diffstat (limited to 'Runtime/Filters/Mesh/MeshSkinning.h')
-rw-r--r-- | Runtime/Filters/Mesh/MeshSkinning.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/Runtime/Filters/Mesh/MeshSkinning.h b/Runtime/Filters/Mesh/MeshSkinning.h new file mode 100644 index 0000000..b56efa9 --- /dev/null +++ b/Runtime/Filters/Mesh/MeshSkinning.h @@ -0,0 +1,64 @@ +#ifndef MESHSKINNING_H +#define MESHSKINNING_H + +#include "Runtime/Math/Vector3.h" +#include "Runtime/Math/Quaternion.h" +#include "Mesh.h" +#include "Runtime/Geometry/AABB.h" +#include "Runtime/GfxDevice/GfxDeviceTypes.h" +#include <vector> +#include <list> + +class GPUSkinningInfo; + +typedef std::vector<BoneInfluence> CompactSkin; +struct BlendShapeData; + +enum TransformInstruction { kNormalizeFastest = 0, kNormalizeFast = 1, kNoNormalize = 3 }; +class VertexData; + +struct SkinMeshInfo +{ + int bonesPerVertex; + + void* compactSkin; + int boneCount; + + const void* inVertices; + void* outVertices; + int inStride; + int outStride; + + int normalOffset; + int tangentOffset; + bool skinNormals; + bool skinTangents; + + int vertexCount; + + // This is instance data and must be double buffered so the render thread can work in paralell. + UInt8* allocatedBuffer; + Matrix4x4f* cachedPose; + float* blendshapeWeights; + + int blendshapeCount; + const BlendShapeData* blendshapes; + + bool memExport; // Is set up for memexport (Xbox) or streamout (DX11) + +#if UNITY_PS3 + const VertexData* vertexData; +#endif + + GPUSkinningInfo *mei; + + SkinMeshInfo(); + + void Allocate(); + void Release () const; +}; + +void DeformSkinnedMesh (SkinMeshInfo& info); +void* DeformSkinnedMeshJob (void* rawData); + +#endif |