mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-12 05:48:47 -05:00
don't export alpha if material has no transparency
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Linq;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using UniGLTF.UniUnlit;
|
||||
using UnityEngine;
|
||||
using VRMShaders;
|
||||
@@ -38,7 +39,10 @@ namespace UniGLTF
|
||||
|
||||
if (m.HasProperty("_MainTex"))
|
||||
{
|
||||
var index = textureManager.ExportAsSRgb(m.GetTexture("_MainTex"), needsAlpha: true);
|
||||
var hasTransparency = string.Equals(material.alphaMode, "MASK", StringComparison.Ordinal) ||
|
||||
string.Equals(material.alphaMode, "BLEND", StringComparison.Ordinal);
|
||||
|
||||
var index = textureManager.ExportAsSRgb(m.GetTexture("_MainTex"), hasTransparency);
|
||||
if (index != -1)
|
||||
{
|
||||
material.pbrMetallicRoughness.baseColorTexture = new glTFMaterialBaseColorTextureInfo()
|
||||
|
||||
Reference in New Issue
Block a user