mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-07-21 01:35:52 -05:00
change condition to defencive
This commit is contained in:
parent
5ee806d672
commit
8e4cfafcf5
|
|
@ -39,10 +39,10 @@ namespace UniGLTF
|
|||
|
||||
if (m.HasProperty("_MainTex"))
|
||||
{
|
||||
var hasTransparency = string.Equals(material.alphaMode, "MASK", StringComparison.Ordinal) ||
|
||||
string.Equals(material.alphaMode, "BLEND", StringComparison.Ordinal);
|
||||
// Don't export alpha channel if material was OPAQUE
|
||||
var unnecessaryAlpha = string.Equals(material.alphaMode, "OPAQUE", StringComparison.Ordinal);
|
||||
|
||||
var index = textureManager.RegisterExportingAsSRgb(m.GetTexture("_MainTex"), hasTransparency);
|
||||
var index = textureManager.RegisterExportingAsSRgb(m.GetTexture("_MainTex"), !unnecessaryAlpha);
|
||||
if (index != -1)
|
||||
{
|
||||
material.pbrMetallicRoughness.baseColorTexture = new glTFMaterialBaseColorTextureInfo()
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user