Skip to content

Commit fad01ba

Browse files
tonihelescenemax3d
authored andcommitted
Remove material cache, some materials seem not work when cloned (#2255)
1 parent baa92c6 commit fad01ba

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

jme3-plugins/src/gltf/java/com/jme3/scene/plugins/gltf/GltfLoader.java

+1-9
Original file line numberDiff line numberDiff line change
@@ -619,11 +619,6 @@ protected byte[] getBytes(int bufferIndex, String uri, Integer bufferLength) thr
619619
public Material readMaterial(int materialIndex) throws IOException {
620620
assertNotNull(materials, "There is no material defined yet a mesh references one");
621621

622-
Material material = fetchFromCache("materials", materialIndex, Material.class);
623-
if (material != null) {
624-
return material.clone();
625-
}
626-
627622
JsonObject matData = materials.get(materialIndex).getAsJsonObject();
628623
JsonObject pbrMat = matData.getAsJsonObject("pbrMetallicRoughness");
629624

@@ -693,10 +688,7 @@ public Material readMaterial(int materialIndex) throws IOException {
693688

694689
adapter.setParam("emissiveTexture", readTexture(matData.getAsJsonObject("emissiveTexture")));
695690

696-
material = adapter.getMaterial();
697-
addToCache("materials", materialIndex, material, materials.size());
698-
699-
return material;
691+
return adapter.getMaterial();
700692
}
701693

702694
public void readCameras() throws IOException {

0 commit comments

Comments
 (0)