作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我需要大约 80 个(移动)反射 ShapeBufferGeometry
在一个场景中,我希望他们共享尽可能多的 Material 数据。
显然,clone()
方法不适用于 Reflector
.
我得到了不反射任何东西的黑色几何图形。
尝试添加 clone()
方法到 prototype
如下,导致根本没有可见的结果:
// Clone function for Reflector
Reflector.prototype.clone = function() {
return new Reflector( this.geometry, this.options );
}
最佳答案
I need about 80 (moving) reflecting ShapeBufferGeometry in a scene and i want them to share as much material data as possible.
Reflector
的每个实例使用单独的渲染 channel 渲染其环境。我非常怀疑场景中的 80 个反射器是否会产生可用的性能。
Reflector
不是为共享 Material 而设计的。一个
clone()
不重构
Reflector
的实现,方法无法实现.
clone()
的目的无论如何,方法是有问题的,因为您的场景中只能有少量镜子。所有这些都必须维护唯一的统一数据。渲染器将自动确保在具有兼容 Material 设置的 Material 之间共享着色器程序。因此,即使许多对象具有独特的 Material 对象,也不应该有明显的性能下降。
关于three.js - 场景中有多个反射器 : How to implement a clone() function?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65425811/
我是一名优秀的程序员,十分优秀!