最有效的网格级最佳遮挡剔除算法? [英] Most efficient algorithm for mesh-level, optimal occlusion culling?

查看:47
本文介绍了最有效的网格级最佳遮挡剔除算法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不熟悉剔除.乍一看,似乎大多数遮挡剔除算法都是对象级的,而不是检查单个网格,这对于游戏渲染来说是实用的.

I am new to culling. On a first glance, it seems that most occlusion culling algorithms are object-level, not examining single meshes, which would be practical for game rendering.

我正在寻找一种算法,该算法能够以高精度剔除单个对象中针对给定视点被遮挡的所有网格.它至少需要 O(n log n),一个简单的逐个网格比较 (O(n^2)) 太慢了.

What I am looking for is an algorithm that culls all meshes within a single object that are occluded for a given viewpoint, with high accuracy. It needs to be at least O(n log n), a naive mesh-by-mesh comparison (O(n^2)) is too slow.

我注意到 Blender GUI 会实时为您识别被遮挡的网格,即使您处理 10,000 多个网格的大型对象也是如此.那里使用什么算法,请告诉?

I notice that the Blender GUI identifies the occluded meshes for you in real-time, even if you work with large objects of 10,000+ meshes. What algorithm is used there, pray tell?

推荐答案

Blender 基于 Bullet 物理库中的动态 AABB 树加速结构执行视锥体剔除和遮挡剔除.遮挡物和对象由它们的边界体积(轴对齐的边界框)表示.

Blender performs both view frustum culling and occlusion culling, based on the dynamic AABB tree acceleration structures from the Bullet physics library. Occluders and objects are represented by their bounding volume (axis aligned bounding box).

给定一个相机视锥体,视锥体剔除只是遍历 AABB 树.

View frustum culling just traverses the AABB tree, given a camera frustum.

遮挡剔除基于遮挡缓冲区,这是一种使用非常简单的软件渲染器初始化的深度缓冲区:使用动态 AABB 树加速结构的基本光线追踪器.您可以选择遮挡缓冲区的分辨率来权衡准确性和效率.

The occlusion culling is based on a occlusion buffer, a kind of depth buffer that is initialized using a very simple software-renderer: a basic ray tracer using the dynamic AABB tree acceleration structures. You can choose the resolution of the occlusion buffer to trade accuracy versus efficiency.

另见文档http://wiki.Blender.org/index.php/Dev:Ref/Release_Notes/2.49/Game_Engine#Performance

来自 Blender 源代码树的 Blender 实现:BlendersourcegameenginePhysicsBulletCcdPhysicsEnvironment.cpp 方法bool CcdPhysicsEnvironment::cullingTest(PHY_CullingCallback callback, void* userData, PHY__Vector4 *planes, int nplanes, int occlusionRes)

Blender implementation from the Blender source tree: blendersourcegameenginePhysicsBulletCcdPhysicsEnvironment.cpp method bool CcdPhysicsEnvironment::cullingTest(PHY_CullingCallback callback, void* userData, PHY__Vector4 *planes, int nplanes, int occlusionRes)

并且 Bullet Physics SDK 在 Bullet/Extras/CDTestFramework 中有一些 C++ 示例代码.

and the Bullet Physics SDK has some C++ sample code in Bullet/Extras/CDTestFramework.

这篇关于最有效的网格级最佳遮挡剔除算法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