From 0f2c97c10a1e1fdb4148c49b5929249ba6848616 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Thu, 14 Oct 2021 16:25:24 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=9E=E3=82=A4=E3=82=B0=E3=83=AC=E3=83=BC?= =?UTF-8?q?=E3=82=B7=E3=83=A7=E3=83=B3=E6=99=82=E3=81=AB=E5=8F=A4=E3=81=84?= =?UTF-8?q?=E9=A0=82=E7=82=B9Attribute=E3=81=8C=E6=AE=8B=E3=81=A3=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=81=9F(TANGENT,=20COLOR=5F0,=20TEXCOORD=5F1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/VRM10/Runtime/Migration/MeshUpdater.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Assets/VRM10/Runtime/Migration/MeshUpdater.cs b/Assets/VRM10/Runtime/Migration/MeshUpdater.cs index 01fc05ef6..d0d808554 100644 --- a/Assets/VRM10/Runtime/Migration/MeshUpdater.cs +++ b/Assets/VRM10/Runtime/Migration/MeshUpdater.cs @@ -82,6 +82,7 @@ namespace UniVRM10 var uv = AddAccessor(mesh.VertexBuffer.TexCoords); var weights = AddAccessor(mesh.VertexBuffer.Weights); var joints = AddAccessor(mesh.VertexBuffer.Joints); + var color = AddAccessor(mesh.VertexBuffer.Colors); var morphTargets = new MorphAccessor[] { }; if (mesh.MorphTargets != null) @@ -99,7 +100,10 @@ namespace UniVRM10 gltfPrim.indices = AddAccessor(subIndices); gltfPrim.attributes.POSITION = position.Value; gltfPrim.attributes.NORMAL = normal.Value; + gltfPrim.attributes.TANGENT = -1; + gltfPrim.attributes.COLOR_0 = color.GetValueOrDefault(-1); gltfPrim.attributes.TEXCOORD_0 = uv.Value; + gltfPrim.attributes.TEXCOORD_1 = -1; gltfPrim.attributes.WEIGHTS_0 = weights.GetValueOrDefault(-1); gltfPrim.attributes.JOINTS_0 = joints.GetValueOrDefault(-1); foreach (var (gltfMorph, morph) in Enumerable.Zip(gltfPrim.targets, morphTargets, (l, r) => (l, r)))