It creates a textured cube, renders once, then calls
const loader = new THREE.TextureLoader();
function loadTexture(url) {
return new Promise((resolve, reject) => {
loader.load(url, resolve, undefined, reject);
});
}
const texture = await loadTexture('https://threejs.org/examples/textures/colors.png');
const material = new THREE.MeshBasicMaterial({
map: texture,
});
const mesh = new THREE.Mesh(geometry, material);
scene.add(mesh);
renderer.render(scene, camera);
material.dispose();
texture.dispose();
geometry.dispose();
THREE.Cache.clear();
renderer.renderLists.dispose();
At the top I wrote some code to track WebGL resources. It shows that the textures were never freed. Am I supposed to do something else to see the textures get freed?
Description of the problem
Here's some code
https://jsfiddle.net/greggman/t1y8e3rq/
It creates a textured cube, renders once, then calls
At the top I wrote some code to track WebGL resources. It shows that the textures were never freed. Am I supposed to do something else to see the textures get freed?
Three.js version
Browser
OS