mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-11 04:54:17 -05:00
vrm shader fallback fix
This commit is contained in:
parent
185f6b8f3d
commit
de2d83d01e
|
|
@ -9,7 +9,7 @@ namespace VRM
|
|||
public class VRMMaterialImporter : MaterialImporter
|
||||
{
|
||||
List<glTF_VRM_Material> m_materials;
|
||||
public VRMMaterialImporter(ImporterContext context, List<glTF_VRM_Material> materials) : base(new ShaderStore(context, "VRM/UnlitTexture"), context)
|
||||
public VRMMaterialImporter(ImporterContext context, List<glTF_VRM_Material> materials) : base(new ShaderStore(context), context)
|
||||
{
|
||||
m_materials = materials;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,14 @@ namespace VRM
|
|||
// "Queue",
|
||||
};
|
||||
|
||||
private static readonly string[] VRMExtensionShaders = new string[]
|
||||
{
|
||||
"VRM/UnlitTransparentZWrite",
|
||||
"VRM/MToon"
|
||||
};
|
||||
|
||||
private static readonly string VRM_USE_GLTFSHADER = "VRM_USE_GLTFSHADER";
|
||||
|
||||
protected override void SerializeMembers(GLTFJsonFormatter f)
|
||||
{
|
||||
f.KeyValue(() => name);
|
||||
|
|
@ -112,6 +120,12 @@ namespace VRM
|
|||
renderQueue = m.renderQueue,
|
||||
};
|
||||
|
||||
if (!VRMExtensionShaders.Contains(m.shader.name))
|
||||
{
|
||||
material.shader = VRM_USE_GLTFSHADER;
|
||||
return material;
|
||||
}
|
||||
|
||||
var prop = PreShaderPropExporter.GetPropsForSupportedShader(m.shader.name);
|
||||
if (prop == null)
|
||||
{
|
||||
|
|
|
|||
2
UniGLTF
2
UniGLTF
|
|
@ -1 +1 @@
|
|||
Subproject commit fae0f5e1f44f8c0fe06c9fd2c61ac99e513c7141
|
||||
Subproject commit 8f04b09b5cb7c12ad0f49b6aaa66800029258f77
|
||||
Loading…
Reference in New Issue
Block a user