CHAPTER 3 Algorithm
3.6 Radiance Evaluation
In the progressive photon mapping, it emits positive radiance photons in each photon tracing pass. After each photon tracing pass, it accumulates the photons to evaluate the radiance by looping through all the hit points and render an image in gathering pass. In each gathering pass, it does three steps. The first step is radius reduction. Each hit point has a radius. While the number of photons accumulated within this radius increases, the radius needs to be reduced. The second step is flux correction. When a hit point receives new photons, it needs to accumulate the flux carried by those photons. So it needs to adjust this flux to take into account the radius reduction. The third step is radiance evaluation. By using the radius, the current flux multiplied by the BRDF, and the total number of emitted photons
20
in order to normalize the flux, it can evaluate the radiance at each hit point.
In our approach, after we emit the positive radiance photons in the photon tracing pass, the radiance evaluation in the following gathering pass is the same with the progressive photon mapping. But we should reformulate the radiance evaluation after we emit our negative power compensation photons in each photon tracing pass.
For radius reduction, we reformulate this to radius addition. When the hit points accumulate the compensation photons, we reduce the number of the photons accumulated within the radius. The number is computed as follows:
N̂(x) = N(x) − αM(x) (5)
whereN(x) is the current number of the photons accumulated, M(x) is the additional number of the photons accumulated, andα, 0 < 𝛼 < 1, is only a fraction
By reducing the number of the accumulated photons, we can increase the radius as follows:
R̂(x) = R(x) + 𝑑R(x) = R(x)√N(x)−αM(x)N(x)−M(x) (6)
If we over accumulate the negative power photons, it may cause the R(x) to turn to negative. We should clamp the value of the radius to one, if the value of the radius is less than zero.
For flux correction, we reformulate the flux evaluation as follows:
τN̂(𝑥, 𝜔⃑⃑ ) = τN−M(𝑥, 𝜔⃑⃑ )N(x)−αM(x)N(x)−M(x) (7)
21
where the quantity τ is represented as flux. If we over accumulate the negative radiance photons, it may cause the value of flux to be less than zero. We clamp the value of flux to zero, if the value of flux is less than zero.
For radiance evaluation, we use the Equation 4. mentioned in Section 2.2.
22
Chapter 4
Implementation and Results
Our results are rendered on a desktop PC with Intel Core i7 930 CPU 2.8GHz and NVIDIA GeForce GTX 480 video card. All results are rendered at 768 x 768 pixels.
In the progressive photon mapping, direct illumination and indirect illumination are rendered by tracing the photons in photon tracing pass. In our approach, we render direct illumination by using a similar phong lighting model based on the demo of progressive photon mapping of NVIDIA Optix. We only implement our algorithm on indirect illumination.
GPUs are best at exploiting very high degrees of parallelism, and ray tracing fits that requirement perfectly. Optix is a simple but powerful abstract model of a ray tracer running entirely on the NVIDIA CUDA compute architecture. So we implement our approach by OpenGL, and the major computation part is performed by Optix engine including the ray tracing pass, the photon tracing pass, and the gathering pass. To store the data of each hit point and each photons, we use the buffer stored in GPU memory designed by Optix. This buffer can be accessed by CPU and GPU, and then we can access the data efficiently. In program, when we render the scene, we only compute the photon map on CPU. Other works are performed by GPU.
When sending mesh data into Optix, we should construct the geometry group in Optix context first. As shown in Figure 4.1, a geometry group can contain many geometry instances.
23
Each geometry group needs to have an acceleration object assigned for ray traversal to intersect. Each geometry instance represents a coupling of a single geometry node with a set of materials. Each geometry node is bounded with intersect program and bounding program.
In intersect program, we compute the position of intersection of ray and geometry. In bounding program, we bound primitive data. In any-hit program and closet-hit program, we can trace the ray to obtain the external material such like shadow or indirect light. The difference between any-hit and closet-hit is using the ray payload or not. We use closet-hit program to obtain the information of ray payload such like color, normal. And any-hit program can only return hit geometry or not.
Figure 4.1 Optix data structure
24
We render the scenes by the progressive photon mapping all in 15 seconds before the objects move. After the objects move, we spend 8 seconds rendering the next frame. In order to highlight our contribution, we show comparison images with the same performance. One uses our algorithm to render the scene. The other uses the progressive photon mapping to render the scene with same performance.
Figure 4.3, 4.6, and 4.9 display the moving objects moved in the scenes rendered using the progressive photon mapping. Figure 4.4, 4.7, and 4.10 display the moving objects moved in the scenes rendered by our algorithm. Figure 4.2, 4.5, and 4.8 display the ground truth of the scenes. Figure 4.2 - 4.4 display basic cornell box scene. Figure 4.5 - 4.7 display cornell box scene containing a complex model. Figure 4.8 - 4.10 display the effect of caustic in the wedding -band scene.
25
Figure 4.2 The ground truth of tall box moving in cornell box scene.
Figure 4.3 Tall box moves in cornell box scene using PPM.
26
Figure 4.4 Tall box moves in cornell box scene using our method.
Figure 4.5 The ground truth of bunny moving in cornell box scene.
27
Figure 4.6 Bunny moves in cornell box scene using PPM.
Figure 4.7 Bunny moves in cornell box scene using our method.
28
Figure 4.8 The ground truth of middle ring moving in wedding-band scene.
Figure 4.9 Middle ring moves in wedding-band scene using PPM.
29
Figure 4.10 Middle ring moves in wedding-band scene using our method.
Ground truth PPM Our result Figure 4.11The comparison of figures 5.1 to 5.9
30
In figure 4.11, we can observe that our result can render the indirect illumination part smoother. We can keep the radiance which the moving object did not affect, so we do not need to emit the same number of photons to render. Our result demonstrates that we can get more indirect illumination with same performance. Note that, the major concept of our algorithm is to keep the illumination between two frames. In others word, the moving objects make smaller influence to scene, we can keep more illumination between two frames.
Table 1 and 2 shows the experimental result of our rendering algorithm. We can observe that the effect of caustic in wedding-band scene needs more photons to render than other Wedding-band 41196 3146k(0.25) 3277k(0.25) 893k 4s Table 4.1:Detail statistics for scenes with our algorithm. The "radius" is the initial radius of hit point. Wedding-band 41196 8847k(0.25) 247k 4s
Table 4.2:Detail statistics for scenes with PPM.
31
Ground truth PPM Our result Figure 4.12 The comparison of indirect illumination part
In figure 4.12, we can obviously observe the difference between our result and the result of the progressive photon mapping. The comparison part has no object moved. So this part keeps the same quality with the first frame. In the progressive photon mapping, accumulating more photons, the image will be smoother. The difference between the ground truth and our algorithm is smaller than the difference between the ground truth and the progressive photon mapping.
32
Chapter 5
Conclusion and Future Works
In this thesis, we propose a GPU-based global illumination algorithm that speed up the progressive photon mapping in dynamic scenes. We propose a new idea to keep the same illumination between frames. For progressive photon mapping, we add a new type of photon called the compensation photon. Because we add a new type photon, it needs to reformulate the radiance evaluation to evaluate the radiance of compensation photon.
In order to trace positive power photons to compensate the scene, we find out two tracing mechanism on tracing path. One is tracing the photons towards the moving volume of the moving objects. The other is to use the directions we record to emit the photons to compensate the indirect radiance bounced by the moving volume. Finally we use these two tracing mechanism to compensate the scene.
In the future we would improve the compensating part. If we can compensate the indirect radiance of the moving volume effectively, we can spend less time rendering the scene. In addition to progressive photon mapping, we would like to speed up other global illumination in dynamic scenes such like instant radiosity, ray tracing. Our algorithm is performed based on fixed perspective. We would extend our algorithm to dynamic perspective. For application, we would apply our algorithm on editing program.
33
Reference
[1] APPEL, A. 1968. Some techniques for shading machine renderings of solids. In AFIPS ’68 (Spring): Proceedings of the April30–May 2, 1968, spring joint computer conference, ACM, New York, NY, USA, 37–45.
[2] COOK, R. L., PORTER, T., AND CARPENTER, L. 1984. Distributed ray tracing. In Proceedings of SIGGRAPH, 137–145.
[3] DACHSBACHER, C., AND STAMMINGER, M. 2005. Reflective shadow maps. In Proc. of ACM SI3D ’05, ACM, New York, NY, USA, 203–231.
[4] DACHSBACHER, C., STAMMINGER, C., DRETTAKIS, G., andDURAND, F. 2007.
Implicit Visibility and Antiradiance for Interactive Global Illumination. ACM Transactions on Graphics(Proc. of SIGGRAPH) 26, 3.
[5] HACHISUKA T., JENSEN H. W.: Stochastic progressive photon mapping. ACM Transactions on Graphics 28, 5 (2009), 1. 1, 2.
[6] HACHISUKA, T., OGAKI, S., AND JENSEN, H. W. 2008. Progressive photon mapping.
ACM Transactions on Graphics (SIGGRAPH Asia Proceedings) 27, 5, Article 130.
[7] HERZOG, R., HAVRAN, V., KINUWAKI, S., MYSZKOWSKI, K., AND SEIDEL, H.-P.
2007. Global illumination using photon ray splatting. In Eurographics 2007, vol. 26, 503–513.
[8] JENSEN, H. W. 1996. Global illumination using photon maps. In Proceedings of the eurographics workshop on Rendering techniques’96, Springer-Verlag, London, UK, 21–30.
[9] KELLER, A. 1997. Instant radiosity. In SIGGRAPH ’97: Proc. of the 24th annual conference on comp. graph. and interactive techniques, ACM Press/Addison-Wesley
34
Publishing Co., New York, NY, USA, 49–56.
[10] LANDIS H. 2002. Production-ready global illumination. Course notes for SIGGRAPH 2002 Course 16, RenderMan in Production.
[11] MA, V. C. H., AND MCCOOL, M. D. 2002. Low latency photon mapping using block hashing. In HWWS ’02: Proc. of the ACM SIGGRAPH/EUROGRAPHICS conf. on Graph. hardware, Eurographics Association, Aire-la-Ville, Switzerland, 89–99.
[12] MCGUIRE, M., AND LUEBKE, D. 2009. Hardware-Accelerated Global Illumination by Image Space Photon Mapping. In Proceedings of the 2009 ACM SIGGRAPH/EuroGraphics conference on High Performance Graphics.
[13] PARKER, S. G., BIGLER, J., DIETRICH, A., FRIEDRICH, H., HOBEROC, K J., Proceedings of the ACM SIGGRAPH/EUROGRAPHICS Conference on Graphics Hardware, Eurographics Association, 41–50.
[15] RITSCHEL, T., GROSCH, T., KIM, M., SEIDEL, H.-P., DACHSBACHER, C., AND KAUTZ, J. 2008. Imperfect shadow maps for efficient computation of indirect illumination. ACM Trans. Graph. 27, 5, 1–8.
[16] ROBISON, A., AND SHIRLEY, P. 2009. Image space gathering. In Proceedings of the 2009 ACM SIGGRAPH/EuroGraphics conferenceon High Performance Graphics.
[17] SAITO, T., AND TAKAHASHI, T. 1990. Comprehensible rendering of 3-d shapes.
SIGGRAPH Comput. Graph. 24, 4, 197–206.
[18] WACHOWICZ, P. 2011. Accelerating Photon Mapping with Photon Flipping and Invalidity Photons. Master thesis, University of Amsterdam.
35
[19] WANG, R., WANG, R., ZHOU, K., PAN, M., AND BAO, H. 2009. An efficient gpu-based approach for interactive global illumination. ACM Trans. Graph. 28, 3, 1–8.
[20] WEISS, M., AND GROSCH, T. Stochastic Progressive Photon Mapping for Dynamic Scenes. EUROGRAPHICS 2012 / P. Cignoni, T. Ertl. (Guest Editors). Volume 31 (2012), Number 2.