From 5ef92b4bdcb8ffe86f6627af41b000370e91fccf Mon Sep 17 00:00:00 2001 From: PoChang007 Date: Wed, 13 Jan 2021 16:10:21 +0900 Subject: [PATCH] import/export uniunlit's alphacutoff --- Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialExporter.cs | 1 + Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialImporter.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialExporter.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialExporter.cs index ca04a7d2b..3bc1861d3 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialExporter.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialExporter.cs @@ -263,6 +263,7 @@ namespace UniGLTF else if (renderMode == UniUnlitRenderMode.Cutout) { material.alphaMode = glTFBlendMode.MASK.ToString(); + material.alphaCutoff = m.GetFloat("_Cutoff"); } else { diff --git a/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialImporter.cs b/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialImporter.cs index 5da283f84..790b0224c 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialImporter.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialImporter.cs @@ -116,6 +116,7 @@ namespace UniGLTF else if (x.alphaMode == "MASK") { UniUnlit.Utils.SetRenderMode(material, UniUnlit.UniUnlitRenderMode.Cutout); + material.SetFloat("_Cutoff", x.alphaCutoff); } else {