ThreeJS 禁止渲染相机后面的人脸 [英] ThreeJS disable rendering of faces behind the Camera

查看:32
本文介绍了ThreeJS 禁止渲染相机后面的人脸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个全景查看器.图像显示在具有可变面数的球体中.我希望它只在相机方向上渲染面部(以获得更好的性能).

I am Writing a Panorama Viewer. The Image is Displayed in a Sphere with a variable amount of faces. I want it only to render the faces in the camera direction (for better performance).

ThreeJS 是自动执行此操作还是我可以声明未渲染的混搭的特定面?

Does ThreeJS do this automatically or can I declare specific faces of a mash that do not get rendered?

mash.faces[5].rendered = false; 左右.

推荐答案

这个过程叫做 视锥体剔除,而 ThreeJS 会处理这个.

This process is called viewing frustum culling and ThreeJS takes care of this.

ThreeJS 还负责字体和/或背面剔除 取决于您的材质设置.这意味着只渲染面的可见侧.

ThreeJS also takes care of font and/or backface culling depending on your material settings. Meaning that only the visible side of the faces are rendered.

在文档中,您可以找到 ThreeJS Frustum.

Here in the documentation you can find the ThreeJS Frustum.

如果 THREE.Object3D 上的 frustumCulled 属性管理视锥体剔除和 默认设置为 true.

And if the frustumCulled property on THREE.Object3D manages frustum culling and is by default set to true.

这篇关于ThreeJS 禁止渲染相机后面的人脸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