Unity3D高级手册0501:方向阴影的细节

2014-08-24 14:05:17|?次阅读|上传:huigezrx【已有?条评论】发表评论

关键词:Unity3D, 游戏, 虚拟现实|来源:唯设编程网

Unity定向光源可以使用所谓的级联阴影地图(也称“平行拆分阴影地图”),提供很好的阴影质量,特别是长视距。级联分成逐步较大的部分,并在每个使用同样大小的阴影图可视面积阴影工作。其结果是,物体接近观众得到更多的阴影映射像素超过更远的物体。

In the images below we'll use Hard shadows because shadow pixels are better visible there. 在以下图片,我们将使用硬阴影,因为在那里阴影像素更好可见。

If no cascaded shadow maps were used, the entire shadow distance (still 50 units in our case) must be covered by the shadow texture uniformly. Hard shadows would look like this with no cascades:  如果没有级联阴影地图使用,整个阴影的距离(仍旧50个单位在我们的方案里)必须由阴影纹理均匀覆盖。硬阴影看起来像这样的,没有瀑布:

Unity3D高级手册0501:方向阴影的细节
Hard shadows with distance of 50 and no cascades. 50距离的硬阴影而没有级联。

The pixels of the shadow texture are the same size everywhere, and while they look good in distance, the quality is not stellar up close. The shadow texture covers the entire viewing area, and if visualized it would look like this:  阴影纹理像素的大小相同随处可见,而在距离里他们看起来良好,质量是没有星体的近距离。阴影纹理覆盖整个显示区域,如果直观的它将看起来像这样:

Unity3D高级手册0501:方向阴影的细节
With no cascades, shadow texture covers viewing area uniformly. 没有级联,阴影纹理平均的覆盖。

When two shadow cascades are used, the entire shadow distance is divided into a smaller chunk near the viewer and a larger chunk far away. Hard shadows would look like this with two cascades:  当两个阴影级联使用,整个阴影距离分为接近的观众一小块和远处的一大块。硬阴影是这样的两个级联:

Unity3D高级手册0501:方向阴影的细节
Hard shadows with distance of 50 and two cascades. 50的距离的硬阴影和两个级联。

In exchange for some performance, we get better shadow resolution up close. 调整一些性能,我们获得更好的阴影的近距离的清晰度。

Unity3D高级手册0501:方向阴影的细节
With two cascades, two shadow textures cover different sized portions of viewing area.

利用2个级联,2个阴影纹理覆盖不同大小视图区域的位置。

发表评论0条 】
网友评论(共?条评论)..
Unity3D高级手册0501:方向阴影的细节