[gpu pro]shadow map for omnidirectinal light using tetrahedron mapping
这个文章很cool。
result
顾名思义(btw,tetrahedron意思是四面体),是讲的点光源阴影,直接看和传统omnidirectional shadow map对比的数据吧:
cubemap:230fpsdual-paraboloid:276fpstetrahedron with stencil:418fps对rendertarget的要求:![[gpu pro]shadow 地图 for omnidirectinal light using tetrahedron 地图ping](http://img.reader8.net/uploadfile/jiaocheng/201401101/2954/2014012903542352462.jpg)
但是这里需要注意两点:rendertarget上面tetrahedron需求是最小的但是render scene上面比较多,技术本身的限制,重复render的几率比较大,所以上面帧数的差别也要打一些折扣。techcubemap shadowmap使用6个面来包点光源,顾名思义,tetrahedron是使用4个面来包点光源。![[gpu pro]shadow 地图 for omnidirectinal light using tetrahedron 地图ping](http://img.reader8.net/uploadfile/jiaocheng/201401101/2954/2014012903542352463.jpg)
rendertarget的组织方式太棒了:![[gpu pro]shadow 地图 for omnidirectinal light using tetrahedron 地图ping](http://img.reader8.net/uploadfile/jiaocheng/201401101/2954/2014012903542352464.jpg)
在render红色这个plane方向上的object的时候,就写到rendertarget红色这个区域,并使用stencil来避掉不该写的部分。frustum的构建是我觉得可能让其数据掺水的地方,![[gpu pro]shadow 地图 for omnidirectinal light using tetrahedron 地图ping](http://img.reader8.net/uploadfile/jiaocheng/201401101/2954/2014012903542352465.jpg)
还是正常的frustum在各个方向上,但是可以看出一个quad的frustum,只取其中的一部分。其他的构建和sample就比较顺理成章了,非常有灵性的算法。
- 1楼windleaf_20063天前 00:22
- tetrahedron map挺有意思,不过直角三角形变正三角形像素有点拉伸。以前尝试过为了减少render target,做real time的sphere environment map,结果因为sphere map是非线性变换,直线变曲线,大块的三角形会严重变形,要做顶点细分,还是很多问题。
- Re: ccanan3天前 08:51
- 回复windleaf_2006n这些拉伸是不是在游戏里面不太容易察觉?
- Re: windleaf_2006昨天 11:15
- 回复ccanann做阴影应该是没问题了,我做的那个是环境映射。