So far, we have considered only local models of illumination; they only account for incident light coming directly from the light sources.

Save this PDF as:

Size: px
Start display at page:

Download "So far, we have considered only local models of illumination; they only account for incident light coming directly from the light sources."

Transcription

1 Basics So far, we have considered only local models of illumination; they only account for incident light coming directly from the light sources. Global models include incident light that arrives from other surfaces, and lighting effects that account for global scene geometry. Such effects include: Shadows Secondary illumination (such as color bleeding) Reflections of other objects, in mirrors, for example Ray Tracing was developed as one approach to modeling the properties of global illumination. The basic idea is as follows: For each pixel: Cast a ray from the eye of the camera through the pixel, and find the first surface hit by the ray. Determine the surface radiance at the surface intersection with a combination of local and global models. To estimate the global component, cast rays from the surface point to possible incident directions to determine how much light comes from each direction. This leads to a recursive form for tracing paths of light backwards from the surface to the light sources. Aside: is also sometimes called Whitted Ray Tracing, after its inventor, Turner Whitted. Computational Issues Form rays. Find ray intersections with objects. Find closest object intersections. Find surface normals at object intersection. Evaluate reflectance models at the intersection. Copyright c 2005 David Fleet and Aaron Hertzmann 64

2 11.2 Ray Casting We want to find the ray from the eye through pixel (i,j). Camera Model ē W is the origin of the camera, in world space. u, v, and w are the world space directions corresponding to the x, y, and z axes in eye space. The image plane is defined by ( p r) w = 0, or r + a u + b v, where r = ē W + f w. Window A window in the view-plane is defined by its boundaries in camera coordinates: w l, w r, w t, and w b. (In other words, the left-most edge is the line (w l,λ,f).) Viewport Let the viewport (i.e., output image) have columns 0...n c 1 and rows 0...n r 1. (0, 0) is the upper left entry. The camera coordinates of pixel (i,j) are as follows: p C i,j = (w l + i u,w t + j v,f) u = w r w l n c 1 In world coordinates, this is: p W i,j = v = w b w t n r 1 u v w p C i,j + ē W Ray: Finally, the ray is then defined in world coordinates as follows: r(λ) = p W i,j + λ d i,j where d i,j = p W i,j ē W. For λ > 0, all points on the ray lie in front of the viewplane along a single line of sight Intersections In this section, we denote a ray as r(λ) = ā + λ d, λ > 0. Copyright c 2005 David Fleet and Aaron Hertzmann 65

3 Triangles Define a triangle with three points, p 1, p 2, and p 3. Here are two ways to solve for the ray-triangle intersection. Intersect r(λ) with the plane ( p p 1 ) n = 0 for n = ( p 2 p 1 ) ( p 3 p 1 ) by substituting r(λ) for p and solving for λ. Then test the half-planes for constraints. For example: (ā + λ d p 1 ) n = 0 λ = ( p 1 ā) n d n What does it mean when d n = 0? What does it mean when d n = 0 and ( p 1 ā) n = 0? Solve for α and β where p(α,β) p 1 + α( p 2 p 1 ) + β( p 3 p 1 ), i.e. r(λ) = ā + λ d = p 1 + α( p 2 p 1 ) + β( p 3 p 1 ). This leads to the 3x3 system ( p 2 p 1 ) ( p 3 p 1 ) d α β λ = ( p 1 ā) Invert the matrix and solve for α, β, and λ. The intersection is in the triangle when the following conditions are all true: α 0 β 0 α + β General Planar Polygons For general planar polygons, solve for the intersection with the plane. Then form a ray s(t) in the plane, starting at the intersection p(λ ). Measure the number of intersections with the polygon sides for t > 0. If there is an even number of intersections, the intersection is inside. If the number of intersection is odd, it is outside. Aside: This is a consequence of the Jordan Curve Theorem. As related to this problem, it states that two points are both inside or both outside when the number of intersections on a line between them is even. Copyright c 2005 David Fleet and Aaron Hertzmann 66

4 Spheres Define the unit sphere centered at c by p c 2 = 1. Substitute a point on the ray r(λ) into this equation: (ā + λ d c) (ā + λ d c) 1 = 0 Expand this equation and write it in terms of the quadratic form: The solution is then: Aλ 2 + 2Bλ + C = 0 A = d d B = (ā c) d C = (ā c) (ā c) 1 λ = 2B ± 4B 2 4AC = B D 2A A ± A,D = B2 AC If D < 0, there are no intersections. If D = 0, there is one intersection; the ray grazes the sphere. If D > 0, there are two intersections with two values for λ, λ 1 and λ 2. When D > 0, three cases of interest exist: λ 1 < 0 and λ 2 < 0. Both intersections are behind the view-plane, and are not visible. λ 1 > 0 and λ 2 < 0. The p(λ 1 ) is a visible intersection, but p(λ 1 ) is not. λ 1 > λ 2 and λ 2 > 0. Both intersections are in front of the view-plane. p(λ 2 ) is the closest intersection Affinely Deformed Objects Proposition: Given an intersection method for an object, it is easy to intersect rays with affinely deformed versions of the object. We assume here that the affine transformation is invertible. Let F(ȳ) = 0 be the deformed version of f( x) = 0, where ȳ = A x + t. i.e. F(ȳ) = f(a 1 (ȳ t)) = 0, so F(ȳ) = 0 iff f( x) = 0. Given an intersection method for f( x) = 0, find the intersection of r(λ) = ā + λ d and F(ȳ) = 0, where λ > 0. Solution: Substitute r(λ) into the implicit equation f = F(ȳ): F ( r(λ)) = f ( A 1 ( r (λ) t )) = f(a 1 (ā + λ d t)) = f(ā + λ d ) = f( r (λ)) Copyright c 2005 David Fleet and Aaron Hertzmann 67

