[前言]

今天修了我们引擎里坏了几年的soc,又学到了一些gpuhizculling不一样的东西,看到了一些常用的东西,记录一下。

[基础]

软件soc的基本流程:大致都是从Intel的方案来的

GameTechDev/MaskedOcclusionCulling: Example code for the research paper “Masked Software Occlusion Culling”; implements an efficient alternative to the hierarchical depth buffer algorithm. (github.com)

GameTechDev/OcclusionCulling: Demonstrates a software (CPU) based approach to occllusion culling using multi-threading and SIMD instructions to improve performance. (github.com)

或者就此改进:
「GDC2023干货分享」移动平台上的软光栅遮挡剔除方案

[重点]

这里着重记录一下一个很神奇的优化点:
就算intel 2013版soc和intel 2018版MaskedOcclusionCulling的一个改进的点:
使用的depth buffer是降过分辨率的:最小单位不再是pixel,而是tile(每个tile的尺寸为32 x 8个pixels)(类似Hzb的思想)。但是这样有一个问题,就是由于精度问题与保守光栅化的缘故可能会导致精度损失,所以需要一张mask去对三角形的覆盖情况,来达到比较高的一个精准度

图片

这个mask可以使用simd优化:可以实现对8个tiles的depth test & update的并行计算

图片

MaskedOcclusionCulling论文,强烈推荐读读:
【2016】Masked Software Occlusion Culling - ACM SIGGRAPH Symposium on High Performance Graphics - 简书 (jianshu.com)