RESEARCH REPORT

Rendering Depth Perception Through Distributed Ray Tracing
Ryan May, Ruth Ogunnaike, Craig Shih


 
 


Introduction
Depth perception is the visual ability to perceive the world in three dimensions (3D) and the distance of an object. It is difficult to recognize object location in space, the distance of an object (and between objects) in an image or world without defining depth of the object(s) in view


Problem Statement: Depth of Field


Depth perception can be divided into two components; the ability to perceive the world in three dimensions, and the utilization of this ability to determine the viewer’s distance from an object. Perspective projection, in which objects in a scene are represented in size and placement according to their distance from the viewer, can be easily understood as a fundamental aspect of vision. The lenses in both cameras and our eyes produce images that represent perspective projection.

Generating images with this sense of perspective has already been implemented in the RayTracer software program that students have manipulated throughout the quarter. Since the RayTracer’s RTCamera object acts as computer graphics camera, which in theory operates similarly to a real-world camera, the images rendered through single-point ray tracing already convey perspective.

Picture not available

Figure 1 - To render an image with ray tracing, scene-sampling rays that originate from the RTCamera (yellow cone) are shot out in every direction allowable within the field of view (red/yellow rectangle). The properties of the objects that intersect with these rays determine the color of each ray’s corresponding pixel in the rendered image.



However, while the viewer orients themselves in physical space, the clarity of surrounding objects changes depending on the viewer's depth of focus. Objects in the scene appear to blur depending on their distance from the viewers focal distance. It is through this process that a viewer perceives the distance of objects relative to other objects, and also to themselves.
We have added the capacity to generate image blurring to the RayTracer framework. To put it simply, we altered the RTCamera to include a circular lens object that causes a series of scene-sampling rays to converge at a specific point at a predetermined focal plane. For each pixel sampled, a quasi-randomized position within the pixel is established using jitter sampling, and a focal point on the focal plane is determined by tracing the direction from the center of the lens through this randomized intra-pixel point. Using this focal point, a sample ray is traced from a random point on the lens toward the focal point. The color of this image pixel is the average of the colors captured by up to 2000 of the sampling ray's’ intersection with scene objects.



Figure 2 - The distributed ray tracing model our implementation is based on. Our decision to place the image plane at IP2, between the lens and the scene, renders the image with the correct orientation. Scenes rendered with the image plane at IP1 render upside-down.
Source: https://courses.cs.washington.edu/courses/cse457/99sp/projects/trace/depthoffield.doc.

Execution Output: Depth of Field


This image was rendered with 50 samples per pixel. No depth-of-focus effects have been applied.


The following images have been rendered with an increasing amount of secondary sampling rays, which reduces the amount of pixelation in the blurred areas of the image. The focal plane is set such that the tiger’s head will be in focus.



50 samples per pixels

200 samples per pixel

2000 samples per pixel


This image was rendered with 50 samples per pixel. No depth-of-focus effects have been applied.



The following images have been rendered with an increasing amount of secondary sampling rays, which reduces the amount of pixelation in the blurred areas of the image. The focal plane is set such that the tiger’s head will be in focus.



50 samples per pixels

200 samples per pixel

2000 samples per pixel

Problem Statement: Motion Blur
In having established the distributed ray tracing pipeline for pre-processing image blurring, we have laid the basic framework for rendering the motion-blur effect. Motion-blurring occurs when the position of an object changes during the duration of the image capture.



image not available

The bus in this image exhibits the motion-blur effect. The blurred area is determined by the bus’ positions at the start and end of image capture.


Since the RTCamera object doesn’t have a shutter, there isn’t a set window of time in which the scene is captured. In our implementation, if an object is determined to be in motion, it’s total movement is indicated by a vector stating its total distance and direction. A time variable between 0 and 1 determines the distance moved along this total distance, and the object is sampled at it’s location determined by the time variable.



Execution Output: Motion Blur



This image was rendered with 50 samples per pixel. No motion-blur effects have been applied.


As was the case for focal depth, the following images have been rendered with an increasing amount of secondary sampling rays, which reduces the amount of pixelation in the blurred areas of the image. Motion blur has been applied to the lilypond sphere and the triangle in the back of the scene.



50 samples per pixels

200 samples per pixel

2000 samples per pixel



This image was rendered with 50 samples per pixel. No motion-blur effects have been applied.

As was the case for focal depth, the following images have been rendered with an increasing amount of secondary sampling rays, which reduces the amount of pixelation in the blurred areas of the image. Motion blur has been applied to the lilypond sphere and the rectangle base of the scene.



50 samples per pixels

200 samples per pixel

2000 samples per pixel

Execution Output: Combined Results


This image was rendered with 50 samples per pixel. No depth-of-focus or motion-blur effects have been applied.



This image was rendered 2000 samples per pixel. Only depth-of-focus effects have been applied.



The following images have been rendered with an increasing amount of sampling rays, which reduces the amount of pixelation in the blurred areas of the image. These images combine depth-of-focus and motion-blur effects together.



50 samples per pixels

200 samples per pixel

2000 samples per pixel

References to our solution


[1] R. Baltazar, “Adding Realistic Camera Effects to the Computer Graphics Camera Model,” 2012.

[2] B. A. Barsky and T. J. Kosloff, “Algorithms for rendering depth of field effects in computer graphics,” in Proceedings of the 12th WSEAS international conference on Computers, 2008, vol. 2008.

[3] B. A. Barsky, D. R. Horn, S. A. Klein, J. A. Pang, and M. Yu, “Camera Models and Optical Systems Used in Computer Graphics: Part I, Object-Based Techniques,” in Computational Science and Its Applications — ICCSA 2003, V. Kumar, M. L. Gavrilova, C. J. K. Tan, and P. L’Ecuyer, Eds. Springer Berlin Heidelberg, 2003, pp. 246–255.

[4] J. D. Pfautz, Depth perception in computer graphics. University of Cambridge, 2000.

[5] N. Tai and M. Inanici, “Depth perception in real and pictorial spaces: A computational framework to represent and simulate the built environment,” in Proceedings of the 14th International Conference on Computer Aided Architectural Design Research in Asia, Yunlin (Taiwan), 2009, pp. 543–552.

[6] R. L. Cook, T. Porter, and L. Carpenter, “Distributed Ray Tracing,” in Proceedings of the 11th Annual Conference on Computer Graphics and Interactive Techniques, New York, NY, USA, 1984, pp. 137–145.

[7] P. Lebreton, A. Raake, M. Barkowsky, and P. Le Callet, “Evaluating depth perception of 3D stereoscopic videos,” Selected Topics in Signal Processing, IEEE Journal of, vol. 6, no. 6, pp. 710–720, 2012.

[8]Matej N., “Evaluation of Depth Map Post-processing Techniques for Novel View Generation“, Vienna University of Technology, 2014

[9] Yung-Yu C., Ramesh R., Fredo D., Sylvain P., Soonmin B., “Digital Visual Effects: Bilateral filtering” , DigiVFX, 2010