5 where ā = A 1 (ā t) d = A 1 d i.e. intersecting F(ȳ) with r(λ) is like intersecting f(x) with r (λ) = ā + λ d where λ > 0. The value of λ found is the same in both cases. Exercise: Verify that, at the solution λ, with an affine deformation ȳ = A x + t, that r(λ ) = A r (λ ) + t Cylinders and Cones A right-circular cylinder may be defined by x 2 + y 2 = 1 for z 1. A cone may be defined by x 2 + y (1 z2 ) = 0 for 0 z 1. Find intersection with quadratic wall, ignoring constraints on z, e.g. using x 2 + y 2 = 1 or x 2 + y (1 z2 ) = 0. Then test the z component of p(λ ) against the constraint on z, e.g. z 1 or z < 1. Intersect the ray with the planes containing the base or cap (e.g. z = 1 for the cylinder). Then test the x and y components of p(λ ) to see if they satisfy interior constraints (e.g. x 2 + y 2 < 1 for the cylinder). If there are multiple intersections, then take the intersection with the smallest positive λ (i.e., closest to the start of the ray). Copyright c 2005 David Fleet and Aaron Hertzmann 68

6 11.4 The Scene Signature The scene signature is a simple way to test geometry intersection methods. Create an image in which pixel (i,j) has intensity k if object k is first object hit from ray through (i,j). Each object gets one unique color. Note: Pseudo-Code: Scene Signature < Construct scene model = { obj, (A, t), objid } > sig: array[nc, nr] of objid for j = 0 to nr-1 (loop over rows) for i = 0 to nc-1 (loop over columns) < Construct ray r ij (λ) = p ij + λ( p ij ē) through pixel p ij > λ i,j loop over all objects in scene, with object identifiers objid k < find λ for the closest intersection of the ray r ij (λ) and the object > if λ > 0 and λ < λ i,j then λ i,j λ sig[i,j].objid objid k end loop end for end for 11.5 Efficiency Intersection tests are expensive when there are large numbers of objects, and when the objects are quite complex! Fortunately, data structures can be used to avoid testing intersections with objects that are not likely to be significant. Example: We could bound a 3D mesh or object with a simple bounding volume (e.g. sphere or cube). Then we would only test intersections with objects if there exists a positive intersection with the bounding volume. Example: We could project the extent onto the image plane so you don t need to cast rays to determine potential for intersections. Copyright c 2005 David Fleet and Aaron Hertzmann 69

7 11.6 Surface Normals at Intersection Points Once we find intersections of rays and scene surfaces, and we select the first surface hit by the ray, we want to compute the shading of the surface as seen from the ray. That is, we cast a ray out from a pixel and find the first surface hit, and then we want to know how much light leave the surface along the same ray but in the reverse direction, back to the camera. Toward this end, one critical property of the surface geometry that we need to compute is the surface normal at the hit point. For mesh surfaces, we might interpolate smoothly from face normals (like we did to get normals at a vertex). This assumes the underlying surface is smooth. Otherwise we can just use the face normal. For smooth surfaces (e.g. with implicit forms f( p) = 0 or parametric forms s(α, β)), either take n = f( p) f( p) or Affinely-deformed surfaces. n = s s α β s α s β. Let f( p) = 0 be an implicit surface, and let Q( p) = A p + t be an affine transformation, where A is invertible. The affinely-deformed surface is F( q) = f(q 1 ( p)) = f(a 1 ( p t)) = 0 (1) A normal of F at a point q is given by A T n A T n where A T = (A 1 ) T and n is the normal of f at p = Q 1 ( q). (2) Derivation: Let s = r(λ ) be the intersection point, and let ( p s) n = 0 be the tangent plane at the intersection point. We can also write this as: Substituting in q = A p + t and solving gives: ( p s) T n = 0 (3) ( p s) T n = (A 1 ( q t) s) T n (4) Copyright c 2005 David Fleet and Aaron Hertzmann 70

8 = ( q (A s + t)) T A T n (5) In other words, the tangent plane at the transformed point has normal A T n and passes through point (A s + t). preserved so the tangent plane on the deformed surface is given by (A 1 ( q t)) T n = D. This is the equation of a plane with unit normal A T n A T n Shading Once we have cast a ray through pixel p i,j in the direction d i,j, and we ve found the closest hit point p with surface normal n, we wish to determine how much light leaves the surface at p into the direction d i,j (i.e., back towards the camera pixel). Further we want reflect both the light from light sources that directly illuminate the surface as well as secondary illumination, where light from other surfaces shines on the surface at p. This is a complex task since it involves all of the ways in which light could illuminate the surface from all different directions, and the myriad ways such light interacts with the surface and it then emitted or reflected by the surface. Here we will deal first with the simplest case, known widely as Whitted Ray Tracing. Aside: First, note that if we were to ignore all secondary reflection, then we could just compute the Phong reflectance model at p and then color the pixel with that value. Such scenes would look similar to those that we have rendered using shading techniques seen earlier in the course. The main differences from earlier rendering techniques are the way in which hidden surfaces are handled and the lack of interpolation Basic (Whitted) Ray Tracing In basic ray tracing we assume that that the light reflected from the surface is a combination of the reflection computed by the Phong model, along with one component due to specular secondary reflection. That is, the only reflection we consider is that due to perfect mirror reflection. We only consider perfect specular reflection for computational efficiency; i.e., rather than consider secondary illumination at p from all different directions, with perfect specular reflection we know that the only incoming light at p that will be reflected in the direction d i,j will be that coming from the corresponding mirror direction (i.e., m s = 2( d i,j n)) n + d i,j ). We can find out how much light is incoming from direction m s be casting another ray into that direction from p and calculating the light reflected from the first surface hit. Note that we have just described a recursive ray tracer; i.e., in order to calculate the reflectance at a hit point we need to cast more rays and compute the reflectance at the new hit points so we can calculate the incoming light at the original hit point. In summary, for basic (Whitted) ray tracing, the reflectance model calculation comprises: Copyright c 2005 David Fleet and Aaron Hertzmann 71

