Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/performance/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Performance setTexture在three.js中的性能问题_Performance_Three.js_Freeze_Particles - Fatal编程技术网

Performance setTexture在three.js中的性能问题

Performance setTexture在three.js中的性能问题,performance,three.js,freeze,particles,Performance,Three.js,Freeze,Particles,在某些计算机上,当我更改网格的纹理时,应用程序会冻结半秒钟。我在100种不同的网格上做。在Chrome profiler上,我看到Three.js方法setTexture是CPU使用率的首选 我用于应用下一个纹理的方法是最简单的: this.materials.map = this.nextTexture; 这是工作,但我不知道如何优化这一点。 如果改用粒子系统,它会改善一些东西吗 非常感谢您真的使用了100种不同的纹理吗 尝试根据纹理对对象进行排序,以最小化纹理交换 纹理更改是GPU操作中比

在某些计算机上,当我更改网格的纹理时,应用程序会冻结半秒钟。我在100种不同的网格上做。在Chrome profiler上,我看到Three.js方法
setTexture
是CPU使用率的首选

我用于应用下一个纹理的方法是最简单的:

this.materials.map = this.nextTexture;
这是工作,但我不知道如何优化这一点。 如果改用粒子系统,它会改善一些东西吗


非常感谢

您真的使用了100种不同的纹理吗

尝试根据纹理对对象进行排序,以最小化纹理交换


纹理更改是GPU操作中比较昂贵的操作之一。

three.js中的哪些函数花费了很长时间?能否显示更多代码?您是在所有网格上重复使用新纹理,还是每个网格都有自己的纹理?