Graphics Reference
In-Depth Information
M-
M+
Camera
Figure 2.1. Three lines of sight from the camera. The linked list on the green line of
sight will contain no nodes, the red line of sight will have [M front, M+ front, M
back, M+ back] in its list, and the blue line of sight will have [M+ front, M+ back] in
its list.
2.3.5 Sorting the Linked List
Once the linked list contains all pixel information, a shader program will sort all
pixels in each of the linked lists based on their depth values. The result is that
each linked list will contain a list of pixels sorted from closest to farthest depth
from the camera. To help illustrate the result of this step, take as an example
Figure 2.1. In it we have a camera that's positioned in world coordinates, a scene
mesh (M+), and a deforming mesh (M
) that intersects the scene mesh. Both
M+ and M
are inside the camera's frustum.
Look at the three lines of sight (red, green, blue) from the camera. Once
sorted, the per-pixel linked list on the green line of sight will have no nodes in it.
The red line of sight will have [M
back, M+ back] in its
list. The blue line of sight will have [M+ front, M+ back] in its list.
front, M+ front, M
2.3.6 Determining M+ and M
Intersections
For the next set of steps, we will need to assess if M+ and M
intersected, that
is, if any given M+ pixel is inside M
,aswellasifanyM
pixel is inside M+.
To assess if any given M+ pixel is inside or outside M
, we linearly traverse
the sorted per-pixel linked list starting from the closest pixel. If a front-facing
M
pixel is found, then any subsequent M+ pixels are inside M
until a back-
facing M
pixel found on the list is a
back-facing one, this means that all previously found M+ pixels were inside M
pixel is found. In addition, if the first M
,
since this is a case where the camera is inside M
. One can also determine if an
M
pixel is inside M+ by utilizing the same steps described but switching the
keywords of M
for M+ and vice versa.
Search WWH ::




Custom Search