9 A local model (e.g., Phong) to account for diffuse and off-axis specular reflection (highlights) due to light sources. An ambient term to approximate the global diffuse components. Cast rays from p into direction m s = 2( d i,j n)) n+ d i,j to estimate ideal mirror reflections due to light coming from other ojects (i.e., secondary reflection). For a ray r(λ) = ā + λ d which hits a surface point point p with normal n, the reflectance is given by E = r a I a + r d I d max(0, n s) + r s I s max(0, c m) α + r g I spec where r a, r d, and r s are the reflection coefficients of the Phong model, I a, I d, and I s are the light source intensities for the ambient, diffuse and specular terms of the Phong model, s is the light source direction from p, the emittant direction of interest is c = d i,j, and m = 2( s n)) n s is the perfect mirror direction for the local specular reflection. Finally, I spec is the light obtained from the recursive ray cast into the direction m s to find secondary illumination, and r g is the reflection coefficient that determines the fraction of secondary illumination that is reflected by the surface at p Texture Texture can be used to modulate diffuse and a mbient reflection coefficients, as with Gouraud shading. We simply need a way to map each point on the surface to a point in texture space, as above, e.g. given an intersection point p(λ ), convert into parametric form s(α,β) and use (α,β) to find texture coordinates (µ,ν). Unlike Gouraud shading, we don t need to interpolate (µ,ν) over polygons. We get a new (µ,ν) for each intersection point. Anti-aliasing and super-sampling are covered in the Distribution Ray Tracing notes Transmission/Refraction Light that penetrates a (partially or wholly) transparent surface/material is refracted (bent), owing to a change in the speed of light in different media. Snell s Law governs refraction: sin θ 1 sin θ 2 = c 1 c 2 Copyright c 2005 David Fleet and Aaron Hertzmann 72

10 The index of refraction is the ratio of light speeds c 1 /c 2. For example, the index of refraction for passing from air to water is c air c water = 1.33, and for passing from air to glass, it is c air c glass = 1.8. Note: There is also a wavelength dependence. We ignore this here. Example: If c 2 < c 1, light bends towards the normal (e.g. air to water). If c 2 < c 1, light bends away from the normal (e.g. water to air). The critical angle θ c, when c 2 > c 1, is when θ 1 θ c and θ Beyond θ c, θ 1 > θ c, and total internal reflection occurs. No light enters the material. Remarks: The outgoing direction is in the plane of the incoming direction and n. This is similar to the perfect specular direction. When θ 1 = 0, then θ 2 = 0, i.e. there is no bending. For ray tracing: Treat global transmission like global specular, i.e. cast one ray. Need to keep track of the speed of light in the current medium Shadows A simple way to include some global effects with minimal work is to turn off local reflection when the surface point p cannot see light sources, i.e. when p is in shadow. When computing E at p, cast a ray toward the light source, i.e. in the direction s = (l p). p W (λ) = p W + λ(l W p W ) Find the first intersection with a surface in the scene. If λ at the first intersection point is 0 λ 1, then there exists a surface that occludes the light source from p. We should omit diffuse and specular terms from the local Phong model. The surface radiance at p becomes E = r a I a + r g I spec Copyright c 2005 David Fleet and Aaron Hertzmann 73

11 Note: Pseudo-Code: Recursive Ray Tracer for each pixel (i,j) < compute ray r ij (λ) = p ij + λ d ij where d ij = p ij e > I = raytrace( p ij, d ij, 1); setpixel(i, j, I) end for raytrace( ā, b, depth) findfirsthit( ā, b, output var obj, λ, p, n) if λ > 0 then I = rtshade(obj, p, n, b, depth) else I = background; return(i) findfirsthit( ā, b, output var OBJ, λ h, p h, n h ) λ h = 1; loop over all objects in scene, with object identifiers objid k < find λ for the closest legitimate intersection of ray r ij (λ) and object > if ( λ h < 0 or λ < λ h ) and λ > 0 then λ h = λ p h = ā + λ b; < determine normal at hit point n h > OBJ = objid k end loop rtshade(obj, p, n, d e, depth) /* Local Component */ findfirsthit( p, l w p, output var temp, λ h ); if 0 < λ h < 1 then I l = ambientterm; else I l = phongmodel( p, n, d e, OBJ.localparams) /* Global Component */ if depth < maxdepth then Copyright c 2005 David Fleet and Aaron Hertzmann 74

