diff --git a/spine-ue4/Content/Test/Assets/TestMaterial.uasset b/spine-ue4/Content/Test/Assets/TestMaterial.uasset index 34b680ad8..3be136d1f 100644 Binary files a/spine-ue4/Content/Test/Assets/TestMaterial.uasset and b/spine-ue4/Content/Test/Assets/TestMaterial.uasset differ diff --git a/spine-ue4/Content/Test/Test.umap b/spine-ue4/Content/Test/Test.umap index 366f81c00..be9c1f8cd 100644 Binary files a/spine-ue4/Content/Test/Test.umap and b/spine-ue4/Content/Test/Test.umap differ diff --git a/spine-ue4/Plugins/RuntimeMeshComponentPlugin/Source/RuntimeMeshComponent/Private/RuntimeMeshGenericVertex.cpp b/spine-ue4/Plugins/RuntimeMeshComponentPlugin/Source/RuntimeMeshComponent/Private/RuntimeMeshGenericVertex.cpp index 9853f632e..c7d4f393c 100644 --- a/spine-ue4/Plugins/RuntimeMeshComponentPlugin/Source/RuntimeMeshComponent/Private/RuntimeMeshGenericVertex.cpp +++ b/spine-ue4/Plugins/RuntimeMeshComponentPlugin/Source/RuntimeMeshComponent/Private/RuntimeMeshGenericVertex.cpp @@ -7,6 +7,7 @@ // Finish all the built in vertex types. DEFINE_RUNTIME_MESH_VERTEX(FRuntimeMeshVertexSimple); DEFINE_RUNTIME_MESH_VERTEX(FRuntimeMeshVertexDualUV); +DEFINE_RUNTIME_MESH_VERTEX(FRuntimeMeshVertexTripleUV); DEFINE_RUNTIME_MESH_VERTEX(FRuntimeMeshVertexNoPosition); DEFINE_RUNTIME_MESH_VERTEX(FRuntimeMeshVertexNoPositionDualUV); DEFINE_RUNTIME_MESH_VERTEX(FRuntimeMeshVertexHiPrecisionNormals); @@ -21,7 +22,8 @@ const FRuntimeMeshVertexTypeInfo* FRuntimeMeshComponentVerticesBuilder::GetVerte { if (HasUVComponent(1)) { - return &FRuntimeMeshVertexDualUV::TypeInfo; + if (HasUVComponent(2)) return &FRuntimeMeshVertexTripleUV::TypeInfo; + else return &FRuntimeMeshVertexDualUV::TypeInfo; } else { diff --git a/spine-ue4/Plugins/RuntimeMeshComponentPlugin/Source/RuntimeMeshComponent/Public/RuntimeMeshGenericVertex.h b/spine-ue4/Plugins/RuntimeMeshComponentPlugin/Source/RuntimeMeshComponent/Public/RuntimeMeshGenericVertex.h index b50e6824c..255d8367f 100644 --- a/spine-ue4/Plugins/RuntimeMeshComponentPlugin/Source/RuntimeMeshComponent/Public/RuntimeMeshGenericVertex.h +++ b/spine-ue4/Plugins/RuntimeMeshComponentPlugin/Source/RuntimeMeshComponent/Public/RuntimeMeshGenericVertex.h @@ -1249,6 +1249,9 @@ DECLARE_RUNTIME_MESH_VERTEXINTERNAL(FRuntimeMeshVertexSimple, true, true, true, /** Simple vertex with 2 UV channels */ DECLARE_RUNTIME_MESH_VERTEXINTERNAL(FRuntimeMeshVertexDualUV, true, true, true, true, 2, ERuntimeMeshVertexTangentBasisType::Default, ERuntimeMeshVertexUVType::HighPrecision, RUNTIMEMESHCOMPONENT_API) +/** Simple vertex with 3 UV channels */ +DECLARE_RUNTIME_MESH_VERTEXINTERNAL(FRuntimeMeshVertexTripleUV, true, true, true, true, 3, ERuntimeMeshVertexTangentBasisType::Default, ERuntimeMeshVertexUVType::HighPrecision, RUNTIMEMESHCOMPONENT_API) + /** Simple vertex with 1 UV channel and NO position component (Meant to be used with separate position buffer) */ DECLARE_RUNTIME_MESH_VERTEXINTERNAL(FRuntimeMeshVertexNoPosition, false, true, true, true, 1, ERuntimeMeshVertexTangentBasisType::Default, ERuntimeMeshVertexUVType::HighPrecision, RUNTIMEMESHCOMPONENT_API) diff --git a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonRendererComponent.cpp b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonRendererComponent.cpp index 7e38834e2..b82029b8e 100644 --- a/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonRendererComponent.cpp +++ b/spine-ue4/Plugins/SpinePlugin/Source/SpinePlugin/Private/SpineSkeletonRendererComponent.cpp @@ -169,19 +169,19 @@ void USpineSkeletonRendererComponent::TickComponent (float DeltaTime, ELevelTick } } + void USpineSkeletonRendererComponent::Flush (int &Idx, TArray &Vertices, TArray &Indices, TArray &Uvs, TArray &Colors, TArray& Colors2, UMaterialInstanceDynamic* Material) { if (Vertices.Num() == 0) return; SetMaterial(Idx, Material); - TArray darkRG; - TArray darkB; - for (int32 i = 0; i < Colors2.Num(); i++) { - FVector darkColor = Colors2[i]; - darkRG.Add(FVector2D(darkColor.X, darkColor.Y)); - darkB.Add(FVector2D(darkColor.Z, 0)); + TArray verts; + for (int32 i = 0; i < Vertices.Num(); i++) { + verts.Add(FRuntimeMeshVertexTripleUV(Vertices[i], FVector(), FVector(), Colors[i], Uvs[i], FVector2D(Colors2[i].X, Colors2[i].Y), FVector2D(Colors2[i].Z, 0))); } - CreateMeshSection(Idx, Vertices, Indices, TArray(), Uvs, darkRG, Colors, TArray(), false); + CreateMeshSection(Idx, verts, Indices); + + // CreateMeshSection(Idx, Vertices, Indices, TArray(), Uvs, darkRG, Colors, TArray(), false); Vertices.SetNum(0); Indices.SetNum(0); Uvs.SetNum(0);