针对基于CPU的实时渲染全频阴影算法中内存使用效率低下、CPU运算能力消耗严重等问题,提出了基于GPU的改进算法.在预计算过程中使用基于小波变换的预计算辐射度传递(PRT)算法生成PRT矩阵,然后将其编码为易于被GPU使用的稀疏形式;在渲染过程中使用具有高度并行性的片断渲染器程序进行稀疏矩阵向量快速乘法计算,以求得最终渲染结果.相对于目前基于CPU的相应算法,算法充分利用了GPU的并行计算能力,平衡了CPU与GPU之间的负载,并同时降低了内存消耗.在一般情况下,算法可以获得超过一个数量级的性能提升.
In this paper, the problem of real-time rendering of objects with all-frequency shadows is discussed. Current techniques are limited to memory inefficient, CPU consuming algorithms. In the approach proposed, a wavelet transform based pre-computed radiance transport (PRT) algorithm is used to generate the PRT matrix, which is encoded later into a sparse form that is easy to be utilized by the GPU. Rendering is performed by a fast, highly parallel relighting algorithm written in GPU fragment shader. The algorithm fully utilizes the parallelism nature of the GPU, and achieves one order increasing of the scene relighting speed compared with the current best CPU technique. In the same time, the runtime algorithm decreases the memory usage and gets a better load balance between the CPU and GPU.