# 隐藏面消除

隐藏面消除（Hidden surface removal, HSR），又称可见面判定，是三维计算机图形学中的一个问题：确定场景中哪些部分从给定视点可见，并丢弃被其他几何体遮挡的表面，从而使渲染出的图像只显示观察者所能看到的内容。自该领域诞生以来，这一问题始终是计算机图形学的核心问题；20世纪70年代，人们开发了多种HSR算法，用于确定图像中场景图元的可见部分。<sup>[1](https://www.sci.utah.edu/~csilva/papers/tvcg2003bcr.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 问题 | 确定三维场景中哪些表面从某一视点可见，并剔除被其他几何体遮挡的表面<sup>[1](https://www.sci.utah.edu/~csilva/papers/tvcg2003bcr.pdf)</sup> |
| 里程碑式综述 | 萨瑟兰、斯普劳尔和舒马克，《十种隐藏面算法的特征刻画》，《ACM计算综述》第6卷第1期，第1–55页，1974年3月<sup>[2](https://www.scinovex.com/articles/W1991651582)</sup> |
| 标准算法 | z缓冲（深度缓冲）是当今所有图形硬件的标准，原因在于其实现直接，且板载内存成本下降<sup>[3](https://www.researchgate.net/publication/220061856_Occlusion_Culling_Algorithms_A_Comprehensive_Survey)</sup> |
| 算法分类 | 对象空间方法基于场景几何体判定可见性；图像空间方法在投影平面上逐像素点判定可见性<sup>[4](https://ebooks.inflibnet.ac.in/csp06/chapter/visible-surface-detection/)</sup> |
| 硬件扩展 | 基于瓦片的延迟渲染（TBDR）GPU，如PowerVR和Apple silicon，在片元着色之前执行隐藏面消除，对于完全不透明的渲染彻底消除过度绘制<sup>[5](https://docs.imgtec.com/starter-guides/powervr-architecture/html/topics/tile-based-deferred-rendering-index.html)</sup> |
| 实测效果 | 在Shadowgun的一帧中，未优化时每个屏幕像素平均着色4.7个片元；在支持HSR的PowerVR设备上，每像素1.2个片元，减少了75%<sup>[6](https://docs.imgtec.com/starter-guides/powervr-architecture/html/topics/hidden-surface-removal-efficiency.html)</sup> |

## 问题

从某一视点渲染的三维场景包含许多图元，通常是多边形，它们投影到图像中相同的像素上。每条视线方向上只应显示最近的表面，其余表面则是隐藏的。确定图像中场景图元的可见部分，从该领域诞生之初就被认为是一个基本问题；如今，对于交互式应用而言，这一基本问题已被认为基本解决，通常选用的算法是Z缓冲。<sup>[1](https://www.sci.utah.edu/~csilva/papers/tvcg2003bcr.pdf)</sup>

文献区分对象空间方法与图像空间方法。对象空间算法作用于场景几何体本身，可以精确判定可见性；图像空间算法在投影平面上逐像素点判定可见性。图像空间方法的例子包括深度缓冲（z缓冲）、扫描线和光线投射方法，而背面检测、A缓冲、BSP树和八叉树则被归入对象空间一族。<sup>[4](https://ebooks.inflibnet.ac.in/csp06/chapter/visible-surface-detection/)</sup>

## 经典算法

**1974年的特征刻画。** 伊万·E.·萨瑟兰、罗伯特·F.·斯普劳尔和罗伯特·A.·舒马克的综述发表于《ACM计算综述》第6卷第1期，1974年3月，第1–55页。该文通过表明排序的顺序和所用排序的类型构成了现有隐藏面算法之间的差异，并且为减少排序工作量，每种算法都利用了所表示对象的某种连贯性，从而梳理了该领域。<sup>[2](https://www.scinovex.com/articles/W1991651582)</sup><sup> • </sup><sup>[7](https://www.mendeley.com/catalogue/ffe235b8-6223-31fb-9688-36a196a7bdc3/)</sup> 该论文至今仍是标准参考文献；1992年一项关于隐藏线和隐藏面消除的专利将其引用为众所周知的1974年论文，该文讨论了十种隐藏面和隐藏线分析算法的特征。<sup>[8](https://patents.google.com/patent/US5086496A/en)</sup>

**画家算法。** 在画家算法中，场景中的每个多边形按深度排列，绘制方式如同画家作画——最远的物体先画，最近的最后画——这样较近的多边形就覆盖了其后面的多边形。<sup>[9](https://www.eeng.dcu.ie/~ee563/publicnotes/EE563NotesSection2.pdf)</sup> 根据与观察者的距离对对象进行排序，是后来综述中提到的基本隐藏面消除方法之一，与z缓冲并列。<sup>[3](https://www.researchgate.net/publication/220061856_Occlusion_Culling_Algorithms_A_Comprehensive_Survey)</sup>

**Z缓冲。** z缓冲，即深度缓冲，是一种图像空间算法，维护一个二维数组，存储每个像素处最近表面的深度（z坐标）；多边形以及线和点等其他图元可以按任意顺序绘制，深度值最小的平面被绘制。<sup>[10](https://learnlyai.co.uk/en/course-hub/computer-science/graphics-hci-multimedia/computer-graphics/visible-surface-determination)</sup><sup> • </sup><sup>[11](https://forejune.co/stereo/samples6.pdf)</sup> 由于其实现直接且板载内存成本不断下降，z缓冲成为所有图形硬件的标准。<sup>[3](https://www.researchgate.net/publication/220061856_Occlusion_Culling_Algorithms_A_Comprehensive_Survey)</sup>

**BSP树与细分。** [二叉空间分割](https://www.edgepedia.org/zh/binary-space-partitioning)（BSP）树根据观察者方向分离前后，持续划分空间；当专门为隐藏面消除构建BSP树时，分割平面通常从输入多边形集合中选择。<sup>[9](https://www.eeng.dcu.ie/~ee563/publicnotes/EE563NotesSection2.pdf)</sup> 对于曲面，埃德温·卡特穆尔1974年在[犹他大学](https://www.edgepedia.org/zh/university-of-utah)的博士论文《用于曲面计算机显示的细分算法》将递归细分应用于显示问题。<sup>[12](https://www-old.cs.utah.edu/docs/techreports/Catmull.74.pdf)</sup>

**对象空间理论。** 苏珊·E.·多沃德在AT&T贝尔实验室工作期间开始的关于对象空间隐藏面消除的综述，定义了该问题并追溯其历史，涵盖了与按优先级排列面相关的问题和方法，并综述了随着对象日益复杂而出现的各类算法，从xy平行矩形到有序三角形、c朝向面、c朝向多面体、多面体地形直至一般多面体，还论述了可见性图组合和运动视点方面的研究。<sup>[13](https://doi.org/10.1142/S0218195994000185)</sup> 计算几何方面的工作也研究了图像空间/对象空间混合解决方案：给定\(\mathbb{R}^3\)中n个不相交三角形和xy平面中p个采样点（“像素”），通过构造采样可见性图——解析可见性图的梯形分解中包含至少一个像素的梯形子集——来确定每个像素正后方的第一个三角形。<sup>[14](https://arxiv.org/abs/cs/9910017)</sup>

## 从HSR到剔除

隐藏面消除在图元和像素层面解决可见性问题。对于非常庞大的场景，渲染研究向前推进了一步：可见性剔除旨在在实际执行隐藏面消除之前快速剔除不可见的几何体，只绘制可见集，即可能对屏幕至少一个像素有贡献的图元子集。<sup>[1](https://www.sci.utah.edu/~csilva/papers/tvcg2003bcr.pdf)</sup> 遮挡剔除方法与场景内可见性的概念相关联，并从最早的隐藏面消除算法中发展而来；与HSR不同，它们只需确定哪些多边形不可见，无需昂贵的子多边形工作，并且可以保守地高估可见集，因为经典HSR最终会消除不可见的图元。<sup>[3](https://www.researchgate.net/publication/220061856_Occlusion_Culling_Algorithms_A_Comprehensive_Survey)</sup><sup> • </sup><sup>[1](https://www.sci.utah.edu/~csilva/papers/tvcg2003bcr.pdf)</sup>

在遮挡剔除之前有三种经典剔除策略：背面剔除，避免渲染背向观察者的几何体；视锥体剔除，避免渲染视锥体之外的几何体；遮挡剔除则增加了对被场景其他部分遮挡的图元的剔除。<sup>[1](https://www.sci.utah.edu/~csilva/papers/tvcg2003bcr.pdf)</sup> 其动机是输出敏感性：对于大型、密集遮挡的场景，如城市或室内环境，从任何给定视点只有一小部分场景可见，目标是将渲染成本降低到可见部分的复杂度，且主要与整体场景规模无关。<sup>[1](https://www.sci.utah.edu/~csilva/papers/tvcg2003bcr.pdf)</sup> 比特纳和翁卡的更广泛分类将可见面算法与可见性剔除、阴影计算、全局光照以及基于点和基于图像的渲染并列为图形学中可见性计算的分支。<sup>[15](https://www.cg.tuwien.ac.at/research/vr/visibilitysurvey/)</sup>

## 硬件隐藏面消除

**早期深度测试。** 在立即模式GPU上，early-Z技术在图形管线早期执行深度测试，以减少过度绘制，即对随后被另一物体覆盖的像素进行浪费性着色的现象；当几何体按从前到后的顺序提交时，应用获益最大，而这对于移动相机或几何体需要逐帧排序。<sup>[16](https://powervr-graphics.github.io/WebGL_SDK/WebGL_SDK/Documentation/Architecture%20Guides/PowerVR%20Hardware.Architecture%20Overview%20for%20Developers.pdf)</sup> 在OpenGL和Direct3D中，存在早期片元测试以防止片元着色器的不必要执行：如果片元将被深度测试丢弃，执行着色器就是浪费工作。当片元着色器写入gl_FragDepth或使用discard关键字时，该优化被禁用，因为测试必须使用着色器计算的值；出于同样的原因，Direct3D的earlydepthstencil属性强制在着色器执行之前进行深度-模板测试。<sup>[17](https://www.khronos.org/opengl/wiki/Force_Early_Depth)</sup><sup> • </sup><sup>[18](https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/sm5-attributes-earlydepthstencil)</sup>

**基于瓦片的延迟渲染。** PowerVR的基于瓦片的延迟渲染架构在渲染之前捕获整个场景，将帧缓冲分割成保存在快速片上内存中的小矩形瓦片，并将所有纹理映射和着色推迟到所有对象完成可见性测试之后。其隐藏面消除足够高效，对于完全不透明的渲染可以彻底消除过度绘制，并且与early-Z不同，它是像素精确的，且与绘制调用提交顺序无关，因此应用无需从前到后排序图元。<sup>[5](https://docs.imgtec.com/starter-guides/powervr-architecture/html/topics/tile-based-deferred-rendering-index.html)</sup><sup> • </sup><sup>[16](https://powervr-graphics.github.io/WebGL_SDK/WebGL_SDK/Documentation/Architecture%20Guides/PowerVR%20Hardware.Architecture%20Overview%20for%20Developers.pdf)</sup><sup> • </sup><sup>[19](https://imgtec.eetrend.com/sites/imgtec.eetrend.com/files/download/201402/1458-2110-1385011428.pdf)</sup> 在Shadowgun示例帧中，应用平均每屏幕像素提交4.7个片元，而PowerVR设备每像素着色1.2个片元，减少了75%；比率不是1:1，因为混合的UI元素贡献了平均值。<sup>[6](https://docs.imgtec.com/starter-guides/powervr-architecture/html/topics/hidden-surface-removal-efficiency.html)</sup>

Apple silicon GPU采用相同的TBDR方法：GPU将渲染目标分解为瓦片，对每个瓦片推迟渲染阶段，直到评估完该瓦片的所有几何体，并仅对可见图元进行着色。从A11 GPU开始，Apple增加了图像块、瓦片着色和光栅顺序组，其HSR在任何片元着色器运行之前跟踪每个像素的最前可见层。<sup>[20](https://developer.apple.com/documentation/metal/tailor-your-apps-for-apple-gpus-and-tile-based-deferred-rendering?changes=la__1&language=objc)</sup><sup> • </sup><sup>[21](https://developer.apple.com/videos/play/wwdc2020/10602/?time=1008)</sup> 由于硬件执行隐藏面消除，此类GPU上的应用无需从前到后排序图元，并且建议开发者尽量减少混合、alpha测试和discard指令，因为它们会强制延迟深度写入并降低HSR效率。<sup>[22](https://developer.apple.com/library/archive/documentation/OpenGLES/Conceptual/OpenGLESHardwarePlatformGuide_iOS/OpenGLESPlatforms/OpenGLESPlatforms.html)</sup><sup> • </sup><sup>[23](https://docs.imgtec.com/starter-guides/powervr-architecture/html/topics/rules/do-not-use-discard.html)</sup>

## References

1. [Cohen-Or, D., Chrysanthou, Y. L., Silva, C. T., and Durand, F. (2003). A Survey of Visibility for Walkthrough Applications. IEEE Transactions on Visualization and Computer Graphics 9(3).](https://www.sci.utah.edu/~csilva/papers/tvcg2003bcr.pdf)
2. [Sutherland, I. E., Sproull, R. F., and Schumacker, R. A. (1974). A Characterization of Ten Hidden-Surface Algorithms. ACM Computing Surveys 6(1), 1–55.](https://www.scinovex.com/articles/W1991651582)
3. [Cohen-Or et al. Occlusion Culling Algorithms: A Comprehensive Survey (ResearchGate record).](https://www.researchgate.net/publication/220061856_Occlusion_Culling_Algorithms_A_Comprehensive_Survey)
4. [Visible Surface Detection, Computer Graphics and Visualization (e-PG Pathshala / INFLIBNET).](https://ebooks.inflibnet.ac.in/csp06/chapter/visible-surface-detection/)
5. [Tile-Based Deferred Rendering (TBDR), Imagination Technologies PowerVR documentation.](https://docs.imgtec.com/starter-guides/powervr-architecture/html/topics/tile-based-deferred-rendering-index.html)
6. [Hidden Surface Removal Efficiency, Imagination Technologies PowerVR documentation.](https://docs.imgtec.com/starter-guides/powervr-architecture/html/topics/hidden-surface-removal-efficiency.html)
7. [A Characterization of Ten Hidden-Surface Algorithms, Mendeley catalog record.](https://www.mendeley.com/catalogue/ffe235b8-6223-31fb-9688-36a196a7bdc3/)
8. [US5086496A, Method for hidden line and surface removal in a three dimensional display, Google Patents.](https://patents.google.com/patent/US5086496A/en)
9. [Hidden Surface Removal, EE563 course notes, Dublin City University.](https://www.eeng.dcu.ie/~ee563/publicnotes/EE563NotesSection2.pdf)
10. [Visible Surface Determination, LearnlyAI Computer Graphics notes.](https://learnlyai.co.uk/en/course-hub/computer-science/graphics-hci-multimedia/computer-graphics/visible-surface-determination)
11. [An Introduction to 3D Computer Graphics, Stereoscopic (course text excerpt).](https://forejune.co/stereo/samples6.pdf)
12. [Catmull, E. E. (1974). A Subdivision Algorithm for Computer Display of Curved Surfaces. Ph.D. dissertation, University of Utah, UTEC-CSc-74-133.](https://www-old.cs.utah.edu/docs/techreports/Catmull.74.pdf)
13. [Dorward, S. E. (1994). A Survey of Object-Space Hidden Surface Removal. International Journal of Computational Geometry & Applications.](https://doi.org/10.1142/S0218195994000185)
14. [Finite-resolution hidden surface removal, arXiv cs/9910017.](https://arxiv.org/abs/cs/9910017)
15. [Bittner, J., and Wonka, P. Visibility in Computer Graphics, TU Wien Research Unit of Computer Graphics.](https://www.cg.tuwien.ac.at/research/vr/visibilitysurvey/)
16. [PowerVR Hardware: Architecture Overview for Developers, Imagination Technologies (PDF).](https://powervr-graphics.github.io/WebGL_SDK/WebGL_SDK/Documentation/Architecture%20Guides/PowerVR%20Hardware.Architecture%20Overview%20for%20Developers.pdf)
17. [Early Fragment Test, OpenGL Wiki, Khronos Group.](https://www.khronos.org/opengl/wiki/Force_Early_Depth)
18. [earlydepthstencil, Win32 apps, Microsoft Learn.](https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/sm5-attributes-earlydepthstencil)
19. [PowerVR TBDR pipeline description (Imagination document).](https://imgtec.eetrend.com/sites/imgtec.eetrend.com/files/download/201402/1458-2110-1385011428.pdf)
20. [Tailor your apps for Apple GPUs and tile-based deferred rendering, Apple Developer Documentation.](https://developer.apple.com/documentation/metal/tailor-your-apps-for-apple-gpus-and-tile-based-deferred-rendering?changes=la__1&language=objc)
21. [Harness Apple GPUs with Metal, WWDC20 session, Apple Developer.](https://developer.apple.com/videos/play/wwdc2020/10602/?time=1008)
22. [OpenGL ES Hardware Processors, Apple Developer Library.](https://developer.apple.com/library/archive/documentation/OpenGLES/Conceptual/OpenGLESHardwarePlatformGuide_iOS/OpenGLESPlatforms/OpenGLESPlatforms.html)
23. [Do Not Use Discard, Imagination Technologies PowerVR documentation.](https://docs.imgtec.com/starter-guides/powervr-architecture/html/topics/rules/do-not-use-discard.html)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 计算机硬件 › Graphics & GPU hardware

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/hidden-surface-removal

English original: https://www.edgepedia.org/hidden-surface-removal
