Three.js从缓存加载obj模型

时间:2021-08-21 18:53:14

i have a scene containing some obj models, i noticed that each time the page is reloaded the loader loads the objects again from url not from cache. is there is a method to check if the resource occurs in the cache loads it directly?

我有一个包含一些obj模型的场景,我注意到每次重新加载页面时,加载器会再次从url加载对象,而不是从缓存加载。是否有一种方法来检查资源是否在缓存中直接加载它?

Thank you

1 个解决方案

#1


For what I know, ThreeJS doesn't provide that feature embedded for large files. However, you can work with 3rd parties plugins to achive that.

据我所知,ThreeJS没有提供嵌入大文件的功能。但是,您可以使用第三方插件来实现这一点。

There is a plugin called MicroCahce.js that enables to store objects in the GPU Cache. This plugin can be localized here:

有一个名为MicroCahce.js的插件,可以在GPU Cache中存储对象。这个插件可以在这里本地化:

https://github.com/jeromeetienne/MicroCache.js

And you can find the full tutorial step by step explained how to achieve this here:

你可以在这里逐步解释如何实现这一目的的完整教程:

http://learningthreejs.com/blog/2011/09/16/performance-caching-material/

Hope it helps!

希望能帮助到你!

#1


For what I know, ThreeJS doesn't provide that feature embedded for large files. However, you can work with 3rd parties plugins to achive that.

据我所知,ThreeJS没有提供嵌入大文件的功能。但是,您可以使用第三方插件来实现这一点。

There is a plugin called MicroCahce.js that enables to store objects in the GPU Cache. This plugin can be localized here:

有一个名为MicroCahce.js的插件,可以在GPU Cache中存储对象。这个插件可以在这里本地化:

https://github.com/jeromeetienne/MicroCache.js

And you can find the full tutorial step by step explained how to achieve this here:

你可以在这里逐步解释如何实现这一目的的完整教程:

http://learningthreejs.com/blog/2011/09/16/performance-caching-material/

Hope it helps!

希望能帮助到你!