Graphics Reference
In-Depth Information
the ray in the opposite direction of the view direction; this information is not
available in screen space. This means that occlusion and missing information is
a huge challenge for this technique and if we do not deal with this problem we
will have artifacts and produce incorrect reflection colors. Smoothly fading rays
that fall outside the screen borders, fall behind objects that occlude information
and rays that point toward the camera are recommended.
On the other hand this type of linear ray marching can be really ecient if
you do a low number of steps/samples for very short range reflections. As soon
as you have really long rays this method starts to perform really slowly because
of all the texture fetches it requires at each loop to acquire the scene depth from
the Z-buffer. Due to this latency hiding starts to diminish and our cores basically
stall, doing nothing.
It's also error prone such that it can miss very small details due to taking
a fixed constant step size at each sample. If the small detail next to the ray is
smaller than the step size, we might jump over it and have an incorrect reflection.
The number of steps taken and how large those steps are make a huge difference in
terms of quality for this kind of linear ray marching. This technique also produces
staircase artifacts, for which you have to employ some form of a refinement once
an intersection point is found. This refinement would be between the previous
ray-march position and the ray-march intersection point to converge into a much
more refined intersection. A low number of binary search steps or a single secant
search is usually enough to deal with the staircase artifacts for pure specular rays.
(See Figure 4.5.) Crytek employs ray length jittering at each iteration step to
hide the staircase artifacts.
A simple linear ray-marching algorithm that traverses the depth buffer can
be written with fewer than 15 lines of code, as we can see in Listing 4.1.
Secondary
Search Interval
(a)
(b)
(c)
Figure 4.5. Binary search illustration between the intersection position and the last
position of the ray. Basically it takes the middle point of the two and checks if it's still
intersecting; if true it does it again until it can resurface, which is a refined position.
We can also visualize the constant step sizes linear ray marching takes and end up in
the wrong coordinate, which results in staircase artifacts, so we need some form of a
refinement. Binary search and secant search are popular ones. [Original image courtesy
of [Risser 07].]
Search WWH ::




Custom Search