Example #1
0
        public MaterialDescriptor Get(GltfData data, int i)
        {
            if (!GltfUnlitMaterialImporter.TryCreateParam(data, i, out var param))
            {
                if (!GltfPbrMaterialImporter.TryCreateParam(data, i, out param))
                {
                    // fallback
#if VRM_DEVELOP
                    Debug.LogWarning($"material: {i} out of range. fallback");
#endif
                    return(new MaterialDescriptor(GetMaterialName(i, null), GltfPbrMaterialImporter.ShaderName));
                }
            }

            return(param);
        }
Example #2
0
        public MaterialDescriptor Get(GltfData data, int i)
        {
            if (GltfUnlitMaterialImporter.TryCreateParam(data, i, out var param))
            {
                return(param);
            }
            if (GltfPbrUrpMaterialImporter.TryCreateParam(data, i, out param))
            {
                return(param);
            }
            // fallback
#if VRM_DEVELOP
            Debug.LogWarning($"material: {i} out of range. fallback");
#endif
            return(new MaterialDescriptor(
                       GetMaterialName(i, null),
                       GltfPbrMaterialImporter.ShaderName,
                       null,
                       new Dictionary <string, TextureDescriptor>(),
                       new Dictionary <string, float>(),
                       new Dictionary <string, Color>(),
                       new Dictionary <string, Vector4>(),
                       new Collection <Action <Material> >()));
        }