From dc9bd07f512adee05a56397ef38bb34c64e1f0c6 Mon Sep 17 00:00:00 2001 From: Masataka SUMI Date: Fri, 7 May 2021 19:55:49 +0900 Subject: [PATCH] Specify color space in exporting VRM0 Material. --- Assets/VRM/Runtime/IO/VRMMaterialExporter.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Assets/VRM/Runtime/IO/VRMMaterialExporter.cs b/Assets/VRM/Runtime/IO/VRMMaterialExporter.cs index e484d256a..7b65783d2 100644 --- a/Assets/VRM/Runtime/IO/VRMMaterialExporter.cs +++ b/Assets/VRM/Runtime/IO/VRMMaterialExporter.cs @@ -5,6 +5,7 @@ using UniGLTF; using UniGLTF.ShaderPropExporter; using UnityEngine; using VRMShaders; +using ColorSpace = UniGLTF.ColorSpace; namespace VRM { @@ -160,7 +161,8 @@ namespace VRM { case ShaderPropertyType.Color: { - var value = m.GetColor(kv.Key).ToArray(); + // No color conversion. Because color property is serialized to raw float array. + var value = m.GetColor(kv.Key).ToFloat4(ColorSpace.Linear, ColorSpace.Linear); material.vectorProperties.Add(kv.Key, value); } break;