通过生成VDB来清理球和中心算法的结果,并光栅化至几何体。(“VDB”, so named because it is a Volumetric, Dynamic grid that shares several characteristics with B+trees。简单来理解就是一种人为定义体积的分层加速结构——文末会附链接)
Let’s consider how we shade a pixel. We want to trace rays to this area light source, through this depth buffer which is represented as a set of green lines – each line segment is a depth buffer texel with a certain depth. It’s important to remember that this depth buffer really doesn’t represent a contiguous height field, we have to treat it as an isolated collection of fragments.
We’re ray tracing to see if we intersect the depth buffer. In this case, let’s imagine we trace the simplest ray, one aligned with the direction of the light. In this case you can see that the first three samples are occluded, and the fourth sample is not occluded. As we’ve changed from shadowed to non-shadowed, we detect that we’ve hit an object, stop ray marching, and take the shadowed sample.
This all seems rather naïve though – we might as well have just taken the original shadowed sample. However, other rays that aren’t parallel to the direction of the light are more complex.
Let’s trace another ray. After a few steps we notice we are no longer shadowed. Does this mean that we’ve intersected an object? Well, clearly it doesn’t in this case.
We also sample on the disk at the original pixel’s depth, and discover that sample isn’t shadowed either. The fact that the two samples are in agreement (they’re both non-shadowed) shows that no boundary has been crossed.
So we continue ray tracing until we hit the light…
所以我们继续射线追踪直到命中光源。
The samples on the disk vs the samples on the ray are always in agreement, showing we never crossed a boundary. This means we take the last result and say that the ray isn’t shadowed.
Let’s trace yet another ray, a more complex one this time. We trace until we find a disagreement between the disk and the ray samples, which means a boundary has been crossed… but has it?
This is an innate problem of screen space ray tracing techniques. We don’t know if those individual depth texels are connected or not (or if they’re not, how “thick” each individual texel is).
However, for our purposes, we say the depth buffer is contiguous. This prevents light leaking and worst case, will just give us the same result as regular PCF filtering.
评论区
共 条评论热门最新