Occlusion Culling 遮挡剔除 相机系列5

Occlusion Culling 遮挡剔除

本文档主要是对Unity官方手册的个人理解与总结(其实以翻译记录为主:>)
仅作为个人学习使用,不得作为商业用途,欢迎转载,并请注明出处。
文章中涉及到的操作都是基于Unity2018.2版本
参考链接:https://docs.unity3d.com/Manual/OcclusionCulling.html

Occlusion Culling is a feature that disables rendering of objects when they are not currently seen by the camera
because they are obscured (occluded) by other objects. This does not happen automatically in 3D computer graphics since most of the time objects farthest away from the camera are drawn first and closer objects are drawn over the top of them (this is called “overdraw”). Occlusion Culling is different from Frustum Culling. Frustum Culling only disables the renderers for objects that are outside the camera’s viewing area but does not disable anything hidden from view by overdraw. Note that when you use Occlusion Culling you will still benefit from Frustum Culling.
遮挡剔除是使对象在被其他物体遮挡,没有被相机看到时关闭渲染的功能。这在3D计算机图形学中不会自动发生,因为大多数情况下,离相机最远的物体会先被绘制出来,而离相机较近的物体会被绘制到它们的上方(这被称为“过度绘制(overdraw)”)。遮挡剔除不同于视锥体剔除。视锥体只会禁用在相机观察区域之外的对象渲染,但不会禁用通过overdraw隐藏的任何对象。注意,当你使用遮挡剔除时,你仍然可以从视锥体剔除中获益。
[外链图片转存失败(img-QMAjvR8O-1567752732651)(https://docs.unity3d.com/uploads/Main/OcclusionNoCulling.jpg)]
A maze-like indoor level. This normal scene view shows all visible Game Objects.
一个迷宫般的室内水平。这个正常的场景视图显示所有可见的游戏对象。

[外链图片转存失败(img-xHkT55B1-1567752732652)(https://docs.unity3d.com/uploads/Main/OcclusionFrustumCulling.jpg)]
Regular frustum culling only renders objects within the camera’s view. This is automatic and always happens.
常规视锥体剔除只渲染相机视野内的对象。这是自动的,总是发生的。

在这里插入图片描述
Occlusion culling removes additional objects from within the camera rendering work if they are entirely obscured by nearer objects.
如果被近距离物体完全遮挡,遮挡剔除会从相机渲染工作中移除额外的物体。

The occlusion culling process will go through the scene using a virtual camera to build a hierarchy of potentially visible sets of objects. This data is used at runtime by each camera to identify what is visible and what is not. Equipped with this information, Unity will ensure only visible objects get sent to be rendered. This reduces the number of draw calls and increases the performance of the game.
遮挡剔除过程将使用虚拟摄像机遍历场景,以构建潜在可见对象集的层次结构。运行时每个相机可使用这些数据来识别哪些是可见的,哪些是不可见的。有了这些信息,Unity将确保只有可见的对象被发送到渲染。这减少了DC的次数,并提高了游戏的性能。

The data for occlusion culling is composed of cells. Each cell is a subdivision of the entire bounding volume of the scene. More specifically the cells form a binary tree. Occlusion Culling uses two trees, one for View Cells (Static Objects) and the other for Target Cells (Moving Objects). View Cells map to a list of indices that define the visible static objects which gives more accurate culling results for static objects.
遮挡剔除的数据由单元格cell组成。每个单元格是整个包围体的细分的场景。更具体地说,这些单元格形成了一个二叉树。遮挡剔除使用两个树,一个用于视图单元格(静态对象),另一个用于目标单元格(移动对象)。视图单元格映射到定义可见静态对象的索引列表,这些索引为静态对象提供更准确的剔除结果。

It is important to keep this in mind when creating your objects because you need a good balance between the size of your objects and the size of the cells. Ideally, you shouldn’t have cells that are too small in comparison with your objects but equally you shouldn’t have objects that cover many cells. You can sometimes improve the culling by breaking large objects into smaller pieces. However,

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值