Don't export alpha channel if alphaMode was not opaque in vrm1.0

This commit is contained in:
Masataka SUMI
2021-06-24 15:27:19 +09:00
parent 3f002f08a4
commit ba086dc0ed

View File

@@ -42,7 +42,7 @@ namespace UniVRM10
// Lighting
dst.pbrMetallicRoughness = new glTFPbrMetallicRoughness();
dst.pbrMetallicRoughness.baseColorFactor = context.BaseColorFactorSrgb.ToFloat4(ColorSpace.sRGB, ColorSpace.Linear);
var baseColorTextureIndex = textureExporter.RegisterExportingAsSRgb(context.BaseColorTexture, needsAlpha: true);
var baseColorTextureIndex = textureExporter.RegisterExportingAsSRgb(context.BaseColorTexture, context.AlphaMode != MToon10AlphaMode.Opaque);
if (baseColorTextureIndex != -1)
{
dst.pbrMetallicRoughness.baseColorTexture = new glTFMaterialBaseColorTextureInfo