Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Ray Tracing

Similar presentations


Presentation on theme: "Introduction to Ray Tracing"— Presentation transcript:

1 Introduction to Ray Tracing
CSE 681

2 Ray Tracing Shoot a ray through each pixel;
Find first object intersected by ray. Image plane Eye Compute ray. (More linear algebra.) Compute ray-object intersection. CSE 681

3 Ray Tracing For each pixel Form ray from eye through pixel
For each object Intersection ray with object If intersection is closer than any other so far, save it Color pixel with shade of object at point of intersection CSE 681

4 Example CSE 681

5 Shade of Object at Point
Ambient Diffuse Specular Shadows Material properties Texture Reflections Transparency (refraction) CSE 681

6 Diffuse Reflection Light that gets absorbed into the objects surface
Gets reflected equally in all directions Need to calculate angle of incoming light to surface CSE 681

7 Diffuse Reflection Calculate amount/color of light shining on an object. Depends on angle between light ray and surface normal. CSE 681

8 Example: Diffuse reflection
What about shiny objects? CSE 681

9 Specular Reflection Calculate light bouncing off object to your eye;
Angle of incidence = angle of reflection. Most intense at angle of reflection; falls off from there Angle of incidence Angle of reflection Eye CSE 681

10 Example: Specular Reflection
CSE 681

11 What’s wrong with this picture?
No shadows. CSE 681

12 Shadows Determine when light ray is blocked from reaching object.
Ray-object intersection calculation For each pixel for each object for each light source CSE 681

13 Reflection Image plane Eye CSE 681

14 Transparency Transparency CSE 681

15 Transparency & Refraction
Ray changes direction in transition between materials Material properties give ratio of in/out angles CSE 681

16 Transparency & Refraction
CSE 681

17 Recursive Ray Tracing Image plane Eye CSE 681

18 Polyhedral Models Polyhedral models CSE 681

19 Texture Mapping Texture mapping. CSE 681

20 Sampling and Aliasing Problem: Representing pixel by a single ray.
Using higher resolution won’t solve problem. No matter how small pixels are, objects can be smaller. CSE 681

21 Anti-Aliasing Solution: Use multiple rays;
Average values calculated by rays. Image plane Eye CSE 681

22 Sampling and Aliasing Problem: Sampling frequency may match image frequency. Image plane Eye Viewport CSE 681

23 Random/Stochastic Sampling
Randomly sample rays through pixel. Image plane Eye Viewport CSE 681

24 Efficiency 1280 x 1024 = 1,310,720  106 pixels. 106 initial rays.
106 reflection rays. Potentially 106 refraction rays. 3 x 106 shadow rays (3 lights.) Next level: Potentially 4 x 106 refraction/reflection rays. 1,000,000 polygons. 107 x 106 = 1013 ray-polygon intersection calculations. No anti-aliasing. CSE 681

25 Intersection Data Structures
Coarse test to see if ray could *possibly* intersection object Divide space up - sort objects into spatial buckets – trace ray from bucket to bucket CSE 681

26 Bounding Boxes CSE 681

27 Spatial Subdivision CSE 681

28 Theory: sampling the environment
Rendering as sampling problem Expected value & variance Techniques to efficiently reduce variance CSE 681

29 Major Course Topics Object & coordinate transformations.
Ray-object intersections. Diffuse & specular reflection. Shadows. Opacity & refraction. Recursive ray tracing. Polyhedral models. Texture mapping. Anti-aliasing and sampling. Bounding boxes and spatial subdivision. Sampling theory. CSE 681


Download ppt "Introduction to Ray Tracing"

Similar presentations


Ads by Google