1

文学上写过一篇关于 SSAO 的文章的每篇教程都以“剂量准确地产生现实的结果”结尾。我们可以通过阴影映射获得更准确的阴影,而无需额外的内存来存储充满随机向量的纹理[或统一数组]以进行采样或额外的模糊通道以减少条带,那么为什么还要使用 SSAO?

我还看到了一些结合 SSAO 和阴影贴图的教程,这对我来说似乎有点矫枉过正。这两种技术都是为了产生阴影对吧?

4

2 回答 2

3

Shadow Mapping 和 Screen-Space Ambient Occlusion 解决了渲染方程的不同部分,因为它们做出了不同的假设。

顾名思义,Screen-Space Ambient Occlusion 假设光线从我们采样点半球上方的每个可能方向均等地射向该点。也就是说,为了解决环境光遮挡,我们需要在样本点的半球上积分一个常数函数(辐照度),以确定半球立体角被环境光源遮挡的比例。

而且在Screen-Space Ambient Occlusion 一词中还有“Screen-Space”一词。这意味着,我们为了计算被均匀环境光源遮挡的采样点半球的比例所做的计算,仅基于我们在屏幕空间(而不是世界空间)中准备好的信息,例如场景几何的分析射线投射/追踪——我们当然可以这样做,但它不再被称为屏幕空间环境遮挡)。

因此,环境光遮蔽(屏幕空间环境光遮蔽是一种基于我们渲染到屏幕空间的信息来近似的方法):

  1. 假设光线从采样点半球上的所有方向均等地射出
  2. approximates the occlusion factor (fraction of solid angle over the sampled point's hemisphere that has no incident light from the ambient light source)

On the other hand: Shadow Mapping. This is a technique that makes a completely different assumption about the irradiance incident to our sampled point. Here we do not assume light coming equally from all directions above the hemisphere of our sample point, but assume that light is coming from a single direction (or a small solid angle around that direction when we approximate soft shadows).

In order to solve that, we can sample the scene from the light direction and then test whether our sampled point could have received light from that light direction.

于 2021-01-12T15:41:53.677 回答
1

他们解决不同的问题并相互补充。

SSAO 解决了环境光遮蔽。即使您的点在阴影中,SSAO 也会修改强度,使更多被遮挡的区域更暗。阴影贴图不是那么准确。

这是一个比较图像。整个区域都在阴影中,但使用 SSAO,您可以更好地看到窗帘的形状(单击它可以将其打开,使其更明显):

在此处输入图像描述 阴影贴图解决了光源的可见性,不考虑光反弹(SSAO 通过使用深度缓冲区来伪造这一点)。

仅使用阴影贴图渲染的场景看起来比使用 SSAO 和阴影贴图的场景更平坦。

于 2021-01-12T13:48:38.067 回答