i
i
i
i
i
i
i
i
3. Real-Time One-Bounce Indirect Illumination and Shadows using Ray Tracing 169
{
f l o a t 3 f 3 I L = ( 0 . 0 f ) . xxx ;
// lo op o v e r VPL k e rn el
for ( f l o a t row = SFS ; row <= SFS ; row += 6 . 0 f ) {
for ( f l o a t c o l = SFS ; c o l <= SFS ; c o l += 6 . 0 f ) {
// unpack RSM gb u f f e r data f o r VPL
RSM data d = LoadRSMData ( adr ) ;
// compute w e i g h t i n g f a c t o r f o r VPL
f l o a t f = evaluateVPLWeightingFac ( d , f3CPos , f3CN ) ;
i f ( f > 0 .0 f ) {
f 3 I L += tr a c e Ra yL i n k ed Tr i s ( f3CPos . xyz , f3D )
d . f3 C ol f ;
}
}
}
// am p li f y t he accumulated b lo c k e d i n d i r e c t l i g h t a b i t
// to make i n d i r e c t shadows more prominent
return 1 6 . 0 f f 3 I L ;
}
// r e n d e r s th e accumulated c o l o r o f b l o c ke d l i g h t u s i n g a 3D
// g r id o f t r i a n g l e l i s t s t o d e t ec t o cc l ud e d VPLs
f l o a t 4
PS R e n d er B l o ck e d I n d i r ec t L i g h t L in k e d T r i s ( PS SIMPLE INPUT I ) :
SV TARGET
{
i n t 3 t c = i n t3 ( i nt 2 ( I . vPos . xy ) << 1 , 0 ) ;
i n t 2 i 2O f f = ( i n t 2 ( I . vPos . xy ) % (0 x5 ) . xx ) ;
Gbuf data d = LoadGBufData ( t c ) ;
// tr a n s f o r m world s p a c e pos t o rsm t e x t ur e sp ac e
f l o a t 2 r t c = transform2RSMSpace ( d . f3CPos ) ;
f l o a t 3 f 3 IS = 0 . 0 f ;
f l o a t 3 f 3 I L = g t x I n d i r e c t L i g h t . SampleLevel (
g SamplePointClamp , I . vTex . xy , 0 ) . xyz ;
// i s any i n d i r e c t l i g h t ( phase 1) r e a c h i n g t h i s p i x e l
[ branch ] i f ( dot ( f3I L , f 3 I L ) > 0 .0 f )
f 3 I S = c o m pu t e Bl o c ke d I n d i r e c t L i g h t ( r t c , i 2 Of f ,
d . f3CPos , d . f3CN ) ;
return f l o a t 4 ( f3 I S , 0 . 0 f ) ;
}
Listing 3.3. Accumulating blocked indirect light.
i
i
i
i
i
i
i
i
170 III Global Illumination Effects
Figure 3.6. Demo scene with indirect illumination and indirect shadows.
Again, the dithered, blocked indirect light is blurred and upsampled using
a bilateral filter. After that, the blocked indirect light is subtracted from the
indirect light, and the result is clamped to make sure that indirect illumination
doesn’t become negative. This generates the full indirect illumination approxi-
mation with indirect shadowing. Finally, indirect illumination is combined with
direct illumination and shadowing to produce the final image as shown in Fig-
ure 3.6.
The performance for rendering the full one-bounce indirect illumination, in-
cluding indirect shadows with tracing nine rays per pixel is at 70–110 fps for a
32×32×32 grid and a resolution of 1280×800 on an AMD HD5970. The number
of blocker triangles that get inserted into the 3D grid in every frame is in the
order of 6000.
3.6 Future Work
There are several future directions for improving the techniques described in this
chapter.
1. The use of a hierarchical grid for speeding up ray-triangle intersections.
2. The insertion of references to a hierarchical structure, for example., a kd-
tree (encoded in a buffer) into the lists of each grid cell. This would allow
for faster ray-tracing of rigid or static scene elements.
i
i
i
i
i
i
i
i
3. Real-Time One-Bounce Indirect Illumination and Shadows using Ray Tracing 171
3. The use of a binary 3D grid that could be generated by a scattering pixel
shader and the use of the SM5 instruction for an atomic binary or opera-
tion (InterlockeOr()). Early experiments show that this is feasible and
fast, but the resulting blocked indirect light is not stable for low enough
resolutions of the binary 3D grid.
4. Instead of computing the accumulated contribution of blocked VPLs for
each pixel, it would be possible to compute a spherical harmonics projection
of the blocked indirect light of a distribution of VPLs at the center of each
cell of the 3D grid. For a given screen pixel one could reconstruct a smooth
approximation of the blocked indirect light from the tri-linear interpolation
of eight sets of the spherical harmonics coefficient of the eight relevant grid
cells.
Bibliography
[Dachsbacher and Stamminger 05] Carsten Dachsbacher and Marc Stamminger. “Re-
flective Shadow Maps. In Proceedings of the 2005 Symposium on Interactive 3D
Graphics and Games, I3D ’05, pp.203–231. New York, ACM, 2005.
[Dachsbacher and Stamminger 06] Carsten Dachsbacher and Marc Stamminger.
”Splatting Indirect Illumination.” In Proceedings of the 2006 Symposium on In-
teractive 3D Graphics and Games, I3D ’06, pp. 93–100. New York, ACM, 2006.
[Eisemann and ecoret 06] Elmar Eisemann and Xavier D´ecoret. “Fast Scene Voxeliza-
tion and Applications.” In Proceedings of the 2006 Symposium on Interactive 3D
Graphics and Games, I3D ’06, pp. 71–78. New York, ACM, 2006.
[Kapalanyan 09] Anton Kapalanyan. “Light Propagation Volumes in CryEngine 3.“
In Advances in Real-Time Rendering in 3D Graphics and Games Course -
SIGGRAPH 2009. Available online http://www.crytek.com/cryengine/cryengine3/
presentations/light-propagation-volumes-in-cryengine-3, 2009.
[Kapalanyan and Dachsbacher 10] Anton Kaplanyan and Carsten Dachsbacher. ”Cas-
caded Light Propagation Volumes for Real-Time Indirect Illumination,” In Pro-
ceedings of the 2010 ACM SIGGRAPH Symposium on Interactive 3D Graphics
and Games, I3D ’10, pp. 99–107. New York: ACM, 2010.
[M¨oller and Trumbore 97] Thomas M¨oller and Ben Trumbore. “Fast, Minimum Storage
Ray/Triangle Intersection,” journal of graphics tool 2:1 (1997), 21–28.
[Ritschel et al. 08] T. Ritschel, T. Grosch, T. M. H. Kim, H.-P. Seidel, C. Dachsbacher,
and J. Kautz. ”Imperfect Shadow Maps for Efficient Computation of Indirect Illu-
mination.” ACM Trans. Graph. 27:5 (2008), 129:1–129:8. .
[Ritschel et al. 09a] T. Ritschel, T. Grosch, and H.-P. Seidel. ”Approximating Dynamic
Global Illumination in Image Space.” In I3D ’09: Proceedings of the 2009 Sympo-
sium on Interactive 3D Graphics and Games, I3D ’09, pp. 75–82. New York, ACM,
2009.
i
i
i
i
i
i
i
i
172 III Global Illumination Effects
[Ritschel et al. 09b] T. Ritschel, T. Engelhardt, T. Grosch, H.-P. Seidel, J. Kautz, and
C. Dachsbacher. “Micro-Rendering for Scalable, Parallel Final Gathering.“ ACM
Transactions on Graphics (Proc. SIGGRAPH Asia 2009) 28:5 (2009), 132:1–132:8.
[Sloan et al. 09] P.-P Sloan, N. Govindaraju, D. Nowrouzezahrai and J. Snyder. “Image-
Based Proxy Accumulation for Real-Time Soft Global Illumination.” In Proceedings
of the 15th Pacific Conference on Computer Graphics, pp. 97–105. Washington,
DC: IEEE Computer Society, 2009.
[Segovia et al. 09] B. Segovia, J.C. Iehl R. Mitanchey and B. eroche. ”Non-Interleaved
Deferred Shading of Interleaved Sample Patterns.” in Proceedings of the 21st ACM
SIGGRAPH/EUROGRAPHICS Symposium on Graphics Hardware, pp. 53–60.
Aire-la-Ville, Switzerland, Eurographics Asociation, 2009.
[Tomasi and Manduchi 98] C. Tomasi and R. Manduchi. “Bilateral Filtering for Gray
and Color Images.” In Proceedings of the Sixth International Conference on Com-
puter Vision, pp. 839–846. Washington, DC: IEEE Computer Society, 1998.
[Thibieroz and Gruen 10] N. Thibieroz and H. Gruen. “’OIT and Indirect Illumination
Using DX11 Linked Lists.“ In Proceedings of Game Developers Conference, 2010.
[Wald et al. 09] I. Wald. T. Ize, A. Kensler, A. Knoll, and S¿ G¿ Parker. ”Ray Tracing
Animated Scenes Using Coherent Grid Traversal.” ACM Transanction on Graphics
(Proc. SIGGRAPH ASIA) 25:3 (2006), 485–493.
[Wyman and Nichols 09] C. Wyman and G. Nichols. “Multiresolution Splatting for In-
direct Illumination.” In I3D ’09: Proceedings of the 2009 Symposium on Interactive
3D Graphics and Games, pp. 83–90. News York: ACM, 2009.
[Yang et al. 09] J. Yang, J. Hensley, H. Gruen, and N. Thibieroz. “Dynamic Construc-
tion of Concurrent Linked-Lists for Real-Time Rendering.” Computer Graphics
Forum (Eurographics Symposium on Rendering 2010)29:4 (2010), 1297–1304.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.111.233