diff --git a/jme3-plugins/src/gltf/java/com/jme3/scene/plugins/gltf/GltfLoader.java b/jme3-plugins/src/gltf/java/com/jme3/scene/plugins/gltf/GltfLoader.java index c24efbadc1..46adacd386 100644 --- a/jme3-plugins/src/gltf/java/com/jme3/scene/plugins/gltf/GltfLoader.java +++ b/jme3-plugins/src/gltf/java/com/jme3/scene/plugins/gltf/GltfLoader.java @@ -619,11 +619,6 @@ protected byte[] getBytes(int bufferIndex, String uri, Integer bufferLength) thr public Material readMaterial(int materialIndex) throws IOException { assertNotNull(materials, "There is no material defined yet a mesh references one"); - Material material = fetchFromCache("materials", materialIndex, Material.class); - if (material != null) { - return material.clone(); - } - JsonObject matData = materials.get(materialIndex).getAsJsonObject(); JsonObject pbrMat = matData.getAsJsonObject("pbrMetallicRoughness"); @@ -693,10 +688,7 @@ public Material readMaterial(int materialIndex) throws IOException { adapter.setParam("emissiveTexture", readTexture(matData.getAsJsonObject("emissiveTexture"))); - material = adapter.getMaterial(); - addToCache("materials", materialIndex, material, materials.size()); - - return material; + return adapter.getMaterial(); } public void readCameras() throws IOException {