Skip to content

Commit bbd3c55

Browse files
enable caching of animated materials
1 parent 43fea37 commit bbd3c55

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/model/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ let createCube = function (width, height, depth, name, faces, fallbackFaces, tex
851851
let hasTransparency = canvas.hasTransparency;
852852

853853
if (materialCache.hasOwnProperty(hash)) {// Use material from cache
854-
console.debug("Using cached Material (" + hash + ")");
854+
console.debug("Using cached Material (" + hash + ", without meta)");
855855
resolve(materialCache[hash]);
856856
return;
857857
}
@@ -909,7 +909,7 @@ let createCube = function (width, height, depth, name, faces, fallbackFaces, tex
909909
let hasTransparency = canvas.hasTransparency;
910910

911911
if (materialCache.hasOwnProperty(hash)) {// Use material from cache
912-
console.debug("Using cached Material (" + hash + ")");
912+
console.debug("Using cached Material (" + hash + ", with meta)");
913913
resolve(materialCache[hash]);
914914
return;
915915
}
@@ -950,7 +950,7 @@ let createCube = function (width, height, depth, name, faces, fallbackFaces, tex
950950
texture.anisotropy = 0;
951951
texture.needsUpdate = true;
952952

953-
console.debug("Caching Texture " + hash);
953+
console.debug("Caching Texture " + hash + ", without meta");
954954
// add texture to cache
955955
textureCache[hash] = texture;
956956

@@ -987,7 +987,7 @@ let createCube = function (width, height, depth, name, faces, fallbackFaces, tex
987987
})
988988

989989
// Add material to cache
990-
console.debug("Caching Material " + hash);
990+
console.debug("Caching Material " + hash + ", with meta");
991991
materialCache[hash] = material;
992992

993993
resolve(material);
@@ -1093,6 +1093,8 @@ ModelRender.cache = {
10931093
geometry: geometryCache,
10941094
instances: instanceCache,
10951095

1096+
animated: animatedTextures,
1097+
10961098

10971099
resetInstances: function () {
10981100
deleteObjectProperties(modelInstances);

0 commit comments

Comments
 (0)