Fix #214. Set _Cutoff parameters when alphaMode is MASK

This commit is contained in:
yutopp
2019-03-11 19:04:14 +09:00
parent 1b36bee647
commit a682ee59c2

View File

@@ -38,7 +38,7 @@ namespace UniGLTF
}
/// StandardShader vaiables
///
///
/// _Color
/// _MainTex
/// _Cutoff
@@ -163,7 +163,7 @@ namespace UniGLTF
var prop = "_MetallicGlossMap";
material.SetTexture(prop, texture.ConvertTexture(prop));
}
material.SetFloat("_Metallic", 1.0f);
material.SetFloat("_GlossMapScale", 1.0f - x.pbrMetallicRoughness.roughnessFactor);
}
@@ -240,11 +240,12 @@ namespace UniGLTF
material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.Zero);
material.SetInt("_ZWrite", 1);
material.SetFloat("_Cutoff ", x.alphaCutoff);
material.EnableKeyword("_ALPHATEST_ON");
material.DisableKeyword("_ALPHABLEND_ON");
material.DisableKeyword("_ALPHAPREMULTIPLY_ON");
material.renderQueue = 2450;
break;
default: // OPAQUE