OpenCL-Based Real-Time KD-Tree and Raytracing for Dynamic Scene
Lu Heqi,Bao Peng,Feng Jieqing
DOI: https://doi.org/10.3969/j.issn.1003-9775.2013.07.005
2013-01-01
Journal of Computer-Aided Design & Computer Graphics
Abstract:Due to acceleration algorithms of ray-tracing only designed for specified GPU or multi-core CPU,it is challenge to design a cross platform ray-tracing algorithm for real-time applications.This paper presents a cross-platform algorithm of ray-tracing dynamic scenes based on OpenCL.By exploiting parallel processing ability of general purpose GPU,three components of ray-tracing,i.e.,KD-Tree construction,scene traversal and shading,are performed on GPU,which are scheduled by CPU.Thus GPU computing ability is exploited thoroughly and data transmission overhead is reduced efficiently.By designing algorithms of parallel partitions and SAH,proposing strategies of compact data management and offset mark based leaf node storage,a high quality KD-Tree for dynamic scene is constructed on GPU in real-time,which will effectively facilitates scene traversal.The tree construction algorithm is breadth-first and suitable for large scale parallel implementation on both NVIDIA GPU and AMD GPU.Experimental results show that the proposed algorithm is capable of ray-tracing a middle scale dynamic scene in real-time on both NVIDIA GPU and AMD GPU.