private static RenderMode GetBlendMode(GltfFormat.VrmMaterial material) { if (material.IsKeywordEnabled(MToonUtils.KeyAlphaTestOn)) { return(RenderMode.Cutout); } else if (material.IsKeywordEnabled(MToonUtils.KeyAlphaBlendOn)) { switch (material.GetInt(MToonUtils.PropZWrite)) { case MToonUtils.EnabledIntValue: return(RenderMode.TransparentWithZWrite); case MToonUtils.DisabledIntValue: return(RenderMode.Transparent); default: throw new ArgumentException("Invalid ZWrite Int Value."); } } else { return(RenderMode.Opaque); } }
private static OutlineColorMode GetOutlineColorMode(GltfFormat.VrmMaterial material) { if (material.IsKeywordEnabled(MToonUtils.KeyOutlineColorFixed)) { return(OutlineColorMode.FixedColor); } if (material.IsKeywordEnabled(MToonUtils.KeyOutlineColorMixed)) { return(OutlineColorMode.MixedLighting); } return(OutlineColorMode.FixedColor); }
private static OutlineWidthMode GetOutlineWidthMode(GltfFormat.VrmMaterial material) { if (material.IsKeywordEnabled(MToonUtils.KeyOutlineWidthWorld)) { return(OutlineWidthMode.WorldCoordinates); } if (material.IsKeywordEnabled(MToonUtils.KeyOutlineWidthScreen)) { return(OutlineWidthMode.ScreenCoordinates); } return(OutlineWidthMode.None); }