12 if OBJ has specular reflection then < calculate mirror direction m s = d e + 2 n d e n > I spec = raytrace( p, m s, depth+1) < scale I spec by OBJ.specularReflCoef > if OBJ is refractive then < calculate refractive direction t > if not total internal reflection then I refr = raytrace( p, t, depth+1) < scale I refr by OBJ.refractiveReflCoef > I g = I spec + I refr else I g = 0 return(i l + I g ) Copyright c 2005 David Fleet and Aaron Hertzmann 75

Lecture 17: Recursive Ray Tracing. Where is the way where light dwelleth? Job 38:19

Lecture 17: Recursive Ray Tracing Where is the way where light dwelleth? Job 38:19 1. Raster Graphics Typical graphics terminals today are raster displays. A raster display renders a picture scan line

Reflection and Shading R. J. Renka Department of Computer Science & Engineering University of North Texas 10/19/2015 Light Sources Realistic rendering requires that we model the interaction between light

Computer Graphics. Lecture 13. Global Illumination 1: Ray Tracing and Radiosity. Taku Komura

Computer Graphics Lecture 13 Global Illumination 1: Ray Tracing and Radiosity Taku Komura 1 Rendering techniques Can be classified as Local Illumination techniques Global Illumination techniques Local

Photorealism: Ray Tracing

Photorealism: Ray Tracing Reading Assignment: Chapter 13 Local vs. Global Illumination Local Illumination depends on local object and light sources only Global Illumination at a point can depend on any

Ray-Tracing. Misha Kazhdan

Ray-Tracing Misha Kazhdan Ray-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Goal: Ray-Tracing Take a collection of triangles representing a 3D scene and render

Computer Graphics. Lecture 10. Global Illumination 1: Ray Tracing and Radiosity. Taku Komura 12/03/15

Computer Graphics Lecture 10 Global Illumination 1: Ray Tracing and Radiosity Taku Komura 1 Rendering techniques Can be classified as Local Illumination techniques Global Illumination techniques Local

Ray Tracing. CSCI 420 Computer Graphics Lecture 15. Ray Casting Shadow Rays Reflection and Transmission [Ch ]

CSCI 420 Computer Graphics Lecture 15 Ray Tracing Ray Casting Shadow Rays Reflection and Transmission [Ch. 13.2-13.3] Jernej Barbic University of Southern California 1 Local Illumination Object illuminations

Lighting and Shading Computer Graphics I Lecture 7. Light Sources Phong Illumination Model Normal Vectors [Angel, Ch

15-462 Computer Graphics I Lecture 7 Lighting and Shading February 12, 2002 Frank Pfenning Carnegie Mellon University http://www.cs.cmu.edu/~fp/courses/graphics/ Light Sources Phong Illumination Model

Ray tracing. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 3/19/07 1

Ray tracing Computer Graphics COMP 770 (236) Spring 2007 Instructor: Brandon Lloyd 3/19/07 1 From last time Hidden surface removal Painter s algorithm Clipping algorithms Area subdivision BSP trees Z-Buffer

CS5620 Intro to Computer Graphics

So Far wireframe hidden surfaces Next step 1 2 Light! Need to understand: How lighting works Types of lights Types of surfaces How shading works Shading algorithms What s Missing? Lighting vs. Shading

Ø Sampling Theory" Ø Fourier Analysis Ø Anti-aliasing Ø Supersampling Strategies" Ø The Hall illumination model. Ø Original ray tracing paper

CS 431/636 Advanced Rendering Techniques Ø Dr. David Breen Ø Korman 105D Ø Wednesday 6PM 8:50PM Presentation 6 5/16/12 Questions from ast Time? Ø Sampling Theory" Ø Fourier Analysis Ø Anti-aliasing Ø Supersampling

Ray Tracing. CS334 Fall Daniel G. Aliaga Department of Computer Science Purdue University

Ray Tracing CS334 Fall 2013 Daniel G. Aliaga Department of Computer Science Purdue University Ray Casting and Ray Tracing Ray Casting Arthur Appel, started around 1968 Ray Tracing Turner Whitted, started

Assignment 6: Ray Tracing

Assignment 6: Ray Tracing Programming Lab Due: Monday, April 20 (midnight) 1 Introduction Throughout this semester you have written code that manipulated shapes and cameras to prepare a scene for rendering.

CSC418 / CSCD18 / CSC2504

5 5.1 Surface Representations As with 2D objects, we can represent 3D objects in parametric and implicit forms. (There are also explicit forms for 3D surfaces sometimes called height fields but we will

COMP environment mapping Mar. 12, r = 2n(n v) v

Rendering mirror surfaces The next texture mapping method assumes we have a mirror surface, or at least a reflectance function that contains a mirror component. Examples might be a car window or hood,

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

CENG 477 Introduction to Computer Graphics Ray Tracing: Shading Last Week Until now we learned: How to create the primary rays from the given camera and image plane parameters How to intersect these rays

Computer Graphics and Image Processing Ray Tracing I

Computer Graphics and Image Processing Ray Tracing I Part 1 Lecture 9 1 Today s Outline Introduction to Ray Tracing Ray Casting Intersecting Rays with Primitives Intersecting Rays with Transformed Primitives

Computer Graphics I. Assignment 3

UNIVERSITÄT DES SAARLANDES Dr.-Ing. Hendrik P.A. Lensch Max Planck Institut Informatik Art Tevs (tevs@mpi-inf.mpg.de) Boris Ajdin (bajdin@mpi-inf.mpg.de) Matthias Hullin (hullin@mpi-inf.mpg.de) 12. November

Computer Graphics. Lecture 9 Environment mapping, Mirroring

Computer Graphics Lecture 9 Environment mapping, Mirroring Today Environment Mapping Introduction Cubic mapping Sphere mapping refractive mapping Mirroring Introduction reflection first stencil buffer

Topic 9: Lighting & Reflection models 9/10/2016. Spot the differences. Terminology. Two Components of Illumination. Ambient Light Source

Topic 9: Lighting & Reflection models Lighting & reflection The Phong reflection model diffuse component ambient component specular component Spot the differences Terminology Illumination The transport

Interpolation using scanline algorithm

Interpolation using scanline algorithm Idea: Exploit knowledge about already computed color values. Traverse projected triangle top-down using scanline. Compute start and end color value of each pixel

CSE 681 Illumination and Phong Shading

CSE 681 Illumination and Phong Shading Physics tells us What is Light? We don t see objects, we see light reflected off of objects Light is a particle and a wave The frequency of light What is Color? Our

COMP 175 COMPUTER GRAPHICS. Ray Casting. COMP 175: Computer Graphics April 26, Erik Anderson 09 Ray Casting

Ray Casting COMP 175: Computer Graphics April 26, 2018 1/41 Admin } Assignment 4 posted } Picking new partners today for rest of the assignments } Demo in the works } Mac demo may require a new dylib I

