基于几何体信息的反走样方法由于利用几何体的顶点信息进行边缘检测,存在会将内部边缘检测出来的情况,从而造成不必要的反走样,增加了资源消耗。针对这一问题,提出了一种基于边缘优化的几何体信息反走样算法。首先对几何体进行预处理,利用多边形法线信息与摄像机的位置关系检测出边缘;然后使用延期着色技术将场景渲染到纹理中,然后在屏幕空间根据边缘信息确定混合朝向及覆盖率;最后结合覆盖率与边缘相邻像素进行混合。实验结果表明:提出的算法在保留原几何体后处理式反走样方法效率的同时,有效减少了不必要的反走样,边缘检测时间相比基于几何体信息的反走样方法平均提高了22.55%。在场景复杂度提升时能有效减少边缘提取时长,满足实时性的要求。
Geometric post-processing anti-aliasing uses geometric vertex information to detect edges. However, it may detect some internal edges that are needlessly anti-aliased, resulting in extra resource consumption. To solve this problem, this paper presents a geometric information anti-aliasing algorithm based on edge optimization. First,the geometry was preprocessed to detect the edges using polygon normals and the camera position. Second, the tar-get scene was rendered to a texture using the deferred shading technology. Then, the blending direction and cover-age on the screen were computed according to the detected edges. Finally, the edges were blended by combining the neighboring pixels with coverage. Experimental results show that the proposed algorithm can effectively eliminate unnecessary anti-aliasing edges while retaining the quality of the original geometry; the average edge detection time reduced by 22.55% compared with the original anti-aliasing method based on geometry information. When the scene complexity increases, this algorithm can effectively reduce the time for edge extraction and meet real-time requirements.