-
Notifications
You must be signed in to change notification settings - Fork 1
Save/load texture atlas for caching to improve performance #12
Copy link
Copy link
Open
Description
The complete process of generating the texture atlas is fairly expensive (including extracting the texture .png files from the resource pack .zip archives, which is not cached either: deathcap/artpacks#15), so it ought to be possible to save it and load a precomputed stitched atlas (including all the mipmap levels) for better performance.
There is existing code when the debug option is enabled to log the canvases to the document:
if (showLevels) {
// add each mip level to the page for debugging TODO: refactor with rect-mip-map demo
pyramid.forEach(function(level, i) {
var img = new Image();
img.src = savePixels(level, 'canvas').toDataURL();
img.style.border = '1px dotted black';
document.body.appendChild(document.createElement('br'));
document.body.appendChild(img);
document.body.appendChild(document.createTextNode(' level #'+i+' ('+img.width+'x'+img.height+')'));
});
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels