Two-Pass Method Final Gathering Proposed Method Ray Cast by

Final Gathering on GPU
Demo application is available at http://www.bee-www.com/parthenon/
Toshiya Hachisuka ([email protected]) The University of Tokyo
Introduction
Producing global illumination image without any noise is still difficult because it
requires a large number of samplings. Some approaches, such as Photon Mapping
[Jensen 1996], can render noiseless image but often results in biased image. To
produce high quality image, most of current global illumination renderer uses
additional process called “Final Gathering”. Final Gathering uses rough global
illumination solution such as Photon Map or Radiosity, and gathers this data by
casting rays to obtain definitive incident radiance distribution. Since Final Gathering
requires a large number of rays for producing noise-free result, it is very costly to
process all visible pixels. Irradiance Gradients [Wald and Heckbert 1992] can
reduce number of processing pixels by interpolation, but its behavior is difficult to
control. Instead of reducing number of processing pixels by interpolation, I propose
an accelerated method of the process itself by using a common graphics hardware.
However, Final Gathering typically needs thousands of samplings to achieve noiseless result. For
this reason, Final Gathering casts many more rays compared to other rendering process (i.e. photon
tracing) using ray-casting and it often becomes a bottleneck of all rendering process. Irradiance
Cache applies Final Gathering to sparsely sampled pixels and interpolates this data to produce entire
illumination data. Irradiance Cache can greatly reduce number of sampling rays, but its parameter is
not intuitive (e.g. a maximum valid distance : current cache points can be used for interpolation
within this distance), so it is difficult to control rendering time and the error due to interpolation.
Photon Tracing
[rays]
Ray Tracing from
Camera [rays]
Final Gathering (1024 samples)
[rays]
Cornell Box (512×512, 500k photons)
607,002
262,144
268,435,456
Buddha (512×512, 800k photons)
29,886,408
323,212
101,261,312
Teapot (512×512, 300k photons)
368,793
379,452
253,227,008
Layer 0
Two-Pass Method
Most of existing global illumination renderer implements two-pass method. The first
pass is making rough global illumination data, and the second pass is actual
rendering using this solution. Rough global illumination solution can be obtained by
any method that can solve some part (or all) of rendering equation. One of popular
and robust method for this first pass is Photon Mapping. Since the resulting data of a
first pass itself is complete global illumination solution, one can render a image by
directly visualizing this data. However, first pass result is only approximated
solution and its quality is not sufficient for a final image, so second pass is usually
applied by using first pass result indirectly. Whereas first pass result can be used as a
approximated probability density function for Path-tracing, the most popular second
pass process is separated indirect illumination computation by Final Gathering.
Photon Map (first pass solution) is indirectly
used by Final Gathering (second pass)
Layer 1
Layer 2
Layer 3
Far
Successive Pass
Near
Cornell Box
Buddha
Teapot
Global ray direction
Theoretical ray number of typical scenes
Proposed Method
Proposed method uses a randomly sampled global ray direction and regards ray-casting as a multiple
parallel projection. By choosing global ray direction, many sampling rays of Final Gathering can be
viewed as a number of sets of rays with same direction and different origin. Rather than using ray
casting, using parallel projection is suitable for a common graphics hardware based on Z buffering
algorithm. Multiple parallel projections are effectively done by Depth Peeling using programmable
shader. Since proposed method simply samples all visible points, it doesn't have non-intuitive
parameters like Irradiance Cache. Current performance of proposed method is comparable to
efficient implementation of Final Gathering with Irradiance Cache on CPU. However, by
considering growing speed of GPU, this method has potential to outperform the CPU based methods.
Inverse process of Depth Peeling
Result
Note that Final Gathering process casts many more
number of rays compared to other process.
Global ray direction
Photon Map (first pass solution) is directly
visualized by radiance estimation
Proposed method uses inverse of Depth Peeling which stacks each depth layer,
whereas original process strips away each depth layer. Sampling point along ray
direction on depth layer is projected to screen space pixel during successive pass.
If sampling point on depth layer is behind a ray origin, it is culled by a KILL
operation. Since common graphics hardware is based on Z buffer algorithm,
parallel projection in Depth Peeling is straightforward process and it can be
computed quite efficiently. Although Ray tracing on GPU can be used to cast
these rays, its performance is not sufficient for per-pixel Final Gathering.
I implemented global illumination renderer using the proposed method using
DirectX 9.0 on WindowsXP. These images were rendered by this program on
Pentium4 2.8GHz and Radeon 9700 Pro (Video memory is 128MB). Note that in
spite of processing all pixels, rendering time is still in practical range.
Total Final Gathering only
Average number of
[sec]
[sec]
Depth Peeling iteration
Stanford's (512×512, 1024samples) 175
142
3.156
Global illumination test
92
80
4.235
(512×512, 2048samples)
Performance of sample application using proposed method
Each sampling
points takes
nearest depth
layer
Sampling point
Note that the object in directly visualized image seems like floating from floor
due to insufficient accuracy of global illumination solution in Photon Map.
Conceptual diagram of proposed method
Final Gathering
Final Gathering can be done by iterate this process for random global ray direction.
To get N times reflected illumination, Final Gathering gathers illumination data
which is N-1 times reflected illumination and generates Nth reflected illumination.
Final Gathering process is essentially the same for casting a large number rays on
upper hemisphere of visible points. It can produce high quality result form rough
first pass illumination data by reusing this solution all over the visible pixels.
Ray Cast by Parallel Projection
Whereas original Final Gathering processes a set of rays with same origin, the proposed method uses
a set of rays with same direction (i.e. global ray direction). Thinking from this viewpoint, ray casting
is the same as sampling a point on the nearest depth layer from the ray origin along global ray
direction. Each depth layer can be extracted by using inverse of Depth Peeling [Everitt 2001].
Stanford’s
Global illumination test
Conclusion
Final Gathering can be effectively done by using multiple parallel projection on
GPU. Visual quality is nearly equivalent of per-pixel Final Gathering by ray
casing. Current performance is comparable to interpolation method (e.g.
Irradiance Cache) but it doesn’t have non-intuitive parameters like maximum
distance of Irradiance Cache. Since proposed method is per-pixel method, it can
be used to deal with any set of points including ray-traced pixels for image
rendering, vertex data for pre-computed radiance transfer, textures for light maps.
Reference
Ray distribution of Final Gathering
Final Gathering casts many rays on upper hemisphere
to gather the illumination data obtained by fist pass.
Set of rays in original Final Gathering
Set of rays in proposed method
Same color rays are in same set of rays.
Jensen, H. W. 1996. Global illumination using photon maps.
Rendering Techniques ’96 (Proceedings of the Seventh
EurographicsWorkshop on Rendering), pages 21–30.
Everitt, C. 2001. Interactive order-independent transparency.
Technical report, NVIDIA Corporation.
Szirmay-Kalos, L. 1998. Global Ray-bundle Tracing. Technical
Report/TR-186-2-98-18.
Ward, G. and Heckbert, P. 1992. Irradiance gradients.
Eurographics Rendering Workshop 92, 85-98.