Jared Duke and Dr. Matthew Anderson, Math Department
Ray tracing is a common technique for computational, photo-realistic simulation of the “real world.” However, most current approaches assume light propagation is linear: that is, light always travels in a straight line. Our aim was to create a ray tracing program that would handle the “bending” of light waves at relativistic speeds or by gravitational forces. This could in turn be used to assist scientists in understanding the numerical results from their research and to help others understand and visualize such complex natural phenomenon.
Today, there exist a multitude of software programs that produce near photo-realistic output of real-world scenes and places in this process known as ray tracing. The specifics of how this algorithm works are beyond the scope of this paper. However, it is sufficient to know that the method involves tracing the path of a light ray from an imaginary viewer’s perspective through each point in a virtual screen. The program calculates the intersection of these light rays with objects and materials in the virtual scene, and their subsequent reflection and propagation. The combination of such collisions and reflections produces a picture, which, given sufficient computing resources and time, takes on strikingly real dimensions.
These programs make one assumption, however. They assume that light travels in a straight line. For the most part, such an assumption is safe, but in the scientific realm this assumption often breaks down. Our work involved extending existing, open-source ray-tracing software, to allow for the modeling of scenes where light rays do not necessarily travel in straight lines.
The first problem in adapting a standard ray tracer is the modification of the ray casting/propogation algorithm. In the standard approach, a ray is cast for each pixel of the resultant image. This ray is assumed to travel in a straight line, and all calculations are made with such an assumption in mind. Figure 1 illustrates the traditional ray tracing paradigm.
The second problem lies in the significant increase in complexity for calculating these bending light rays. Standard ray-tracers are notorious for their computationally expensive requirements. Consequently, a non-linear raytracer, being orders of a magnitude more complex, will push the limits even further.
The creation of the modified program involved a two-part modification to existing ray-tracing solutions. First, we calculate the modified trajectory of the light rays, as given by a specific ordinary differential equation. This equation is plugged in to the integration scheme, and can be used to model anything from light-waves affected by gravity, to heat waves, to underwater caustic effects. For testing purposes, we simply used the central force equation as given by Newtonian gravity.
The second modification involved a change in the logic of the ray-tracing routine itself. Essentially, we took the numerical solution to the equations, and used that to break apart, or discretize, the path of the ray. Instead of infinite rays, finite line segments were created at appropriate intervals along the path. At each stage, collisions were calculated between the segment and objects in the scene. If no collision resulted, we proceeded by computing the following segment along the path, checking collisions, and so forth. Certain tradeoffs were made in accuracy to approximate the path of the light in efforts to speed the overall scene visualization.
Figure 2 illustrates the results of our efforts, in before and after screenshots. It provides a comparison of a traditional, linearly ray-traced scene, and a scene where the light rays are bent by gravity.
The initial implementation of our non-linear raytracing system is certainly promising. The foremost discovery was that such an attempt is both possible and viable. We found that the typical raytracing algorithm can be modified in a relatively straightforward way to allow for modified lighting systems. Though such a system can be orders of a magnitude slower in practice, it is nonetheless possible, and powerful in the extent to which different lighting systems can be modeled.
There is much room for improvement, however. First, our focus was primarily in proving the system could be created. That being said, optimization was more an afterthought than a focus. There are a variety of approaches to the computational aspect of the program we hope to explore, all of which would yield significant speedups in execution time. Also, we were only able to simulate a limited number of environments, most of which were significantly simplified for testing purposes.
Nonetheless, our initial attempts served their purpose, and the modeling of non-linear light propagation was realized. The hope is that such work can be taken and applied to make contributions in understanding and approach both in the areas of science and education.