Merge pull request #1908 from Santarh/removeOlderShaderExporter

Stop supporting to export legacy vrm shaders.
This commit is contained in:
Masataka SUMI 2022-11-07 13:57:46 +09:00 committed by GitHub
commit a22c212a85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,33 +10,16 @@ namespace VRM
public static readonly string[] SupportedShaderNames =
{
BuiltInVrmMToonMaterialExporter.TargetShaderName,
"VRM/UnlitTexture",
"VRM/UnlitTransparent",
"VRM/UnlitCutout",
"VRM/UnlitTransparentZWrite",
};
private readonly BuiltInGltfMaterialExporter _gltfExporter = new BuiltInGltfMaterialExporter();
public glTFMaterial ExportMaterial(Material src, ITextureExporter textureExporter, GltfExportSettings settings)
{
glTFMaterial dst = default;
switch (src.shader.name)
{
case BuiltInVrmMToonMaterialExporter.TargetShaderName:
if (BuiltInVrmMToonMaterialExporter.TryExportMaterial(src, textureExporter, out dst)) return dst;
break;
case "VRM/UnlitTexture":
if (BuiltInGenericUnlitMaterialExporter.TryExportMaterial(src, glTFBlendMode.OPAQUE, textureExporter, out dst)) return dst;
break;
case "VRM/UnlitTransparent":
if (BuiltInGenericUnlitMaterialExporter.TryExportMaterial(src, glTFBlendMode.BLEND, textureExporter, out dst)) return dst;
break;
case "VRM/UnlitCutout":
if (BuiltInGenericUnlitMaterialExporter.TryExportMaterial(src, glTFBlendMode.MASK, textureExporter, out dst)) return dst;
break;
case "VRM/UnlitTransparentZWrite":
if (BuiltInGenericUnlitMaterialExporter.TryExportMaterial(src, glTFBlendMode.BLEND, textureExporter, out dst)) return dst;
if (BuiltInVrmMToonMaterialExporter.TryExportMaterial(src, textureExporter, out var dst)) return dst;
break;
}