腾讯游戏开发精粹Ⅱ
上QQ阅读APP看本书,新人免费读10天
设备和账号都新为新人

6.5 总结

基于体素化的烘焙器拥有超过BVH的光线追踪效率,可以更为快速地烘焙出Volume Lightmap和Visibility,并且由于不依赖硬件,因此非常易于扩展和引入前沿算法进行优化,易于接入不同的项目。不过,除这些优点外,还需要进行以下的优化才能更好地应用于更多的项目。

● 对于开放大世界来说,Voxelization的内存占用空间会很大,基于Voxelization的烘焙器采用的是内存换计算的策略:BVH只需要记录顶点和拓扑信息,Voxelization烘焙器还要记录每一个三角面内部的Voxel信息。内存数据量和场景大小成立方关系,超大场景的Voxel数据整体放进内存是不现实的,这里有两个解决的策略,一是对Voxel数据进行压缩,既包括对数据内容的压缩[21],又包括对数据结构的压缩[22];二是类似虚拟内存,对Voxel数据进行磁盘-内存间置换[23]

● 针对超大场景,用3D Texture存储Volume Lightmap来采样GI同样有占用空间太大的问题,可以存储稀疏分布的Irradiance Probe,在Runtime时增加Alu计算进行插值,从而大大减少存储的数据量,使得数据量不和场景大小成立方关系。

● 不论是Volume Lightmap还是稀疏的Irradiance Probe,都有漏光、漏黑的问题,作者沿着采样方向进行了一定的偏移来缓解该问题。目前PC端业界的做法是对每一个Probe还要存储球面深度信息,如论文[24],这样就可以大大减小漏光、漏黑的的程度,但该方法的缺点是显而易见的,会引入大量的数据,并且在Runtime时Alu的开销会大大增加,所以该方法要在手机端使用还需要进一步的优化。


[1] SCHWARZ M, SEIDEL H-P. Fast parallel surface and solid voxelization on GPUs[J]. ACM transactions on graphics (TOG), 2010, 29(6): 1-10.

[2] KARRAS T.Maximizing parallelism in the construction of BVHs,octrees, and k-d trees[C]//Proceedings of the Fourth ACM SIGGRAPH/Eurographics conference on High-Performance Graphics, 2012: 33-37.

[3] HARADA T, HOWES L. Introduction to GPU radix sort-Heterogeneous Computing with OpenCL[M]. San Mateo, CA. Morgan Kaufman, 2011.

[4] LAINE S, KARRAS T.Efficient sparse voxel octrees[J]. IEEE Transactions on Visualization and Computer Graphics, 2010, 17(8): 1048-1059.

[5] ENDERTON E, SINTORN E, SHIRLEY P, et al. Stochastic transparency[J]. IEEE transactions on visualization and computer graphics, 2010, 17(8): 1036-1047.

[6] PHARR M, JAKOB W, HUMPHREYS G.Physically based rendering: From theory to implementation[M]. Morgan Kaufmann, San Mateo, CA, 2016.

[7] HILLAIRE S, ROUSIERS C de, APERS D. Real-Time Raytracing for Interactive Global Illumination Workflows in Frostbite[C]//Game Developers Conference, 2017.

[8] AILA T, LAINE S.Understanding the efficiency of ray traversal on GPUs[C]//Proceedings of the conference on high performance graphics, 2009: 145-149.

[9] YOUNG E. Direct Compute Optimizations and Best Practices[C]//GPU Technology Conference, 2010.

[10] RONG G, TAN T-S. Variants of jump flooding algorithm for computing discrete Voronoi diagrams[C]//4th International Symposium on Voronoi Diagrams in Science and Engineering (ISVD 2007). IEEE, 2007: 176-181.

[11] SLOAN P-P, KAUTZ J, SNYDER J.Precomputed radiance transfer for real-time rendering in dynamic, low-frequency lighting environments[C]//Proceedings of the 29th annual conference on Computer graphics and interactive techniques, 2002.

[12] IWANICKI M, SLOAN P-P.Precomputed lighting in Call of Duty:Infinite Warfare[C]//SIGGRAPH 2017 Course: Advances in Real-Time Rendering in Games, 2017.

[13] SLOAN P-P. Stupid spherical harmonics (sh) tricks[C]//Game developers conference, 2008.

[14] MEURER A, SMITH C P,PAPROCKI M. SymPy:symbolic computing in Python[J].PeerJ Computer Science, 2017, 3:e103.

[15] PRESS W H, WILLIAM H, TEUKOLSKY S A, et al. Numerical recipes 3rd edition:The art of scientific computing[M]. Cambridge university press, UK, 2007.

[16] KAVAN L, BARGTEIL A W, SLOAN P-P. Least squares vertex baking[C]//Computer Graphics Forum.Wiley Online Library, 2011: 1319-1326.

[17] JIMÉNEZ J, WU X,PESCE A.Practical real-time strategies for accurate indirect occlusion[C]//SIGGRAPH 2016 Courses:Physically Based Shading in Theory and Practice, 2016.

[18] EL GARAWANY R. Deferred lighting in uncharted 4[C]//SIGGRAPH 2016 Courses: Advances in Real-Time Rendering in Games, 2016.

[19] MAZONKA O. Solid angle of conical surfaces,polyhedral cones, and intersecting spherical caps[OL].arXiv preprint arXiv:1205.1396, 2012.

[20] OAT C, SANDER P V. Ambient aperture lighting[C]//Proceedings of the 2007 Symposium on interactive 3D Graphics and Games, 2007:61-64.

[21] DOLONIUS D, SINTORN E, KÄMPE V, et al. Compressing color data for voxelized surface geometry[J]. IEEE transactions on visualization and computer graphics, 2017, 25(2): 1270-1282.

[22] VILLANUEVA A J,MARTON F,GOBBETTI E. Symmetry-aware Sparse Voxel DAGs (SSVDAGs) for compression-domain tracing of high-resolution geometric scenes[J].Journal of Computer Graphics Techniques, 2017,6(2): 1-30.

[23] BAERT J, LAGAE A, DUTRÉ P.Out-of-core construction of sparse voxel octrees[C]//Proceedings of the 5th high-performance graphics conference, 2013: 27-32.

[24] MAJERCIK Z,GUERTIN J-P,NOWROUZEZAHRAI D, et al. Dynamic diffuse global illumination with ray-traced irradiance fields[C]//Journal of Computer Graphics Techniques, 2019.