Abstract
A ray tracer is a program that takes as input the description of a scene, including light sources, models, and camera, and produces an image of that scene as seen from the camera. The representation of rays and their intersections with objects is central to a ray tracer. To render an image, the ray tracer spawns rays through the optical center of the camera position and each pixel of the image. For each spawned ray, the closest intersection with the surface of a model is determined. A quick intersection test is performed by first checking the intersection with a bounding sphere that encloses the entire model. If that test turns out positive, a more complex intersection test is done. The polygons of the models are stored in binary space partition (BSP) trees. Using the material properties and light source information, local shading computations are made. The shading equations used are the same as those employed for the fixed function pipeline of OpenGL, except that shadow checks are done. So a shadow ray is spawned from the intersection point towards each of the light sources to check the path. If the shadow ray cannot reach a light source unobstructed, that light source does not contribute to diffuse and specular lighting for the intersection point.
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
More From: Geometric Algebra for Computer Science (Revised Edition)
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.