From efa33106c7e81558558540dcab5f90e39f2b8960 Mon Sep 17 00:00:00 2001 From: thoxey Date: Tue, 25 Jul 2023 12:24:18 +0100 Subject: [PATCH] Implement the change in the VRM10 importer and show where it could be used elsewhere in my local version of UniVRM I have the change I made, and will leave other changes to your discretion --- Assets/VRM10/Runtime/IO/Vrm10Importer.cs | 2 +- Assets/VRM_Samples/SimpleViewer/ViewerUI.cs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Assets/VRM10/Runtime/IO/Vrm10Importer.cs b/Assets/VRM10/Runtime/IO/Vrm10Importer.cs index b4c898839..747fbdd4a 100644 --- a/Assets/VRM10/Runtime/IO/Vrm10Importer.cs +++ b/Assets/VRM10/Runtime/IO/Vrm10Importer.cs @@ -43,7 +43,7 @@ namespace UniVRM10 m_useControlRig = useControlRig; TextureDescriptorGenerator = new Vrm10TextureDescriptorGenerator(Data); - MaterialDescriptorGenerator = materialGenerator ?? new BuiltInVrm10MaterialDescriptorGenerator(); + MaterialDescriptorGenerator = materialGenerator ?? Vrm10RenderPipelineMaterialDescriptorGeneratorDescriptorUtility.GetValidVrm10MaterialDescriptorGenerator(); m_externalMap = externalObjectMap; if (m_externalMap == null) diff --git a/Assets/VRM_Samples/SimpleViewer/ViewerUI.cs b/Assets/VRM_Samples/SimpleViewer/ViewerUI.cs index 6d9be86f7..27294ec96 100644 --- a/Assets/VRM_Samples/SimpleViewer/ViewerUI.cs +++ b/Assets/VRM_Samples/SimpleViewer/ViewerUI.cs @@ -387,6 +387,7 @@ namespace VRM.SimpleViewer static IMaterialDescriptorGenerator GetGltfMaterialGenerator(bool useUrp) { + //Could be refactored to no longer need this check using RenderPipelineMaterialDescriptorGeneratorUtility if (useUrp) { return new UrpGltfMaterialDescriptorGenerator(); @@ -399,6 +400,7 @@ namespace VRM.SimpleViewer static IMaterialDescriptorGenerator GetVrmMaterialGenerator(bool useUrp, VRM.glTF_VRM_extensions vrm) { + //Could be refactored to no longer need this check using VrmRenderPipelineMaterialDescriptorGeneratorDescriptorUtility if (useUrp) { return new VRM.UrpVrmMaterialDescriptorGenerator(vrm);