# 视锥剔除

视锥剔除是一种渲染优化技术，它跳过绘制完全位于相机可视体积——即视锥体——之外的物体，从而让渲染工作只花在可能出现在屏幕上的几何体上。视锥体呈截棱锥形状，由六个平面界定：近裁剪面、远裁剪面，以及沿视场边界分布的四个平面。每一帧中，渲染管线都会拿场景物体与该体积做测试，凡是完全落在其外的物体，就完全跳过渲染。<sup>[1](https://unity.com/glossary/frustum-culling)</sup>

| 关键事实 | 详情 |
|---|---|
| 它剔除什么 | 相机可视体积之外的物体，该体积由六个平面界定（近、远以及四个视场边界）<sup>[1](https://unity.com/glossary/frustum-culling)</sup> |
| 它不剔除什么 | 位于视锥体内但被其他物体遮挡的物体；那是遮挡剔除的任务<sup>[2](https://docs.unity.com/en-us/engine/6000.5/manual/cameras/occlusion-culling/occlusion-culling)</sup> |
| 典型测试对象 | 每个物体的包围体，通常是轴对齐包围盒（AABB）或包围球，与视锥体各平面做测试<sup>[3](https://docs.vulkan.org/tutorial/latest/Building_a_Simple_Engine/Advanced_Topics/Culling.html)</sup> |
| 运行时机 | 每帧运行；视锥体随相机移动或透视变化而改变后运行；平面提取在视锥体变化时进行，物体测试则每帧对每个物体进行一次<sup>[4](https://cgvr.informatik.uni-bremen.de/teaching/cg_literatur/lighthouse3d_view_frustum_culling/index.html)</sup> |
| 引擎支持 | 在 Unity 和 Unreal Engine 中默认自动启用；Unreal Engine 按开销顺序应用剔除方法：距离、视锥体、预计算可见性、动态遮挡<sup>[2](https://docs.unity.com/en-us/engine/6000.5/manual/cameras/occlusion-culling/occlusion-culling)</sup><sup> • </sup><sup>[5](https://dev.epicgames.com/documentation/en-us/unreal-engine/visibility-and-occlusion-culling-in-unreal-engine)</sup> |
| GPU 端变体 | 网格着色管线可以在 GPU 本身上执行剔除，例如 NVIDIA 用 Turing 网格着色器演示的“管线内”GPU 剔除<sup>[6](https://developer.nvidia.com/blog/?p=29018)</sup> |

## 视锥体

视锥体是透视相机可见的那片空间区域。它的近平面和远平面垂直于视线，分别位于距相机 nearDist 和 farDist 处。视锥体在这两个平面上的矩形边界尺寸由垂直视场角（fov）和宽高比（视口宽度除以其高度）决定：近平面高度为 Hnear = 2 · tan(fov / 2) · nearDist，宽度为 Wnear = Hnear · ratio，远平面用 farDist 做同样的构造。<sup>[4](https://cgvr.informatik.uni-bremen.de/teaching/cg_literatur/lighthouse3d_view_frustum_culling/index.html)</sup><sup> • </sup><sup>[12](https://learnopengl.com/Getting-Started/Coordinate-Systems)</sup>

由于视锥体完全由六个平面描述，剔除就简化为一个几何问题：物体位于每个平面的哪一侧？这些平面定义时法线指向视锥体内部，因此物体若位于全部六个平面的正侧，就在视锥体内部。<sup>[4](https://cgvr.informatik.uni-bremen.de/teaching/cg_literatur/lighthouse3d_view_frustum_culling/index.html)</sup>

## 测试如何进行

**包围体。** 拿原始三角形几何体直接与平面做测试代价太高，因此引擎对每个物体测试一个廉价的代理体。例如，Vulkan 文档中的示例引擎每帧从投影矩阵与视图矩阵的乘积中提取相机视锥体平面，然后把每个网格实例的局部 AABB 变换到世界空间，再与这些平面做测试。<sup>[3](https://docs.vulkan.org/tutorial/latest/Building_a_Simple_Engine/Advanced_Topics/Culling.html)</sup> 球体测试廉价且与旋转无关，但对于细长或扁平的物体来说过于宽松。<sup>[7](https://deepraster.com/articles/frustum-culling-explained/)</sup>

**盒体拒绝规则。** 一种朴素的盒体测试——当八个角点全在视锥体外时就拒绝该盒体——是错误的：一个盒体可以每个角点都在视锥体外，却仍然与视锥体相交。安全的规则是：仅当盒体的所有点都位于同一个平面的错误一侧时才拒绝它；如果不存在这样的平面，盒体就可能与视锥体相交，必须保留。这种保守测试也可能漏掉完全在视锥体外的盒体而不剔除，这种假阳性会浪费渲染时间，但绝不会导致可见错误。<sup>[4](https://cgvr.informatik.uni-bremen.de/teaching/cg_literatur/lighthouse3d_view_frustum_culling/index.html)</sup>

**平面提取。** 获取世界坐标下六个平面的标准方法有两种。几何方法根据相机的位置、方向、上向量、视场角以及近远距离构建平面，也可以先算出八个角点。裁剪空间方法则从模型-视图-投影组合矩阵代数地推导平面：在归一化裁剪空间中，视锥体变成一个轴对齐盒体，由 x = −1、x = 1、y = −1、y = 1、z = −1 和 z = 1 界定，世界空间平面则作为矩阵各列的组合读出。Gribb 和 Hartmann 关于从世界-视图-投影矩阵快速提取视锥体平面的文档，涵盖了 OpenGL 和 Direct3D 两种情形下的提取方法。<sup>[4](https://cgvr.informatik.uni-bremen.de/teaching/cg_literatur/lighthouse3d_view_frustum_culling/index.html)</sup>

**开销结构。** 平面提取在相机移动或透视变化时各运行一次，而物体测试每帧对每个物体运行一次，物体数量可能很大。因此优化视锥剔除的重点在测试一侧，它占用的时间份额最大。<sup>[4](https://cgvr.informatik.uni-bremen.de/teaching/cg_literatur/lighthouse3d_view_frustum_culling/index.html)</sup>

## 层次剔除

当具备层次化空间分解或包围体层次结构时，可以通过从根到叶遍历层次结构、将落在视锥体外的整个子树剔除掉来优化视锥剔除，这样一个平面测试就能一次丢弃许多物体。<sup>[8](https://www.sci.utah.edu/~csilva/papers/sc2002-m9.pdf)</sup> 用于数亿采样点网格的 QSplat 点渲染系统，就用单一的包围球层次结构同时完成视锥剔除、背面剔除、细节层次选择和渲染。<sup>[9](https://cs233.stanford.edu/papers/qsplat/)</sup>

## 与其他剔除阶段的关系

视锥剔除是一系列可见性测试中的一个阶段。在 [Unreal Engine](https://www.edgepedia.org/zh/unreal-engine) 的 Draw 线程中，剔除过程先运行距离剔除，移除距相机超过设定距离的物体，然后运行视锥剔除，最后运行遮挡剔除——这是开销最大的步骤，精确检查剩余物体是否被其他物体遮挡。<sup>[10](https://dev.epicgames.com/documentation/en-us/unreal-engine/introduction-to-rendering-in-unreal-engine-for-unity-developers)</sup> Unreal 的文档按开销顺序列出其剔除方法：距离、视锥体、预计算可见性、动态遮挡，其中视锥体剔除和硬件遮挡查询在每个项目中默认启用。<sup>[5](https://dev.epicgames.com/documentation/en-us/unreal-engine/visibility-and-occlusion-culling-in-unreal-engine)</sup>

这一区别很重要，因为仅靠视锥剔除会留下大量浪费。Unity 的文档指出，视锥剔除不检查渲染器是否被其他物体遮挡，因此 CPU 和 GPU 时间仍可能花在永远不会出现在最终帧中的渲染器上；遮挡剔除正是为了移除这些。<sup>[2](https://docs.unity.com/en-us/engine/6000.5/manual/cameras/occlusion-culling/occlusion-culling)</sup> 反过来，遮挡测试也不应被用作视锥剔除的替代品：在 GPU 上渲染物体的包围盒来测试可见性，可能比在 CPU 上简单地将盒体与视锥体裁剪平面做测试代价更高，而包围球能让 CPU 测试更快。<sup>[11](https://developer.nvidia.com/gpugems/gpugems/part-v-performance-and-practicalities/chapter-29-efficient-occlusion-culling)</sup>

## 运行位置：CPU 与 GPU

传统上，视锥剔除在场景准备阶段于 CPU 上运行，之后可见物体列表才交给 GPU。在 Unreal Engine 中，Game 线程收集物体变换，Draw 线程运行剔除过程并构建当前相机视图的可见物体列表，然后 GPU 线程渲染该列表。<sup>[10](https://dev.epicgames.com/documentation/en-us/unreal-engine/introduction-to-rendering-in-unreal-engine-for-unity-developers)</sup>

**GPU 驱动剔除** 把测试移到显卡本身上。NVIDIA 随 Turing 引入的网格着色技术支持“管线内”GPU 剔除和细节层次算法，据称对大规模几何体剔除、细节层次管理以及植被和毛发等程序化实例化尤其有效。<sup>[6](https://developer.nvidia.com/blog/?p=29018)</sup> 实践者的实现使用[计算着色器](https://www.edgepedia.org/zh/compute-shader)在渲染前决定哪些实例通过视锥体测试，而 Vulkan 示例引擎建议，一旦场景规模超出可读的示例尺度，下一步可采用基于 AABB 包围体层次结构的层次剔除和 GPU 遮挡剔除。<sup>[3](https://docs.vulkan.org/tutorial/latest/Building_a_Simple_Engine/Advanced_Topics/Culling.html)</sup>

## 实际应用

由于视锥剔除将计算资源集中在可能可见的元素上，它让应用能够保持更高的帧率，并支持比硬件原本能处理的更大、更精细的环境；Unity 举出使用包含数千个组件的建筑模型的建筑可视化和包含精细机械的工业培训模拟作为它能大幅减少渲染工作的场景。<sup>[1](https://unity.com/glossary/frustum-culling)</sup> 现代开发平台将其作为基础优化自动实现，与遮挡剔除等互补技术相互独立地运作。<sup>[1](https://unity.com/glossary/frustum-culling)</sup> 在 Unreal Engine 中，开发者可以用 Stat InitViews 统计数据检查结果，它会报告 视锥剔除阶段花费的帧时间以及 Frustum Culled Primitives 的数量，即因不在视锥体视场内而被移除的图元。<sup>[5](https://dev.epicgames.com/documentation/en-us/unreal-engine/visibility-and-occlusion-culling-in-unreal-engine)</sup>

## References

1. [Frustum Culling, Unity Glossary](https://unity.com/glossary/frustum-culling)
2. [Occlusion culling, Unity Editor documentation](https://docs.unity.com/en-us/engine/6000.5/manual/cameras/occlusion-culling/occlusion-culling)
3. [Frustum Culling and Distance-based LOD, Vulkan Documentation Project](https://docs.vulkan.org/tutorial/latest/Building_a_Simple_Engine/Advanced_Topics/Culling.html)
4. [View Frustum Culling Tutorial, Lighthouse 3D (hosted at Universität Bremen)](https://cgvr.informatik.uni-bremen.de/teaching/cg_literatur/lighthouse3d_view_frustum_culling/index.html)
5. [Visibility and Occlusion Culling in Unreal Engine, Epic Developer Community](https://dev.epicgames.com/documentation/en-us/unreal-engine/visibility-and-occlusion-culling-in-unreal-engine)
6. [Using Mesh Shading to Optimize Your Rasterization Pipeline, NVIDIA Technical Blog](https://developer.nvidia.com/blog/?p=29018)
7. [Frustum Culling Explained: Planes, Bounds, and Visibility, DeepRaster](https://deepraster.com/articles/frustum-culling-explained/)
8. [Hierarchical View-Frustum Culling, Scientific Computing and Imaging Institute, University of Utah](https://www.sci.utah.edu/~csilva/papers/sc2002-m9.pdf)
9. [QSplat: A Multiresolution Point Rendering System for Large Meshes, Rusinkiewicz and Levoy, SIGGRAPH 2000](https://cs233.stanford.edu/papers/qsplat/)
10. [Introduction to Rendering in Unreal Engine for Unity Developers, Epic Developer Community](https://dev.epicgames.com/documentation/en-us/unreal-engine/introduction-to-rendering-in-unreal-engine-for-unity-developers)
11. [Chapter 29. Efficient Occlusion Culling, GPU Gems, NVIDIA Developer](https://developer.nvidia.com/gpugems/gpugems/part-v-performance-and-practicalities/chapter-29-efficient-occlusion-culling)
12. [LearnOpenGL - Coordinate Systems](https://learnopengl.com/Getting-Started/Coordinate-Systems)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 软件与编程 › 按领域划分的应用软件

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/frustum-culling

English original: https://www.edgepedia.org/frustum-culling
