Graphics Reference
In-Depth Information
Near Plane
Far Plane
Solid
Reflection
Ray z>z
Hit
Output Red from the Wall
Solid
Solid
Z-Buffer Image Representation
Z-Buffer
0.0
1.0
Figure 4.4. Ray marching by taking small steps in screen space using the Z-buffer (depth
buffer, an image representing scene depth in floating point numbers) until the ray depth
is below the surface. Once it is below the surface, we can stop the ray marching and use
the new coordinates to acquire the reflection color and apply it on the pixel we started
the marching from.
to create a planar reflection. Another technique that has been relied upon for a
very long time is cube-maps, six images capturing 360 degrees of the surrounding
environment from a single point with a 90-degree field of view for each side, hence
these reflections are only valid from that specific point only.
A new idea called screen-space local reflections was first showed by [Graham
10] at Beyond3D forums and then later introduced into Crysis 2 DX11 patch by
Crytek [Tiago et al. 12]. They both proposed a simple ray marching algorithm
in screen space. Screen space means that we do everything in 2D framebuffer
objects, images, as a post-processing effect.
It's a fairly simple idea; you just compute a screen-space reflection vector
using the scene normal buffer and ray-march through the pixels at a certain step
size until the ray depth falls below the scene depth stored in what we call a depth
buffer. Once the ray depth is below the scene depth, we detect a hit and use the
new screen-space coordinate to read the scene color, which is used as reflection
for the pixel we started the ray-marching from. This technique is illustrated in
Figure 4.4.
However since this computation is performed in screen space, there are limita-
tions that need to be taken care of. A built-in problem with this kind of technique
is that not all of the information is available to us. Imagine a mirror reflecting
Search WWH ::




Custom Search