Image
Examples
Examples
Ray Tracing Ray tracing is a realistic method for rendering 3D computer graphics environments. It works by tracing the path taken by a ray of light through the scene, and calculating reflection, refraction, or absorption of the ray whenever it intersects an object in the world. Effects such as reflections and shadows, which are difficult to simulate in other algorithms, follow naturally from the ray tracing algorithm.
Ray Tracing This method is very good at simulating specular reflections and transparency, since the rays that are traced through the scenes can be easily bounced at mirrors and refracted by transparent objects. The following scenes were generated with ray tracers developed at our institute. Source:http://www.cg.tuwien.ac.at/research/rendering/rays-radio/
Radiosity Calculating the overall light propagation within a scene, for short global illumination is a very difficult problem. With a standard ray tracing algorithm, this is a very time consuming task, since a huge number of rays have to be shot. For this reason, the radiosity method was invented. The main idea of the method is to store illumination values on the surfaces of the objects, as the light is propagated starting at the light sources.
Ray Tracing
Classical Recursive Ray Tracing For each pixel in image { Create ray from eyepoint passing through this pixel Initialize NearestT to INFINITY and NearestObject to NULL For every object in scene { If ray intersects this object { If t of intersection is less than NearestT { Set NearestT to t of the intersection Set NearestObject to this object }
Classical Recursive Ray Tracing (Cnt.) If NearestObject is NULL { Fill this pixel with background color } Else { Shoot a ray to each light source to check if in shadow If surface is reflective, generate reflection ray: recurse If transparent, generate refraction ray: recurse Use NearestObject and NearestT to compute shading function Fill this pixel with color result of shading function }
The Basic Idea This approach simulates light rays from light source to an observer's eye. Observer Light Source Reflected ray Object
“Forward” Ray-Tracing Trace rays from light Lots of work for little return Light Image Plane Light Rays Eye Object Source: www.plunk.org/COEN-290/Notes/Week8.ppt
“Backward” Ray-Tracing Trace rays from eye instead Do work where it matters Light Image Plane Eye Object Source: www.plunk.org/COEN-290/Notes/Week8.ppt
Ray Parametric form Ray expressed as function of a single parameter (“t”) <x, y, z> = <xo, yo, zo> + t * <xd, yd, zd> <x, y, z> = ro + trd t = 2.5 rd = <xd, yd, zd> t = 2.0 t = 1.0 ro = <xo, yo, zo> t = 0.0 Source: www.plunk.org/COEN-290/Notes/Week8.ppt
Generating Rays Trace a ray for each pixel in the image plane Image fovx Eye Eye Source: www.plunk.org/COEN-290/Notes/Week8.ppt
Generating Rays Trace a ray for each pixel in the image plane Side View m (tan(fovx)* 2) / m (tan(fovy)* 2) / n Eye n Image Plane Source: www.plunk.org/COEN-290/Notes/Week8.ppt
Triangle Intersection Want to know: at what point (p) does ray intersect triangle? Compute lighting, reflected rays, shadowing from that point p rd ro <?, ?, ?> (t = ???) Source: www.plunk.org/COEN-290/Notes/Week8.ppt
Lighting We’ll use triangles for lights Some lighting terms Build complex shapes from triangles Some lighting terms Light Eye N I R V Surface Source: www.plunk.org/COEN-290/Notes/Week8.ppt
Lighting Use modified Phong lighting for each light similar to OpenGL simulates rough and shiny surfaces for each light In = IambientKambient + IdiffuseKdiffuse (L.N) + IspecularKspecular (R.V)n Source: www.plunk.org/COEN-290/Notes/Week8.ppt
Ambient Light Iambient Simulates the indirect lighting in a scene. Eye Source: www.plunk.org/COEN-290/Notes/Week8.ppt
Diffuse Light Idiffuse simulates direct lighting on a rough surface Viewer independent Paper, rough wood, brick, etc... Eye Light
Specular Light Ispecular simulates direct lighting on a smooth surface Viewer dependent Plastic, metal, polished wood, etc... Eye Light
Shadow Test Check against other objects to see if point is shadowed Eye Shadowing Object
Reflection Angle of incidence = angle of reflection ( qI = qR ) I, R, N lie in the same plane R = I - 2 (N . I) N N qI qR I R Source: www.plunk.org/COEN-290/Notes/Week8.ppt
This is A Good Start Lighting, Shadows, Reflection are enough to make some compelling images Want better lighting and objects Need more speed
More Quality, More Speed Better Lighting + Forward Tracing Texture Mapping Modeling Techniques Motion Blur, Depth of Field, Blurry Reflection/Refraction Distributed Ray-Tracing Improving Image Quality Acceleration Techniques
Reflections Reflections are generated using ray tracing. In real life, the interaction of light with a reflective object occurs in the following sequence: a light source emits photons. photons collide with and bounce off of objects (some energy is absorbed by such collisions, which is why we see color.) photons travel into the eye.
Shadows Shadows are very simple to do in a ray tracer. A point is in shadow if a ray from that point to the light source intersects an objects, then the Point is in shadow. In order to apply diffuse shading, the point of intersection of a ray and a sphere has already been calculated. Source:www.2tothex.com/raytracing/
Ray Tracing Tools Professional Tool Free Tools RenderMan is the name of a rendering software package developed by Pixar Animation Studios; it implements Pixar's photorealistic 3D description standard, the RenderMan Interface Specification. Free Tools POV-Ray YafRay BRL-CAD OpenRT
Examples
Examples
Examples
Ray Tracing Paths Ra Tc D Rc C A Rb Ra Ta Ra B Ta A C B PRP Tc Rc Rb D Rd