


































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



































Computer Graphics Raytracing (Part I)
n Global illumination-based rendering method n Simulates rays of light, natural lighting effects n Because light path is traced, handles some effects that are tough for openGL: n Shadows n Multiple inter-reflections n Transparency n Refraction n Texture mapping n Newer variations… e.g. photon mapping (caustics, participating media, smoke) n Note: raytracing can be whole semester graduate course n Today: start with high-level description
n OpenGL is object space rendering n start from world objects, rasterize them n Ray tracing is image space method n Start from pixel, what do you see through this pixel? n Looks through each pixel (e.g. 640 x 480) n Determines what eye sees through pixel n Basic idea: n Trace light rays: eye -> pixel (image plane) -> scene n If a ray intersect any scene object in this direction
ß Ray hits object: Check if hit point is in shadow, build secondary ray (shadow ray) towards light sources.
ß If shadow ray hits another object before light source: first intersection point is in shadow of the second object. Otherwise, collect light contributions
ß When a ray hits an object, a reflected ray is generated which is tested against all of the objects in the scene.
Reflected rays can generate other reflected rays that can generate other reflected rays, etc. Case A: Scene with no reflection rays
Case C: Scene with two layers of reflection
n Reflective and/or transmitted rays are continually generated until ray leaves the scene without hitting any object or a preset recursion level has been reached.
n Dependent on parametric equations of object n Ray-Sphere Intersections n Ray-Plane Intersections n Ray-Polygon Intersections n Ray-Box Intersections n Ray-Quadric Intersections (cylinders, cones, ellipsoids, paraboloids )
n The first step is to create the model of the objects
n One should NOT hardcode objects into the program, but instead use an input file.
n This is called retained mode graphics
n We will use SDL
n Ray trace SDL files
n The output image/file will consist of three intensity values (Red, Green, and Blue) for each pixel.