220 likes | 358 Views
363CS – Artificial Intelligence. Lecture 4: 17/5/1435 Ray Tracing. Lecturer/ Kawther Abas k.albasheir@sau.edu.sa. Introduction to Ray- Tracing. Basic Setup. Introduction to Ray-tracing. Modeling Rendering. Properties of Light Rays.
E N D
363CS – Artificial Intelligence Lecture 4: 17/5/1435 Ray Tracing Lecturer/ Kawther Abas k.albasheir@sau.edu.sa
Introduction to Ray- Tracing • Basic Setup
Introduction to Ray-tracing Modeling Rendering
Properties of Light Rays • Light Travels in Straight Lines. • Two Light rays do not interfere with each other if they cross. • Light rays travel from light source to the eye, but physics for path reversal is same.
Light Object Intersection • Reflection v/s Transmission
Light Object Intersection • Specular v/s Diffusion
Types of Ray Tracing • Forward Ray Tracing
Types of Ray Tracing • Backward Ray Tracing
Types of Ray Tracing • Hybrid ray tracing Whitted(1980) Backward Ray tracing + rays to light source
Types of Ray Tracing • Hybrid ray tracing. • Heckbert (1990). backward ray tracing + forward ray tracing + storage on surface. • Veach (1995). backward ray tracing + forward ray tracing + connecting lines.
Color and Shading and Texture Mapping • Flat Shading. • Cook-Torrance method. • Lambertian Shading / Cosine Shading. computes the angle between the intersection point and the normal vector of the surface, to determine the shading of the surface at that point. Ambient Coefficient, Diffuse Coefficient their importance. • Assigning an entire image to an object instead of a single color is Texture mapping.
Rendering Effects Created by Ray Tracing Transparency
Rendering Effects Created by Ray Tracing Refraction
Types of Anti-Aliasing Techniques • Super Sampling • Adaptive Super Sampling / Monte-Carlo Sampling • Stochastic Ray Tracing/ Distributed Ray Tracing • Statistical Super sampling
Directional Techniques-Light Buffer • Preprocessing Step to ray tracing, to speed up calculations of shadows. • Form a directional cube around point light. • Candidate lists for each window are formed. • Check for shadows using distance t0
Adaptive Depth Control • Rays are attenuated as they pass through the scene. • Uses properties of materials like reflection coefficient , refraction coefficient and global property like distance attenuation factor.
Generalized Rays • Uses an entire family of rays bundled as beams, cones or pencils • Uses of using these rays are effective antialiasing additional optical effects • Some sacrifices needed are types of primitive objects may need to be restricted the computation of exact intersection needed to be abandoned
Limitations of Ray Tracing • Slow. • Good for ideal environment. • View Dependent. • Not good at rendering in real time. • Alternatives to ray tracing. Ray casting. Radiosity.
Input signal: Matlab output: WHY? x = 0:.05:5; imagesc(sin((2.^x).*x)) Aj-aj-aj: Alias! Not enough samples Alias: n., an assumed name Picket fence receding Into the distance will produce aliasing…
Aliasing • occurs when your sampling rate is not high enough to capture the amount of detail in your image • Can give you the wrong signal/image—an alias • Where can it happen in images? • During image synthesis: • sampling continous singal into discrete signal • e.g. ray tracing, line drawing, function plotting, etc. • During image processing: • resampling discrete signal at a different rate • e.g. Image warping, zooming in, zooming out, etc. • To do sampling right, need to understand the structure of your signal/image • Enter Monsieur Fourier…
Antialiasing • What can be done? • Raise sampling rate by oversampling • Sample at k times the resolution • continuous signal: easy • discrete signal: need to interpolate
Antialiasing • What can be done? • Raise sampling rate by oversampling • Sample at k times the resolution • continuous signal: easy • discrete signal: need to interpolate