弃置资产 [英] Aframe asset unload
本文介绍了弃置资产的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建了一个无帧动画,其中按顺序加载了许多外部png文件。
I have created an aframe animation where lots of external png files are loaded in a sequence. Works like a charm on desktop, crashes smartphones with little RAM.
是否有诸如 Three.js这样的框架中的资产卸载之类的东西?
Is there anything like an "asset unload" in aframe such as in three.js?
谢谢您的回答。
推荐答案
在0.2.0中,您必须做:
In 0.2.0, you have to do:
AFRAME.utils.texture.textureCache[yourimagesrc]['1 1'].then(function (texture) { texture.dispose(); });
在主数据库中(即将出现0.3.0),您必须执行以下操作:
In master (upcoming 0.3.0), you have to do:
document.querySelector('a-scene').systems.material.textureCache[yourimagesrc]['1 1'].then(function (texture) { texture.dsipose(); });
我有一些工作在不再使用时进行自动纹理处理。我希望在0.4.0中重新引入它。目前,将当前的移动浏览器归咎于不适用于VR。
I had some work doing automatic texture disposal when no longer used. I hope to reintroduce it in 0.4.0. For now, blame current mobile browsers as being ill-suited for VR.
这篇关于弃置资产的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文