Skip to content

Commit

Permalink
Remove material cache, some materials seem not work when cloned (#2255)
Browse files Browse the repository at this point in the history
  • Loading branch information
tonihele committed May 7, 2024
1 parent c81381a commit ff7374b
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 ff7374b

Please sign in to comment.