Graphics Reference
In-Depth Information
pass, we will be rendering all of the objects in the
scene. By producing a large number of individual ob-
jects to render, we are effectively increasing the num-
ber of API calls that need to be performed by the CPU,
since each object requires the pipeline to be configured
before its geometry is rendered with one of the draw
calls. With this in mind, we can think of our scene as a
series of rendering operations that must be performed
for every object, each of which must be processed for
each of our rendering passes. This is roughly depicted
in Figure 13.13.
When each of the reflective objects is rendered
(in both the paraboloid map generation phase and the
final rendering pass) it will sample its own paraboloid
maps and use them to determine what color will be
visible at each pixel of its geometric surfaces. With
multiple highly reflective objects located near each
other, we will see a "hall of mirrors" effect, where each
mirror reflects its neighboring mirror surface back and
forth multiple times. To ensure that there are no recur-
sion hazards caused by this semi-infinite environment
bouncing, we simply only allow each set of paraboloid
maps to update its contents once per frame. If a set
of maps is requested to generate its environment maps
more than once in a frame, we will simply use the pre-
vious frame's maps, instead of regenerating them. This
will cause some small amount of lag in some of the
reflections, as well as missing reflections in the first
few rendered frames; but ultimately, this limitation
won't cause noticeable artifacts. Since a second or
third bounce of the environment will be difficult for the user to accurately recognize, there
will likely be little or no visual impact on the output scene rendering. We are primarily
interested in testing the multithreaded performance, so we will accept these small artifacts.
Figure 13.13. A "rendering opera-
tion" view of how the test scene will
be processed.
13.3.2 Multithreading Solution
If this scene rendering were performed by a single thread, we would essentially need to
serially process each paraboloid map generation pass one at a time. This would require
each sequence of the rendering operations shown in Figure 13.13 to be executed one after
Search WWH ::




Custom Search