Added basic blending and refactored some files

This commit is contained in:
Maximilian Winter
2022-12-10 15:02:53 +01:00
parent ee0fa7a5fa
commit 9f8a7fb7d8
43 changed files with 13583 additions and 345 deletions

View File

@ -128,7 +128,7 @@ namespace TAO.VertexAnimation
// Bake mesh for a copy and to apply the new UV's to.
SkinnedMeshRenderer skinnedMeshRenderer = model.GetComponent<SkinnedMeshRenderer>();
skinnedMeshRenderer.BakeMesh(mesh);
mesh = model.GetComponent<SkinnedMeshRenderer>().sharedMesh.Copy();
mesh.RecalculateBounds();
mesh.uv3 = mesh.BakePositionUVs(animationInfo);

View File

@ -7,11 +7,10 @@ namespace TAO.VertexAnimation
public static Mesh[] GenerateLOD(this Mesh mesh, int lods, float[] quality)
{
Mesh[] lodMeshes = new Mesh[lods];
for (int lm = 0; lm < lodMeshes.Length; lm++)
{
lodMeshes[lm] = mesh.Copy();
// Only simplify when needed.
if (quality[lm] < 1.0f)
{

View File

@ -24,7 +24,7 @@ namespace TAO.VertexAnimation
uv5 = mesh.uv5,
uv6 = mesh.uv6,
uv7 = mesh.uv7,
uv8 = mesh.uv8
uv8 = mesh.uv8,
};
return copy;
@ -35,6 +35,7 @@ namespace TAO.VertexAnimation
{
mesh.Optimize();
mesh.UploadMeshData(true);
}
}
}