Ray Tracing using 3D Grid Simulations Ryan Thomas and Sudhanshu Kumar Semwal Abstract—Bounding Volume Hierarchies (BVHs) and k-d trees have been used to create interactive ray tracing. Ray tracing dynamic scenes using nVidia’s R OptiX TM has already provided thirty to sixty frames per second or better. In this paper, we implement space partitioning methods, such as grid method and the proximity clouds (PCs), on multiple GPUs. Our motivation is to investigate the use of such methods for medical applications, because there is direct one to one correspondence between 3D voxels used in space partitioning methods and 3D voxels in the volume data. In the past, proximity Clouds have worked well on static scenes, but object movement forces recalculation of the scene and some preprocessing cost. This paper investigates parallelizing these techniques on the GPU to determine the feasibility of dynamic scenes using them. Our scenes are made of spheres instead of volume data because at this time we do not know of any technique that can generate dynamically changing volume data. Interestingly, Proximity Clouds (PCs), which typically has large gains in rendering times compared to the 3D Grid method, emerges only slightly better than the 3D Grid method for dynamic scenes because both the processing and rendering costs are now added for dynamic scenes with spheres. The 3D grid method, due to its simpler preprocessing, may be the best choice for ray tracing the dynamic volume data on multiple GPU. Keywords: 3D Graphics, Ray Tracing, 3D Grids, CUDA. I. I NTRODUCTION T HE goal of any grid structure is to divide the scene into voxels. These voxels are populated with the objects in the scene, and allow the ray to test only objects in the voxel intersected by the ray. The 3DDDA method [9] removes many unnecessary collision detection tests in favor of grid traversal. The Proximity Clouds(PC) method [3] builds from 3DDDA. PCs allow for a ray to skip a larger portion of the grid by computing how far the ray can safely jump before it might have a collision. Cellular automata (CA) [29], [22] could implement multi- level interactions, and emergence of diseases [26], [2]. Complex Systems science [12] has been applied to model events occurring in nature. Works by Prigogine [16], in thermodynamics, and earlier work by Poincare’s on sensi- tivity of dynamical systems to initial conditions provide the basis for complex systems research for cellular automata research. Limitations of simulating organic life by using computational models have been discussed before, these include (i) brittleness [18] of the computational medium, and (ii) the limitations of reductionist approaches to model organic life, which is well documented in [19]. Because Cellular Automata uses local interactions, not the reductionist approaches, it could provide a suitable platform to model organic behavior such as cancerous growth patterns. Local interactions, usually implemented for every cell, could create Manuscript received July 5, 2014; revised July 30, 2014. Ryan Thomas and Sudhanshu Kumar Semwal are with the Department of Computer Science, University of Colorado at Colorado Springs, CO, 80918, USA e-mail: rythomas@gmail.com and ssemwal@uccs.edu subtle interactions mimicking organic behavior. Many exam- ples, such as flocking, and 3D games have shown remarkable variety of emergence when a cell’s next state is based on consulting nearby voxels. For example twenty-seven cells could be consulted for (3x3x3= 27; 26 immediate vicinity, and 1 itself) to decide the next state. Different non-linear and dynamics pattern could emerge using different local interactions strategies [17]. Volume Data provides one-to-one correspondence for use by a Cellular Automata. The Visible Human Project sup- ported (1989-2000) by US National Library of Medicine (NLM) provides a detailed volume data of human body. The process created a very detailed database of volume data 1 mm apart for the male cadaver with 1871 slices, which when stacked create a 3D grid of volume. This created 40 Gigabyte of 3D grid data which might have to be ray traced, or variation of raytracing called ray-casting could be used. 3D Morphing techniques [20], and for medical applications [7], [8] have been implemented using cellular automata on volume data. However, real-time manipulation of such large data is not possible with the computer systems of today, yet GPU computing provides a promising research direction. The rise of GPU computing has been growing over the previous few years. GPU computing allows for parrellization of algorithms when the algorithm allows for it. The 3DDDA traversal algorithm remains the same when run on the GPU and the CPU. Proximity Clouds are allowed a different approach on the GPU. The traditional algorithms proposed can be mapped on the GPU. The principles of the algorithm are the same but now are rewritten using a parallel processing implementation. The benefit is the loop is simplified allowing the distance calculations to be run simultaneously while building the Proximity Clouds. These adjustments make 3DDDA/Proximity Clouds the best choice on today’s hardware for dynamic scenes. II. OCT TREES AND 3DDDA Glassner’s [10] approach to ray tracing was to use oct tree to subdivide 3D space during preprocessing. During ray tracing, the rays traverse the leaf nodes if the octtree, and only check those objects which pass through the leaf nodes along the path of the ray. Fujimoto, Tanaka, and Iwata proposed the 3DDDA algorithm [9] which provided an efficient traversal algorithm for space partitioning techniques. Instead of using an octtree, the algorithm defines a grid of voxels. The ray traverses from one voxel to another along the path of the ray benefitting from the efficient 3DDA algorithm. This allows for a ray to only perform collision detection on objects that are in its path rather than every object in the scene. The benefits of the speedup due to 3DDDA were also extended based on our earlier work on slicing extent technique [25], [24], [5]. This work was then extended to create Directional Safe Zones [23] to improve on proximity clouds technique. Proceedings of the World Congress on Engineering and Computer Science 2014 Vol I WCECS 2014, 22-24 October, 2014, San Francisco, USA ISBN: 978-988-19252-0-6 ISSN: 2078-0958 (Print); ISSN: 2078-0966 (Online) WCECS 2014