光线投射算法是一种应用广泛的体绘制基本算法,能产生高质量的图像,但是时间复杂度较高。实现了一种基于图形处理器的单步光线投射算法,并在此基础上提出了一种基于空间跳跃技术的光线投射算法,以实现加速。采用八叉树组织体数据,利用空间跳跃有效地剔除体数据中对重建图像无贡献的部分,降低了硬件的负载。一个片段程序即可完成光线方向的生成、光线投射、空体素跳跃和光线终止等。实验结果表明,该算法对于内部包含大量空体素的体数据重建能起到明显的加速作用。
Ray-casting is a widely used basic volume rendering algorithm. It can get high quality image but suffers from high computational complexity. A single-pass ray-casting algorithm is developed based on GPU( graphics processing unit), and on the basis of this algorithm an accelerated algorithm is proposed based on space leaping technique. Noncontributing region in the volume data coded with octree data structure can be eliminated by space leaping. Then the burden of GPU may be reduced effectively. Only one fragment program is needed to generate ray direction, cast ray, skip empty voxels and terminate ray, et al. The experimental results illustrate the algorithm can significantly accelerate the reconstruction of the volume data containing a lot of empty voxels.