Antsam

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
Occlusion Culling System

Occlusion方面三篇比较经典的文章:
Hierarchical Z-Buffer Visibility
Visibility Culling Using Hierarchical Occlusion Map 
Lazy Occlusion Grid Culling

dPVS是一个大集成的算法,综合了很多Visibility方面的算法,算是一种把
Occlusion Culling达到实用的算法吧。

dPVS中主要使用了Spatial Database、Portal和Occlusion System三种算法,
Occlusion System方面基本上集成了上面三篇比较经典的文章的算法。随着硬件
的发展,很多显卡都支持Hierarchical Z-Buffer 和Occlusion Query,虽然现
在可能还没有达到实用,但是也算是一个发展方向吧。





http://www.cnblogs.com/liker/archive/2005/03/13/118053.html
中提到的问题:

PVS的好处就是数据为静态,渲染的时候不需要计算,但它对动态物体
的判断不够好,假如有一个需要3pass+perpixel light渲染的怪物(我
说的就是doom3。。。)在某leaf中移动,如果用原始的view frustum做
culling无法达到真正的剔除。 

HL2中有中解决方法就是用了Occlusion System来剔除动态的物体。

//-----------------------------------
// Occluders are simply polygons
//-----------------------------------
// Flags field of doccluderdata_t
enum
{
OCCLUDER_FLAGS_INACTIVE = 0x1,
};

struct doccluderdata_t
{
// index into doccluderpolys
int flags;
int firstpoly;
int polycount;
Vector mins;
Vector maxs;
};

struct doccluderpolydata_t
{
// index into doccludervertindices
int firstvertexindex;
int vertexcount;
int planenum;
};

HL2中Occluder 和Occludee都是定的,Occluder在地图文件的brush中,而
Occludee则是模型文件,后者的原因主要是PVS计算出来的Cell还是很多,
而任务模型的顶点数据比较多,那么绘制代价会比较高,所以BSP地图文件
中有Occluder Polygon的信息(通过预计算得到),然后把人物模型的的BV
投影到Space Coordinate,判断是否被OccluderPolygon遮挡。

[snapshot from HL2 SourceCode]
Prevents this occluder from being used if it takes up less than X% 
of the screen.Prevents occlusion testing for entities that take up 
more than X% of the screen.
posted on 2005-03-15 12:21  Antsam  阅读(3300)  评论(6编辑  收藏  举报