Graphics Reference
In-Depth Information
Figure 4.24. Infinite reflections when two mirrors are parallel against each other. Notice
how the strength of the reflections decreases with the number of bounces we have due
to absorption where the light is transferred to heat and some is reflected back again.
The result is darker reflections at further ray depths. Notice the green tint as well that
the ray accumulates over time from the glass as it bounces, due to iron oxide impurities
in an ordinary soda-lime glass [Wikipedia 14]. The green tint is usually most noticeable
on the edges of a glass. [Image courtesy of [Merry Monk 11].]
Once we know the position of where it belonged in the previous frame, we'll
also need to detect if that pixel is valid or not. Some pixels might have moved
outside the screen borders and some might have been blocked/occluded, etc. If
the camera has moved drastically between the previous frame and the current
frame, we might have to reject some of the pixels. The easiest way of doing
this would be to store the previous frame's depth buffer; once we have done a
re-projection of the current pixel into the previous frame, we just compare them
by an epsilon and detect a fail or success. If they are not within an epsilon value
we know the pixel is invalid. To get even more accurate results, one could also
use the normal (surface orientation) of the previous frame and the normal of the
re-projected pixel. The demo uses only the depth for rejection invalid pixels.
Mathematically speaking, we need to use the current inverted camera pro-
jection matrix and the previous camera projection matrix to take us from the
current frame's pixel into the previous frame:
M = VP āˆ’ 1
curr VP prev ,
where M is the concatenated re-projection matrix, VP āˆ’ 1
curr is the inverse view
projection matrix from the current frame, and VP prev is the view projection ma-
trix from the previous frame. When multiplied with a pixel P n in clip space, this
will take us to the corresponding pixel P nāˆ’ 1 in the previous frame in homoge-
Search WWH ::




Custom Search