() Illumination and Shading Dr. Ayman Eldeib Lighting So given a 3-D triangle and a 3-D viewpoint, we can set the right pixels But what color should those pixels be? If we re attempting to create a realistic

Recall: Basic Ray Tracer

1 Recall: Ray Tracing Generate an image by backwards tracing the path of light through pixels on an image plane Simulate the interaction of light with objects Recall: Basic Ray Tracer Trace a primary ray

ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

ECS 175 COMPUTER GRAPHICS Ken Joy Winter 2014 Shading To be able to model shading, we simplify Uniform Media no scattering of light Opaque Objects No Interreflection Point Light Sources RGB Color (eliminating

Chapter 32 Light: Reflection and Refraction. Copyright 2009 Pearson Education, Inc.

Chapter 32 Light: Reflection and Refraction Units of Chapter 32 The Ray Model of Light Reflection; Image Formation by a Plane Mirror Formation of Images by Spherical Mirrors Index of Refraction Refraction:

Introduction to Computer Graphics 3. Shading

Introduction to Computer Graphics 3. Shading National Chiao Tung Univ, Taiwan By: I-Chen Lin, Assistant Professor Textbook: E.Angel, Interactive Computer Graphics, 5 th Ed., Addison Wesley Ref: Hearn and

Introduction to Computer Graphics 7. Shading

Introduction to Computer Graphics 7. Shading National Chiao Tung Univ, Taiwan By: I-Chen Lin, Assistant Professor Textbook: Hearn and Baker, Computer Graphics, 3rd Ed., Prentice Hall Ref: E.Angel, Interactive

CPSC 314 LIGHTING AND SHADING UGRAD.CS.UBC.CA/~CS314 slide credits: Mikhail Bessmeltsev et al 1 THE RENDERING PIPELINE Vertices and attributes Vertex Shader Modelview transform Per-vertex attributes Vertex

Announcements. Written Assignment 2 out (due March 8) Computer Graphics

Announcements Written Assignment 2 out (due March 8) 1 Advanced Ray Tracing (Recursive) Ray Tracing Antialiasing Motion Blur Distribution Ray Tracing Ray Tracing and Radiosity Assumptions Simple shading

Ray Casting. Outline. Similar to glulookat derivation. Foundations of Computer Graphics

Foundations of omputer Graphics Online Lecture 10: Ray Tracing 2 Nuts and olts amera Ray asting Outline amera Ray asting (choose ray directions) Ravi Ramamoorthi Outline in ode Image Raytrace (amera cam,

Illumination and Shading Computer Graphics COMP 770 (236) Spring 2007 Instructor: Brandon Lloyd 2/14/07 1 From last time Texture mapping overview notation wrapping Perspective-correct interpolation Texture

Pipeline Operations. CS 4620 Lecture 14

Pipeline Operations CS 4620 Lecture 14 2014 Steve Marschner 1 Pipeline you are here APPLICATION COMMAND STREAM 3D transformations; shading VERTEX PROCESSING TRANSFORMED GEOMETRY conversion of primitives

Illumination and Shading Illumination (Lighting)! Model the interaction of light with surface points to determine their final color and brightness! The illumination can be computed either at vertices or

Photorealism. Ray Tracing Texture Mapping Radiosity

Photorealism Ray Tracing Texture Mapping Radiosity Photorealism -- Taking into Account Global Illumination Light can arrive at surfaces indirectly This light called global illumination To now we ve approximated

Illumination Models and Surface-Rendering Methods. Chapter 10

Illumination Models and Surface-Rendering Methods Chapter 10 Illumination and Surface- Rendering Given scene specifications object positions, optical properties of the surface, viewer position, viewing

CS 4620 Midterm, March 21, 2017

CS 460 Midterm, March 1, 017 This 90-minute exam has 4 questions worth a total of 100 points. Use the back of the pages if you need more space. Academic Integrity is expected of all students of Cornell

Comp 410/510 Computer Graphics. Spring Shading

Comp 410/510 Computer Graphics Spring 2017 Shading Why we need shading Suppose we build a model of a sphere using many polygons and then color it using a fixed color. We get something like But we rather

03 RENDERING PART TWO

03 RENDERING PART TWO WHAT WE HAVE SO FAR: GEOMETRY AFTER TRANSFORMATION AND SOME BASIC CLIPPING / CULLING TEXTURES AND MAPPING MATERIAL VISUALLY DISTINGUISHES 2 OBJECTS WITH IDENTICAL GEOMETRY FOR NOW,

Programming projects. Assignment 1: Basic ray tracer. Assignment 1: Basic ray tracer. Assignment 1: Basic ray tracer. Assignment 1: Basic ray tracer

Programming projects Rendering Algorithms Spring 2010 Matthias Zwicker Universität Bern Description of assignments on class webpage Use programming language and environment of your choice We recommend

Chapter 11 Global Illumination. Part 1 Ray Tracing. Reading: Angel s Interactive Computer Graphics (6 th ed.) Sections 11.1, 11.2, 11.

Chapter 11 Global Illumination Part 1 Ray Tracing Reading: Angel s Interactive Computer Graphics (6 th ed.) Sections 11.1, 11.2, 11.3 CG(U), Chap.11 Part 1:Ray Tracing 1 Can pipeline graphics renders images

Raytracing CS148 AS3. Due :59pm PDT

Raytracing CS148 AS3 Due 2010-07-25 11:59pm PDT We start our exploration of Rendering - the process of converting a high-level object-based description of scene into an image. We will do this by building

9. Illumination and Shading Approaches for visual realism: - Remove hidden surfaces - Shade visible surfaces and reproduce shadows - Reproduce surface properties Texture Degree of transparency Roughness,

CS 563 Advanced Topics in Computer Graphics Lecture 2: Bare-Bones Raytracer. by Emmanuel Agu

CS 563 Advanced Topics in Computer Graphics Lecture 2: Bare-Bones Raytracer by Emmanuel Agu Ray Casting (Appel, 1968) direct illumination Recursive ray tracing (Whitted, 1980) Pseudocode for Ray Tracer

Ray-tracing Cont. Ray-tracing

Ray-tracing Cont. Ray-tracing light s-ray e-ray s-ray light Intersecting polygons starts with intersecting a plane 2 1 Shadow Rays Once an intersection is computed, we send a shadow ray to each light source

Ray casting. Ray casting/ray tracing

Ray casting Ray casting/ray tracing Iterate over pixels, not objects Effects that are difficult with Z-buffer, are easy with ray tracing: shadows, reflections, transparency, procedural textures and objects

Reflection and Refraction

Reflection and Refraction Lecture #21 Tuesday, ovember 18, 2014 How about Interreflections! ote reflections! Granite tabletop! Visible on base! Also on handle This is a featured picture on the English

Orthogonal Projection Matrices. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Orthogonal Projection Matrices 1 Objectives Derive the projection matrices used for standard orthogonal projections Introduce oblique projections Introduce projection normalization 2 Normalization Rather

Computer Graphics. Shading. Based on slides by Dianna Xu, Bryn Mawr College

Computer Graphics Shading Based on slides by Dianna Xu, Bryn Mawr College Image Synthesis and Shading Perception of 3D Objects Displays almost always 2 dimensional. Depth cues needed to restore the third

Reflection and Refraction

Reflection and Refraction Lecture #22 Tuesday, ovember 19, 2013 (Major Updates 12/06/13) How about Interreflections ote reflections Granite tabletop Visible on base Also on handle This is a featured picture

Computer Graphics 1. Chapter 7 (June 17th, 2010, 2-4pm): Shading and rendering. LMU München Medieninformatik Andreas Butz Computergraphik 1 SS2010

Computer Graphics 1 Chapter 7 (June 17th, 2010, 2-4pm): Shading and rendering 1 The 3D rendering pipeline (our version for this class) 3D models in model coordinates 3D models in world coordinates 2D Polygons

Wednesday, 26 January 2005, 14:OO - 17:OO h.

Delft University of Technology Faculty Electrical Engineering, Mathematics, and Computer Science Mekelweg 4, Delft TU Delft Examination for Course IN41 5 1-3D Computer Graphics and Virtual Reality Please

SEOUL NATIONAL UNIVERSITY

Fashion Technology 5. 3D Garment CAD-1 Sungmin Kim SEOUL NATIONAL UNIVERSITY Overview Design Process Concept Design Scalable vector graphics Feature-based design Pattern Design 2D Parametric design 3D

Raycast Rendering Maya 2013

2000 2012 Michael O'Rourke Raycast Rendering Maya 2013 (See also the Intro to Lights and Rendering tutorial for an introduction to the basics of rendering an image) Concept There are several algorithms

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Computergrafik Matthias Zwicker Universität Bern Herbst 2016 Today More shading Environment maps Reflection mapping Irradiance environment maps Ambient occlusion Reflection and refraction Toon shading

Introduction to Ray-tracing Objectives

Introduction to Ray-tracing Objectives Define ray-tracing as a means of rendering Ray-tracing for spheres Combining with shading model An algorithm framework 2 1 Light vs. Rendering 3 (Local) Ray-tracing

Recap: Refraction. Amount of bending depends on: - angle of incidence - refractive index of medium. (n 2 > n 1 ) n 2

Amount of bending depends on: - angle of incidence - refractive index of medium Recap: Refraction λ 1 (n 2 > n 1 ) Snell s Law: When light passes from one transparent medium to another, the rays will be

Overview Shading Shading Light-material interactions Phong model Shading polygons Shading in OpenGL Why we need shading Suppose we build a model of a sphere using many polygons and color it with glcolor.

Chapter 26 Geometrical Optics

Chapter 26 Geometrical Optics 26.1 The Reflection of Light 26.2 Forming Images With a Plane Mirror 26.3 Spherical Mirrors 26.4 Ray Tracing and the Mirror Equation 26.5 The Refraction of Light 26.6 Ray

Chapter 7 - Light, Materials, Appearance

Chapter 7 - Light, Materials, Appearance Types of light in nature and in CG Shadows Using lights in CG Illumination models Textures and maps Procedural surface descriptions Literature: E. Angel/D. Shreiner,

CMSC427 Advanced shading getting global illumination by local methods. Credit: slides Prof. Zwicker

CMSC427 Advanced shading getting global illumination by local methods Credit: slides Prof. Zwicker Topics Shadows Environment maps Reflection mapping Irradiance environment maps Ambient occlusion Reflection

Light. Form of Electromagnetic Energy Only part of Electromagnetic Spectrum that we can really see

Light Form of Electromagnetic Energy Only part of Electromagnetic Spectrum that we can really see Facts About Light The speed of light, c, is constant in a vacuum. Light can be: REFLECTED ABSORBED REFRACTED

Textbook Reference: Glencoe Physics: Chapters 16-18

Honors Physics-121B Geometric Optics Introduction: A great deal of evidence suggests that light travels in straight lines. A source of light like the sun casts distinct shadows. We can hear sound from

Illumination & Shading Goals Introduce the types of light-material interactions Build a simple reflection model---the Phong model--- that can be used with real time graphics hardware Why we need Illumination

FLAP P6.2 Rays and geometrical optics COPYRIGHT 1998 THE OPEN UNIVERSITY S570 V1.1

F1 The ray approximation in optics assumes that light travels from one point to another along a narrow path called a ray that may be represented by a directed line (i.e. a line with an arrow on it). In

L1 - Introduction. Contents. Introduction of CAD/CAM system Components of CAD/CAM systems Basic concepts of graphics programming

L1 - Introduction Contents Introduction of CAD/CAM system Components of CAD/CAM systems Basic concepts of graphics programming 1 Definitions Computer-Aided Design (CAD) The technology concerned with the

CS452/552; EE465/505. Intro to Lighting

CS452/552; EE465/505 Intro to Lighting 2-10 15 Outline! Projection Normalization! Introduction to Lighting (and Shading) Read: Angel Chapter 5., sections 5.4-5.7 Parallel Projections Chapter 6, sections

Physics 202, Lecture 23

Physics 202, Lecture 23 Today s Topics Lights and Laws of Geometric Optics Nature of Light Reflection and Refraction Law of Reflection Law of Refraction Index of Reflection, Snell s Law Total Internal

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1 graphics pipeline sequence of operations to generate an image using object-order processing primitives processed one-at-a-time

Deferred Rendering Due: Wednesday November 15 at 10pm

CMSC 23700 Autumn 2017 Introduction to Computer Graphics Project 4 November 2, 2017 Deferred Rendering Due: Wednesday November 15 at 10pm 1 Summary This assignment uses the same application architecture

The Law of Reflection

If the surface off which the light is reflected is smooth, then the light undergoes specular reflection (parallel rays will all be reflected in the same directions). If, on the other hand, the surface

surface: reflectance transparency, opacity, translucency orientation illumination: location intensity wavelength point-source, diffuse source

walters@buffalo.edu CSE 480/580 Lecture 18 Slide 1 Illumination and Shading Light reflected from nonluminous objects depends on: surface: reflectance transparency, opacity, translucency orientation illumination:

Lecture Outline Chapter 26. Physics, 4 th Edition James S. Walker. Copyright 2010 Pearson Education, Inc.

Lecture Outline Chapter 26 Physics, 4 th Edition James S. Walker Chapter 26 Geometrical Optics Units of Chapter 26 The Reflection of Light Forming Images with a Plane Mirror Spherical Mirrors Ray Tracing

Computer Graphics Lecture 11

1 / 14 Computer Graphics Lecture 11 Dr. Marc Eduard Frîncu West University of Timisoara May 15th 2012 2 / 14 Outline 1 Introduction 2 Transparency 3 Reflection 4 Recap 3 / 14 Introduction light = local

Global Illumination. Global Illumination. Direct Illumination vs. Global Illumination. Indirect Illumination. Soft Shadows.

CSCI 480 Computer Graphics Lecture 18 Global Illumination BRDFs Raytracing and Radiosity Subsurface Scattering Photon Mapping [Ch. 13.4-13.5] March 28, 2012 Jernej Barbic University of Southern California

CEng 477 Introduction to Computer Graphics Fall

Illumination Models and Surface-Rendering Methods CEng 477 Introduction to Computer Graphics Fall 2007 2008 Illumination Models and Surface Rendering Methods In order to achieve realism in computer generated

specular diffuse reflection.

Lesson 8 Light and Optics The Nature of Light Properties of Light: Reflection Refraction Interference Diffraction Polarization Dispersion and Prisms Total Internal Reflection Huygens s Principle The Nature

Indirect Illumination

Indirect Illumination Michael Kazhdan (601.457/657) HB Ch. 14.1, 14.2 FvDFH 16.1, 16.2 Surface Illumination Calculation Multiple light source: 2 Viewer N 1 V I = I E + K A I A + K D N, + K S V, R n I Overview

Light: Geometric Optics

Light: Geometric Optics 23.1 The Ray Model of Light Light very often travels in straight lines. We represent light using rays, which are straight lines emanating from an object. This is an idealization,

Light: Geometric Optics (Chapter 23)

Light: Geometric Optics (Chapter 23) Units of Chapter 23 The Ray Model of Light Reflection; Image Formed by a Plane Mirror Formation of Images by Spherical Index of Refraction Refraction: Snell s Law 1

Three-Dimensional Graphics V. Guoying Zhao 1 / 55

Computer Graphics Three-Dimensional Graphics V Guoying Zhao 1 / 55 Shading Guoying Zhao 2 / 55 Objectives Learn to shade objects so their images appear three-dimensional Introduce the types of light-material

Ray Casting. To Do. Outline. Outline in Code. Foundations of Computer Graphics (Spring 2012) Heckbert s Business Card Ray Tracer

Foundations of Computer Graphics (Spring 2012) CS 184, Lectures 16, 18: Nuts and bolts of Ray Tracing To Do Finish homework 3 Prepare for Midterm (Monday) Everything before this week (no raytracing) Closed

Ray tracing Tutorial. Lukas Herzberger

Ray tracing Tutorial Lukas Herzberger Agenda Ray tracing algorithm (lab 4a) Intersection tests Ray tracing algorithm (lab 4b) Hints & common mistakes Agenda Ray tracing algorithm (lab 4a) Intersection

Lecture 7 Notes: 07 / 11. Reflection and refraction

Lecture 7 Notes: 07 / 11 Reflection and refraction When an electromagnetic wave, such as light, encounters the surface of a medium, some of it is reflected off the surface, while some crosses the boundary

GEOMETRIC OPTICS. LENSES refract light, so we need to know how light bends when entering and exiting a lens and how that interaction forms an image.

I. What is GEOMTERIC OPTICS GEOMETRIC OPTICS In geometric optics, LIGHT is treated as imaginary rays. How these rays interact with at the interface of different media, including lenses and mirrors, is

Photorealistic 3D Rendering for VW in Mobile Devices

Abstract University of Arkansas CSCE Department Advanced Virtual Worlds Spring 2013 Photorealistic 3D Rendering for VW in Mobile Devices Rafael Aroxa In the past few years, the demand for high performance

Lecture 18: Primer on Ray Tracing Techniques

Lecture 18: Primer on Ray Tracing Techniques 6.172: Performance Engineering of Software Systems Joshua Slocum November 16, 2010 A Little Background Image rendering technique Simulate rays of light - ray

Single Scattering in Refractive Media with Triangle Mesh Boundaries

Single Scattering in Refractive Media with Triangle Mesh Boundaries Bruce Walter Shuang Zhao Nicolas Holzschuch Kavita Bala Cornell Univ. Cornell Univ. Grenoble Univ. Cornell Univ. Presented at SIGGRAPH

3D Rendering and Ray Casting

3D Rendering and Ray Casting Michael Kazhdan (601.457/657) HB Ch. 13.7, 14.6 FvDFH 15.5, 15.10 Rendering Generate an image from geometric primitives Rendering Geometric Primitives (3D) Raster Image (2D)

CS 543: Computer Graphics Illumination & Shading I Robert W. Lindeman Associate Professor Interactive Media & Game Development Department of Computer Science Worcester Polytechnic Institute gogo@wpi.edu

Light: Geometric Optics

Light: Geometric Optics The Ray Model of Light Light very often travels in straight lines. We represent light using rays, which are straight lines emanating from an object. This is an idealization, but

CS 4204 Computer Graphics

CS 4204 Computer Graphics Introduction to Ray Tracing Yong Cao Virginia Tech Reference: Ed Angle, Interactive Computer Graphics, University of New Mexico, class notes Raytracing (Picture from Povray.org)

Review for Ray-tracing Algorithm and Hardware

Review for Ray-tracing Algorithm and Hardware Reporter: 邱敬捷博士候選人 Lan-Da Van ( 范倫達 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C. Summer, 2017 1 2017/7/26 Outline

Ch. 22 Properties of Light HW# 1, 5, 7, 9, 11, 15, 19, 22, 29, 37, 38

Ch. 22 Properties of Light HW# 1, 5, 7, 9, 11, 15, 19, 22, 29, 37, 38 Brief History of the Nature of Light Up until 19 th century, light was modeled as a stream of particles. Newton was a proponent of

Objectives Shading in OpenGL Introduce the OpenGL shading methods - per vertex shading vs per fragment shading - Where to carry out Discuss polygonal shading - Flat - Smooth - Gouraud CITS3003 Graphics

Chapter 9- Ray-Tracing

Ray-tracing is used to produce mirrored and reflective surfaces. It is also being used to create transparency and refraction (bending of images through transparent surfaceslike a magnifying glass or a

Shading and Illumination OpenGL Shading Without Shading With Shading Physics Bidirectional Reflectance Distribution Function (BRDF) f r (ω i,ω ) = dl(ω ) L(ω i )cosθ i dω i = dl(ω ) L(ω i )( ω i n)dω