Skip to content

Commit

Permalink
Remove material cache, some materials seem not work when cloned
Browse files Browse the repository at this point in the history
  • Loading branch information
tonihele committed May 6, 2024
1 parent ec7f6e1 commit 940d42c
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 940d42c

Please sign in to comment.