Shadows & Programmable Shaders

Size: px
Start display at page:

Download "Shadows & Programmable Shaders"

Transcription

1 Advanced Rendering Dr. Alexander G. Gee Shadows & Programmable Shaders Shadows Shadow Mapping Using OpenGL Hardware Soft Shadow Volumes Programmable Pipelines OpenGL Shading Language (GLSL) Coupling GLSL to Applications page 2 1

2 Conceptual Model for Computer Graphics Real Light Real Object Synthetic Light Synthetic Camera Human Eye Synthetic Model Graphics System Display Device page 3 Standard OpenGL Projected Scene page 4 2

3 The Scene of Objects with Shadows page 5 Simple Shadows The shape of the shadow is dependent on The position of the light source The shape of the object The form of the surface on which the plane of the shadow falls View from light source Camera view Top down page 6 3

4 Non-Parallel Point Light Source Shadows Standard light sources are generally those defined at an infinite distance from the objects, as depicted previously The other standard light source is one that represents a light bulb or candle that occupies no space These light sources project rays of light in all directions from the lights spatial position page 7 Eye Linear Texture Coordinate Generation Model Coordinates Modeling Transformation World Coordinates Viewing Transformation View Coordinates Shadows 4D Eye-Linear Projection Transformation (s, t, r, q) Projection Coordinates 3D Normalization Transformation and Clipping against default cube Normalized Coordinates 3D Viewport Transformation + Depth Range Display Coordinates 2D page 8 4

5 Visualizing the Shadow Mapping Technique Shadow Projection Light s point-of-view Depth Map Vertex Distance Kilgard 2002 SIGGRAPH Course 31, NVIDIA Corporation page 9 Hardware Shadow Map Filtering Example GL_NEAREST: blocky GL_LINEAR: antialiased edges Low shadow map resolution used to heightens filtering artifacts Kilgard 2002 SIGGRAPH Course 31, NVIDIA Corporation page 10 5

6 Combining Projective Texturing & Spotlights Use a spotlight-style projected texture to give shadow maps a spotlight falloff Kilgard 2002 SIGGRAPH Course 31, NVIDIA Corporation page 11 Real Soft Shadows Assarsson & Akenine-Möller 2003 Graphics Hardware, Chalmers University of Technology page 12 6

7 Hard vs. Soft Shadows Two different light source types point source area source umbra penumbra umbra Assarsson & Akenine-Möller 2003 Graphics Hardware, Chalmers University of Technology page 13 Area / Volumetric Lights Give Soft Shadows Real lights have area or volume Thus, soft shadows are more realistic HARD SOFT Assarsson & Akenine-Möller 2003 Graphics Hardware, Chalmers University of Technology page 14 7

8 Real-Time Soft Shadow Volume Algorithm Same Silhouette Edge Assarsson & Akenine-Möller 2003 Graphics Hardware, Chalmers University of Technology page 15 Soft Shadow Wedge Rasterization Assarsson & Akenine-Möller 2003 Graphics Hardware, Chalmers University of Technology page 16 8

9 Example Soft Shadows Varying the size of the light source Assarsson & Akenine-Möller th Eurographics Workshop, Chalmers University of Technology page 17 Soft Shadows for Two Light Sources Assarsson & Akenine-Möller th Eurographics Workshop, Chalmers University of Technology page 18 9

10 Better Approximation Single Area Light Source 2 x 2 Area Light Sourcs 1024 Point Light Sources Single Area 2 x 2 Area 3 x 3 Area 1024 Points Assarsson & Akenine-Möller 2003 Graphics Hardware, Chalmers University of Technology page 19 Programmable Vertex Shader glcolor glortho glloadmatrix Application Program OpenGL State Vertex Shader Primitive Assembly gl_vertex gl_modelviewmatrix gl_projectionmatrix gl_frontcolor gl_position page 20 10

11 Programmable Fragment Shader OpenGL State Application Program vertices Rasterizer fragments Fragment Shader pixels Frame Buffer gl_position gl_frontcolor (per vertex) gl_frontcolor (interpolated) gl_fragmentcolor page 21 Advanced Rendering Ray Tracing Radiosity page 22 11

12 Overview OpenGL is based on a pipeline model in which primitives are rendered one at time No shadows No multiple reflections Except by tricks or multiple renderings Global approaches Ray tracing Radiosity page 23 Lighting Effects S. Narasimhan 2005 Appearance Modeling page 24 12

13 The Cornell Box Physically based rendering: a simple physical environment for which the properties of lighting, geometry, and material reflectance have been measured and their simulation via computers Measured S. Narasimhan 2005 Appearance Modeling Simulated page 25 The Cornell Box Difference image as a simple pixel-by-pixel subtraction of one image from the other Edge effects stem from misregistration between the actual positions and rendered coordinates Measured S. Narasimhan 2005 Appearance Modeling Difference Simulated page 26 13

14 Ray Tracing Ray tracing handles Global reflections and refractions (transmissions) Hidden surface removal Shadows and other special effects Whitted presented the first general recursive ray tracing model in 1980 (Others had used some of the ideas before) page 27 Overview Ray tracing follows specularly reflected and refracted rays through a scene The rays are infinitely thin, so aliasing is a problem Ray tracing can be used as a basic technique for volume rendering Ray tracing is recursive; secondary rays are followed recursively from primary rays page 28 14

15 Tracing Light Rays Follow rays of light from a point source Can account for reflection and refraction translucent surface shadow Angel 2006 Interactive Computer Graphics 4 th Ed. page 29 Computation Should be able to handle all physical interactions Ray tracing paradigm is not computational Most rays do not affect what we see Scattering produces many (infinite) additional rays Alternative: ray casting page 30 15

16 Ray Casting Only rays that reach the eye matter Reverse direction and cast rays Need at least one ray per pixel Center-of-Projection Projection Plane page 31 Ray Casting Quadrics Ray casting has become the standard way to visualize quadrics which are implicit surfaces in CSG systems Constructive Solid Geometry (CSG) Primitives are solids Build objects with set operations Union, intersection, set difference page 32 16

17 Ray Casting a Sphere Ray is parametric P(α) = p + α v Sphere is quadric (x x c ) 2 + (y y c ) 2 + (z z c ) 2 r 2 = 0 Resulting equation is a scalar quadratic equation which gives entry and exit points of ray (or no solution if ray misses) P(α 2 ) v p P(α 1 ) page 33 Basic Ray Tracing Algorithm Fire an eye ray r through the center of a pixel to find the intersection with the closest object A (specular) reflected ray is followed from the intersection A (specular) refracted ray is followed from the intersection To calculate shadows, fire a shadow ray (or shadow feeler) s from the intersection point to each light source Reflection, refraction, and shadow are handled by secondary rays from the point of intersection page 34 17

18 Reflection (Specular) reflection ray is given by r = l 2 n (n l) where n and l are the unit surface normal and unit incident vector hitting the surface Note that l is first an eye ray, then for secondary rays it can be a reflected or refracted ray; its role changes as rays are cast from ray-object intersection points l r page 35 Refraction (Specular) refraction (transmission) ray is given η1 η1 t = [ ( )] η l n cosθ + n l 2 t η2 where η 1 and η 2 are the indices of refraction in the incident and transmitted media (e.g., air and water), and θ t is the angle between the transmitted ray and the negative normal, and cos θ t = 1 η2 η ( ) ( 1 ( n l) ) l r t page 36 18

19 Shadow Rays Even if a point is visible, it will not be lit unless we can see a light source from that point Shadow rays are fired from the intersection point to each light source l s page 37 Ray Trees Each reflection and refraction ray may spawn their own shadow, reflection and refraction rays, recursively generating a ray tree The ray tree can be built to any depth subject to The ray does not hit an object The amount of work (time) we are willing to spend The amount of contributed illumination from the rays l 1 l 2 r r 1 t 1 page 38 19

20 Ray Trees eye r l 1 l 2 r 1 obj 1 t 1 obj 2 r 1 t 1 l 1 obj 3 r r 2 l 2 l 3 obj 4 l 4 page 39 Light Intensity Equation The ray tree is evaluated bottom-up with each node s intensity a function of its children s intensity At each intersection point I = Ilocal + krg I reflected + ktg Itransmitted where I local is the intensity at the intersection k rg is the global reflectivity (between 0 and 1) I reflected is the reflected ray s returned intensity k tg is the global transmissivity (between 0 and 1) I transmitted is the refracted ray s returned intensity The local intensity can be computed from any illumination model, e.g. I local [ k ( n l) + k ( n h) ] α = I aka + I p d s page 40 20

21 Diffuse Surfaces Theoretically the scattering at each point of intersection generates an infinite number of new rays that should be traced In practice, we only trace the transmitted and reflected rays but use the Phong model to compute shade at the point of intersection Consequently, ray tracing works best for specular surfaces Radiosity works best for perfectly diffuse (Lambertian) surfaces page 41 Building a Ray Tracer Best expressed recursively Image based approach For each ray. Find intersection with closest surface Need whole object database available Complexity of calculation limits object types Compute lighting at surface Trace reflected and transmitted rays page 42 21

22 Recursive Ray Tracer Color Trace(Point p, Vector d, int step) { if(step > max) return(background_color) Point q = Intersect(p, d, status) if(status==light) return(light_source_color) if(status==no_inter) return(background_color) Normal n = Normal(q) Vector re = Reflection(q, n) Vector ra = Refraction(q, n) } Color local = Phong(q, n, r) Color reflected = Trace(q, re, step+1) Color refracted = Trace(q, ra, step+1) return(local + reflected + refracted) page 43 Ray Casting For Intersections A basic ray tracer intersects the eye ray with every object in the scene The nearest object hit spawns secondary rays that are also intersected with every object in the scene It has been estimated that 95% of the time in ray tracing is spend on intersection tests Quadric surfaces are often used in ray tracing because ray-quadric surface intersections are easy to compute Spheres (a quadric surface) is often used as a bounding volume Ray-polygon intersections are easy (but expensive for a fine polygon mesh) Ray-box intersections are also fairly easy, and (generalized) boxes make good bounding volumes Intersection tests for bicubic patches, fractals, surfaces of revolutions, and other objects have been developed page 44 22

23 Computing Intersections Sphere Intersection Algebraic Solution Geometric Solution Polygon Intersection page 45 Sphere Intersection - Algebraic Solution 1 Ray-sphere intersection calculations are easy Define a sphere (x x s ) 2 + (y y s ) 2 + (z z s ) 2 = r 2 where c = (x s, y s, z s ) is the center of the sphere and r is the radius Define a ray from the point of projection x = x 0 + x d t y = y 0 + y d t z = z 0 + z d t where p 0 = (x 0, y 0, z 0 ) is the ray s origin and r d = x d, y d, z d is the unit direction vector for the ray page 46 23

24 Sphere Intersection - Algebraic Solution 2 Plug in the parametric line into the sphere equation yields the quadratic equation At 2 + Bt + C = 0 where A = x d2 + y d2 + z 2 d B = 2[x d (x 0 x s ) + y d (y 0 y s ) + z d (z 0 z s )] C = (x 0 x s ) 2 + (y 0 y s ) 2 + (z 0 z s ) 2 r 2 If B 2 4AC < 0, the ray and sphere do not intersect If B 2 4AC < 0, ray grazes sphere If B 2 4AC < 0, the smallest positive t corresponds to the intersection B ± B 2 4AC If the intersection is t± = 2A then the surface normal is n =,, xi xs r yi ys r zi zs r page 47 Sphere Intersection - Geometric Solution 1 A more efficient solution can be determined geometrically Find if the ray s intersection is outside the sphere v 2 (r 0 c r 0 c) = (x s x 0 ) 2 + (y s y 0 ) 2 + (z s z 0 ) 2 r 2 Find the closest approach of the ray to the sphere s center t ca = v cosθ ( r0c r0 c) = v r0c rd = x x, y y, z s 0 s (this assumes x d, y d, z d is a unit vector) 0 s z 0 x, y, z d d d page 48 24

25 Sphere Intersection - Geometric Solution 2 If the ray is outside and points away from the sphere it misses the sphere, that is, if v 2 r 2 and t ca < 0 the sphere is missed If the origin is inside the sphere or t ca 0, find the squared distance from t ca to the sphere s surface This is the half chord distance squared If the ray misses the sphere, it can be negative t hc2 = r 2 (v 2 t ca2 ) If t hc < 0, the ray misses the sphere If t hc 0, then 2 t = t if v 2 r 2 ca t hc and 2 t = t if v 2 < r 2 ca + t hc page 49 Polygon Intersection If p is the plane of the polygon, then n p + d = 0 Let the ray be given by r(t) = r 0 + r d t The intersection of the plane and the ray is at parameter value d + n r t = 0 n r d This calculation requires 12 floating point operations and 3 tests If n r d = 0, the intersection is rejected If t < 0, the intersection is rejected If a closer intersection has been found the intersection is rejected page 50 25

26 Polygon Inside/Outside Testing 1 If the intersection is not rejected, determine if it is inside the polygon The solution presented here is based on triangles, and works for convex polygons A polygon with n vertices can be broken up into n 2 triangles Given a point p, v 0 p = αv 0 v 1 + βv 0 v 2 A point p is inside the triangle (v 0, v 1, v 2 ) if α 0, β 0, and α + β 1 Rewritten as x p x 0 = α(x 1 x 0 ) + β(x 2 x 0 ) y p y 0 = α(y 1 y 0 ) + β(y 2 y 0 ) z p z 0 = α(z 1 z 0 ) + β(z 2 z 0 ) page 51 Polygon Inside/Outside Testing 2 A more general algorithm Reduce dimensionality project polygon and intersection point orthographically onto coordinate plane which yields largest projection Translate polygon so intersection point is at origin Draw ray from origin along positive u axis Count how many times it intersects polygon Even number of intersections outside Odd number of intersections inside page 52 26

27 Efficient Considerations in Ray Tracing Three basic approaches to making ray tracing more efficient are To compute fewer intersections Adaptive depth control and adaptive sampling To compute intersections faster Bounding volume, light buffers, space subdivision To use generalized rays Beams, cones, pencils Adaptive depth control allows the depth of the ray tree to change, getting deeper when the returned intensity is large and more shallow when the returned intensity is small Bounding volumes can be used to quickly discard objects that can not be intersected page 53 Adaptive Depth Control The percentage of a scene that consists of highly reflective and transparent surfaces is, in general, small It is inefficient to trace all rays to a maximum depth The ray tree can be pruned when little intensity will result from the pruned sub-tree Rays are attenuated as they pass through a scene Adaptive depth control uses properties of the materials the ray hits to determine this attenuation Reflected rays are attenuated by the global reflection coefficient k rg Refracted rays are attenuated by the global refraction coefficient k tg page 54 27

28 Bounding Volumes in Ray Tracing Bounding volumes, or extents, or enclosures are the most basic tool for ray tracing acceleration A bounding volume encloses a given object (or objects) It should be easier to compute the ray-bounding volume intersection than the ray-object intersection Using simple bounding volumes substitutes simple intersection checks for more costly ones, but does not decrease the number of intersections The simplicity of the intersection test is not the only criterion; the void area of bounding volume should also be considered page 55 Distributed Ray Tracing Cook, Porter, and Carpenter introduced this concept in 1984 Distributed ray tracing is a Monte Carlo technique that stochastically distributes the direction of rays It supersamples the image, firing more than one type Sampling the reflected ray according to a specular distribution function produces gloss (blurred reflection) Sampling the transmitted ray produces translucency (blurred transparency) Sampling the solid angle of the light source produces penumbras (soft shadows) Sampling the camera lens area produces depth of field (focusing) Sampling in time produces motion blur page 56 28

29 Example Ray Traced Image Turner Whitted 1980 page 57 Radisoity page 58 29

30 Introduction Ray tracing is best with many highly specular sufaces Not characteristic of real scenes Rendering equation describes general shading problem Radiosity solves rendering equation for perfectly diffuse surfaces page 59 Phong Shading Plastic Looking Scene No shadows No object interactions S. Narasimhan 2005 Appearance Modeling page 60 30

31 Ray Tracing Scene does not look realistic enough Is window flush with wall? Where is the corner of the room? Is the carpet and wood supposed to be this dark? S. Narasimhan 2005 Appearance Modeling page 61 Radiosity Indirect lighting affects realism Window has depth Room has a corner Carpet and wood on table is lighter Wall has a shade of pink S. Narasimhan 2005 Appearance Modeling page 62 31

32 Introduction The radiosity method and ray tracing are the two major post-phong approaches to rendering objects Radiosity was introduced to computer graphics in 1984 by a group from Cornell (Goral, Torrance, and Greenberg) Radiosity is a theoretically rigorous method to the diffuse interaction problem in a closed environment Specular reflection is difficult to include Assumes conservation of light energy in a closed environment Assumes all emission and reflection processes are ideal (Lambertian) diffuse page 63 Terminology Energy ~ light (incident, transmitted) Must be conserved Energy flux = luminous flux = power = energy/unit time Measured in lumens Depends on wavelength so we can integrate over spectrum using luminous efficiency curve of sensor Energy density (Φ) = energy flux/unit area page 64 32

33 Terminology Intensity ~ brightness Brightness is perceptual = flux/area-solid angle = power/unit projected area per solid angle Measured in candela Φ = I da dω page 65 Rendering Equation Outgoing light is from two sources Emission Reflection of incoming light Must integrate over all incoming light Integrate over hemisphere Must account for foreshortening of incoming light n l r θ i θ r φ v page 66 33

34 Rendering Equation Rendering equation is an energy balance Energy in = energy out Integrate over hemisphere Fredholm integral equation Cannot be solved analytically in general Various approximations of R bd give standard rendering models Should also add an occlusion term in front of right side to account for other objects blocking light from reaching surface page 67 Conservation of Energy = + Emitted power = self-emitted power + received & reflected power S. Narasimhan 2005 Appearance Modeling page 68 34

35 Rendered Image Angel 2006 Interactive Computer Graphics 4 th Ed. page 69 Patches Angel 2006 Interactive Computer Graphics 4 th Ed. page 70 35

36 Diffuse Interreflections - Radiosity Consider Lambertian surfaces and sources Radiance independent of viewing direction Consider total power leaving per unit area of a surface Can simulate soft shadows and color bleeding from diffuse surfaces Used abundantly in heat transfer literature page 71 Irradiance and Radiosity Irradiance E Power received per unit surface area Units: W/m 2 Radiosity Power per unit area leaving the surface (like irradiance) S. Narasimhan 2005 Appearance Modeling page 72 36

37 Radiosity Radiosity is a global illumination model that assumes all surfaces are diffuse and computes view independent illumination. Radiosity computes the intensity reflected from each small surface region (differential area) equally in all directions (including the eye...). This intensity includes energy emitted by the surface itself and reflected energy from other objects. Following an (expensive) preprocessing to compute radiosity, the model is shaded and can be rendered interactively. J. Huang 2002 Computer Graphics, Ohio State page 73 Basic Definitions Radiosity: (B) Energy per unit area per unit time. Emission: (E) Energy per unit area per unit time that the surface emits itself (e. g., light source). Reflectivity: (ρ) The fraction of light which is reflected from a surface. (0 ρ 1) Form-Factor: (F) The fraction of the light leaving one surface which arrives to another. (0 F 1) J. Huang 2002 Computer Graphics, Ohio State page 74 37

38 The Basic Radiosity Equation We will compute the light emitted from a single differential surface area da i It consists of: 1. Light emitted by da i 2. Light reflected by da i depends on light emitted by other da j, fraction of it reaches da i The fraction depends on the geometric relationship between da i and da j : the form-factor J. Huang 2002 Computer Graphics, Ohio State page 75 Form-Factor F j i = the fraction of power emitted by j, which is received by i Area If i is smaller, it receives less power Orientation If i faces j, it receives more power Distance If i is further away, it receives less power j i S. Narasimhan 2005 Appearance Modeling page 76 38

39 The Basic Radiosity Equation The relationship between a single differential area s radiosity and the radiosities of the rest of the environment: J. Huang 2002 Computer Graphics, Ohio State page 77 The Discrete Radiosity Equation We can t operate in continuous space. We need a finite problem! We divide the surfaces into small discrete areas called patches. We assume that radiosity and emission do no vary across the patch area The radiosity of a patch is then: Or, more conveniently: J. Huang 2002 Computer Graphics, Ohio State page 78 39

40 The Reciprocity Relationship If we had equal sized emitters and receivers, the fraction of energy emitted by one and received by the other would be identical to the fraction of energy going the other way Thus, the form-factors from A i to A j and from A j to A i are related by the ratios of their areas: Thus: The radiosity equation is now: J. Huang 2002 Computer Graphics, Ohio State page 79 Matrix Formulation For an environment of N patches: Because the sum of form-factor along a lines is less then 1, this matrix is diagonally dominant and therefore iterative Gauss-Siedel is guaranteed to (quickly) converge to a solution! J. Huang 2002 Computer Graphics, Ohio State page 80 40

41 The Form-factor The form-factor is purely a function of geometric relationship between patches and thus does not depend on viewer position or surface reflectivity attributes Between differential areas: Between patches: J. Huang 2002 Computer Graphics, Ohio State page 81 Computation Hurdles Computation of the form-factors Solutions: hemicube, elements Solution of the matrix in time O(N 2 ) Solution: progressive shooting J. Huang 2002 Computer Graphics, Ohio State page 82 41

42 Nusselt s Analog The inner integral in the previous double integral represents the form-factor from a differential area to a finite patch. This quantity can also be computed by the fraction of the base of the hemisphere covered by the projection: J. Huang 2002 Computer Graphics, Ohio State page 83 The Hemi-cube Any patch which covers the same projected area on the hemisphere has the same form-factor Any surface can be used to project the patches onto, without changing the form-factor J. Huang 2002 Computer Graphics, Ohio State page 84 42

43 The Hemi-cube Compute the delta form-factor of each grid cells F and store in a table (next slide...) Project all patches onto the hemi-cube screen (use Z- buffer rendering hardware?), drawing a patch-id instead of color Sum the delta form factors of all grid cells covered by the patch s id J. Huang 2002 Computer Graphics, Ohio State page 85 Computing the Delta Form-Factor J. Huang 2002 Computer Graphics, Ohio State page 86 43

44 Problems with the Hemi-cube Because we compute only the inner integral serious inaccuracies can occur if the size of the patch is large relative to the distance Because the hemisphere is divided into discrete solid angles, a number of aliasing problems may occur J. Huang 2002 Computer Graphics, Ohio State page 87 Patches and Elements Patches are used for emitting light Some patches are divided into elements, which are used to more accurately compute the received light after the patch solution have been computed J. Huang 2002 Computer Graphics, Ohio State page 88 44

45 Progressive Radiosity The problem: we need to solve a set of N equations O(N 2 ) time In the conventional radiosity we gather the contribution of other patches to patch i J. Huang 2002 Computer Graphics, Ohio State page 89 Shooting Radiosity Shoot the radiosity of patch i and update the radiosity of all other patches J. Huang 2002 Computer Graphics, Ohio State page 90 45

46 Visual Comparison Assume the scene is displayed after each update: In the row solution (gather), every image will show another element being fully illuminated In the column solution (shoot), every image will show the whole image change due to the contribution by one element. The magnitude of this change depends on the amount of energy B i A i sent out from the shooting patch Therefore, the image will converge faster to the final solution if the patches with highest added energy B i A i shoot first! J. Huang 2002 Computer Graphics, Ohio State page 91 The Total Process Form-Factor Calculation Solution to the System of Equations Input Scene Geometry Reflectance Properties Radiosity Solution Visualization Viewing Conditions Radiosity Image page 92 46

47 Planar Piecewise Constancy Assumption Subdivide scene into small uniform polygons S. Narasimhan 2005 Appearance Modeling page 93 Uniform vs. Adaptive Problem: Texture mapping is equivalent to a uniform mesh subdivision Resolution is too low in some areas, too high in others uniform adaptive Solution: Coarse geometric hierarchical subdivision, followed by finer texture map subdivision G. Coombe, M. Harris, A. Lastra 2004 Radiosity on Graphics Hardware page 94 47

48 Adaptive Subdivision Subdivide geometry using quad-tree Store energy at leaf texture (32x32 resolution) Data structure managed on CPU Calculate subdivision criteria in fragment programs Check for gradient or value discontinuities Occlusion queries get result G. Coombe, M. Harris, A. Lastra 2004 Radiosity on Graphics Hardware page 95 Sample Scene S. Narasimhan 2005 Appearance Modeling page 96 48

49 Sample Scene S. Narasimhan 2005 Appearance Modeling page 97 Sample Scene S. Narasimhan 2005 Appearance Modeling page 98 49

50 Sample Scene S. Narasimhan 2005 Appearance Modeling page 99 Summary Classic radiosity = finite element method Assumptions Diffuse reflectance Usually polygonal surfaces Advantages Soft shadows and indirect lighting View-independent solution Precompute for a set of light sources Useful for walkthroughs page

51 Image vs. Object Space Image space: Ray Tracing Trace backwards from viewer View-dependent calculation Result: rasterized image (pixel by pixel) Object space: Radiosity Assume only diffuse-diffuse interactions View-independent calculation Result 3D model, color for each surface patch Can render with OpenGL page 101 Two Pass Solution First Pass: Diffuse Interreflections View independent, global diffuse illumination computed with radiosity. Second Pass: Specular Interreflections View dependent, global specular illumination computed with ray-tracing. Combine strengths of radiosity and ray-tracing. page

52 Questions? page

Ray Tracing. Shandong University

Ray Tracing. Shandong University Ray Tracing Shandong University Introduction OpenGL is based on a pipeline model in which primitives are rendered one at time - No shadows (except by tricks or multiple renderings) - No multiple reflections

More information

Local vs. Global Illumination & Radiosity

Local vs. Global Illumination & Radiosity Last Time? Local vs. Global Illumination & Radiosity Ray Casting & Ray-Object Intersection Recursive Ray Tracing Distributed Ray Tracing An early application of radiative heat transfer in stables. Reading

More information

Supplement to Lecture 16

Supplement to Lecture 16 Supplement to Lecture 16 Global Illumination: View Dependent CS 354 Computer Graphics http://www.cs.utexas.edu/~bajaj/ Notes and figures from Ed Angel: Interactive Computer Graphics, 6 th Ed., 2012 Addison

More information

Global Rendering. Ingela Nyström 1. Effects needed for realism. The Rendering Equation. Local vs global rendering. Light-material interaction

Global Rendering. Ingela Nyström 1. Effects needed for realism. The Rendering Equation. Local vs global rendering. Light-material interaction Effects needed for realism Global Rendering Computer Graphics 1, Fall 2005 Lecture 7 4th ed.: Ch 6.10, 12.1-12.5 Shadows Reflections (Mirrors) Transparency Interreflections Detail (Textures etc.) Complex

More information

Topic 12: Texture Mapping. Motivation Sources of texture Texture coordinates Bump mapping, mip-mapping & env mapping

Topic 12: Texture Mapping. Motivation Sources of texture Texture coordinates Bump mapping, mip-mapping & env mapping Topic 12: Texture Mapping Motivation Sources of texture Texture coordinates Bump mapping, mip-mapping & env mapping Texture sources: Photographs Texture sources: Procedural Texture sources: Solid textures

More information

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 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

More information

Global Illumination The Game of Light Transport. Jian Huang

Global Illumination The Game of Light Transport. Jian Huang Global Illumination The Game of Light Transport Jian Huang Looking Back Ray-tracing and radiosity both computes global illumination Is there a more general methodology? It s a game of light transport.

More information

Topic 11: Texture Mapping 11/13/2017. Texture sources: Solid textures. Texture sources: Synthesized

Topic 11: Texture Mapping 11/13/2017. Texture sources: Solid textures. Texture sources: Synthesized Topic 11: Texture Mapping Motivation Sources of texture Texture coordinates Bump mapping, mip mapping & env mapping Texture sources: Photographs Texture sources: Procedural Texture sources: Solid textures

More information

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

So far, we have considered only local models of illumination; they only account for incident light coming directly from the light sources. 11 11.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

More information

6. Illumination, Lighting

6. Illumination, Lighting Jorg s Graphics Lecture Notes 6. Illumination, Lighting 1 6. Illumination, Lighting No ray tracing in OpenGL! ray tracing: direct paths COP interreflection: soft shadows, color bleeding. umbra, penumbra,

More information

Topic 11: Texture Mapping 10/21/2015. Photographs. Solid textures. Procedural

Topic 11: Texture Mapping 10/21/2015. Photographs. Solid textures. Procedural Topic 11: Texture Mapping Motivation Sources of texture Texture coordinates Bump mapping, mip mapping & env mapping Topic 11: Photographs Texture Mapping Motivation Sources of texture Texture coordinates

More information

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 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

More information

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 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

More information

The Rendering Equation & Monte Carlo Ray Tracing

The Rendering Equation & Monte Carlo Ray Tracing Last Time? Local Illumination & Monte Carlo Ray Tracing BRDF Ideal Diffuse Reflectance Ideal Specular Reflectance The Phong Model Radiosity Equation/Matrix Calculating the Form Factors Aj Ai Reading for

More information

I have a meeting with Peter Lee and Bob Cosgrove on Wednesday to discuss the future of the cluster. Computer Graphics

I have a meeting with Peter Lee and Bob Cosgrove on Wednesday to discuss the future of the cluster. Computer Graphics Announcements Assignment 4 will be out later today Problem Set 3 is due today or tomorrow by 9am in my mail box (4 th floor NSH) How are the machines working out? I have a meeting with Peter Lee and Bob

More information

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

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

More information

Sung-Eui Yoon ( 윤성의 )

Sung-Eui Yoon ( 윤성의 ) CS380: Computer Graphics Ray Tracing Sung-Eui Yoon ( 윤성의 ) Course URL: http://sglab.kaist.ac.kr/~sungeui/cg/ Class Objectives Understand overall algorithm of recursive ray tracing Ray generations Intersection

More information

Global Illumination. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

Global Illumination. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller Global Illumination CMPT 361 Introduction to Computer Graphics Torsten Möller Reading Foley, van Dam (better): Chapter 16.7-13 Angel: Chapter 5.11, 11.1-11.5 2 Limitation of local illumination A concrete

More information

Computer Graphics Ray Casting. Matthias Teschner

Computer Graphics Ray Casting. Matthias Teschner Computer Graphics Ray Casting Matthias Teschner Outline Context Implicit surfaces Parametric surfaces Combined objects Triangles Axis-aligned boxes Iso-surfaces in grids Summary University of Freiburg

More information

CPSC GLOBAL ILLUMINATION

CPSC GLOBAL ILLUMINATION CPSC 314 21 GLOBAL ILLUMINATION Textbook: 20 UGRAD.CS.UBC.CA/~CS314 Mikhail Bessmeltsev ILLUMINATION MODELS/ALGORITHMS Local illumination - Fast Ignore real physics, approximate the look Interaction of

More information

Lighting. To do. Course Outline. This Lecture. Continue to work on ray programming assignment Start thinking about final project

Lighting. To do. Course Outline. This Lecture. Continue to work on ray programming assignment Start thinking about final project To do Continue to work on ray programming assignment Start thinking about final project Lighting Course Outline 3D Graphics Pipeline Modeling (Creating 3D Geometry) Mesh; modeling; sampling; Interaction

More information

CS770/870 Spring 2017 Radiosity

CS770/870 Spring 2017 Radiosity Preview CS770/870 Spring 2017 Radiosity Indirect light models Brief radiosity overview Radiosity details bidirectional reflectance radiosity equation radiosity approximation Implementation details hemicube

More information

Today. Anti-aliasing Surface Parametrization Soft Shadows Global Illumination. Exercise 2. Path Tracing Radiosity

Today. Anti-aliasing Surface Parametrization Soft Shadows Global Illumination. Exercise 2. Path Tracing Radiosity Today Anti-aliasing Surface Parametrization Soft Shadows Global Illumination Path Tracing Radiosity Exercise 2 Sampling Ray Casting is a form of discrete sampling. Rendered Image: Sampling of the ground

More information

COMP371 COMPUTER GRAPHICS

COMP371 COMPUTER GRAPHICS COMP371 COMPUTER GRAPHICS SESSION 15 RAY TRACING 1 Announcements Programming Assignment 3 out today - overview @ end of the class Ray Tracing 2 Lecture Overview Review of last class Ray Tracing 3 Local

More information

CHAPTER 1 Graphics Systems and Models 3

CHAPTER 1 Graphics Systems and Models 3 ?????? 1 CHAPTER 1 Graphics Systems and Models 3 1.1 Applications of Computer Graphics 4 1.1.1 Display of Information............. 4 1.1.2 Design.................... 5 1.1.3 Simulation and Animation...........

More information

Introduction to Visualization and Computer Graphics

Introduction to Visualization and Computer Graphics Introduction to Visualization and Computer Graphics DH2320, Fall 2015 Prof. Dr. Tino Weinkauf Introduction to Visualization and Computer Graphics Visibility Shading 3D Rendering Geometric Model Color Perspective

More information

CS770/870 Spring 2017 Radiosity

CS770/870 Spring 2017 Radiosity CS770/870 Spring 2017 Radiosity Greenberg, SIGGRAPH 86 Tutorial Spencer, SIGGRAPH 93 Slide Set, siggraph.org/education/materials/hypergraph/radiosity/radiosity.htm Watt, 3D Computer Graphics -- Third Edition,

More information

CS580: Ray Tracing. Sung-Eui Yoon ( 윤성의 ) Course URL:

CS580: Ray Tracing. Sung-Eui Yoon ( 윤성의 ) Course URL: CS580: Ray Tracing Sung-Eui Yoon ( 윤성의 ) Course URL: http://sglab.kaist.ac.kr/~sungeui/gcg/ Recursive Ray Casting Gained popularity in when Turner Whitted (1980) recognized that recursive ray casting could

More information

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

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

More information

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

Computer Graphics. Ray Tracing. Based on slides by Dianna Xu, Bryn Mawr College Computer Graphics Ray Tracing Based on slides by Dianna Xu, Bryn Mawr College Ray Tracing Example Created by Anto Matkovic Ray Tracing Example Ray Tracing Example Ray Tracing Most light rays do not reach

More information

Lecture 15: Shading-I. CITS3003 Graphics & Animation

Lecture 15: Shading-I. CITS3003 Graphics & Animation Lecture 15: Shading-I CITS3003 Graphics & Animation E. Angel and D. Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012 Objectives Learn that with appropriate shading so objects appear as threedimensional

More information

Computer Graphics. Lecture 14 Bump-mapping, Global Illumination (1)

Computer Graphics. Lecture 14 Bump-mapping, Global Illumination (1) Computer Graphics Lecture 14 Bump-mapping, Global Illumination (1) Today - Bump mapping - Displacement mapping - Global Illumination Radiosity Bump Mapping - A method to increase the realism of 3D objects

More information

Local Illumination. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

Local Illumination. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller Local Illumination CMPT 361 Introduction to Computer Graphics Torsten Möller Graphics Pipeline Hardware Modelling Transform Visibility Illumination + Shading Perception, Interaction Color Texture/ Realism

More information

Effects needed for Realism. Computer Graphics (Fall 2008) Ray Tracing. Ray Tracing: History. Outline

Effects needed for Realism. Computer Graphics (Fall 2008) Ray Tracing. Ray Tracing: History. Outline Computer Graphics (Fall 2008) COMS 4160, Lecture 15: Ray Tracing http://www.cs.columbia.edu/~cs4160 Effects needed for Realism (Soft) Shadows Reflections (Mirrors and Glossy) Transparency (Water, Glass)

More information

Global Illumination CS334. Daniel G. Aliaga Department of Computer Science Purdue University

Global Illumination CS334. Daniel G. Aliaga Department of Computer Science Purdue University Global Illumination CS334 Daniel G. Aliaga Department of Computer Science Purdue University Recall: Lighting and Shading Light sources Point light Models an omnidirectional light source (e.g., a bulb)

More information

A Brief Overview of. Global Illumination. Thomas Larsson, Afshin Ameri Mälardalen University

A Brief Overview of. Global Illumination. Thomas Larsson, Afshin Ameri Mälardalen University A Brief Overview of Global Illumination Thomas Larsson, Afshin Ameri Mälardalen University 1 What is Global illumination? Global illumination is a general name for realistic rendering algorithms Global

More information

Effects needed for Realism. Ray Tracing. Ray Tracing: History. Outline. Foundations of Computer Graphics (Spring 2012)

Effects needed for Realism. Ray Tracing. Ray Tracing: History. Outline. Foundations of Computer Graphics (Spring 2012) Foundations of omputer Graphics (Spring 202) S 84, Lecture 5: Ray Tracing http://inst.eecs.berkeley.edu/~cs84 Effects needed for Realism (Soft) Shadows Reflections (Mirrors and Glossy) Transparency (Water,

More information

Motivation. Sampling and Reconstruction of Visual Appearance. Effects needed for Realism. Ray Tracing. Outline

Motivation. Sampling and Reconstruction of Visual Appearance. Effects needed for Realism. Ray Tracing. Outline Sampling and Reconstruction of Visual Appearance CSE 274 [Fall 2018], Special Lecture Ray Tracing Ravi Ramamoorthi http://www.cs.ucsd.edu/~ravir Motivation Ray Tracing is a core aspect of both offline

More information

Introduction Ray tracing basics Advanced topics (shading) Advanced topics (geometry) Graphics 2010/2011, 4th quarter. Lecture 11: Ray tracing

Introduction Ray tracing basics Advanced topics (shading) Advanced topics (geometry) Graphics 2010/2011, 4th quarter. Lecture 11: Ray tracing Lecture 11 Ray tracing Introduction Projection vs. ray tracing Projection Ray tracing Rendering Projection vs. ray tracing Projection Ray tracing Basic methods for image generation Major areas of computer

More information

Recollection. Models Pixels. Model transformation Viewport transformation Clipping Rasterization Texturing + Lights & shadows

Recollection. Models Pixels. Model transformation Viewport transformation Clipping Rasterization Texturing + Lights & shadows Recollection Models Pixels Model transformation Viewport transformation Clipping Rasterization Texturing + Lights & shadows Can be computed in different stages 1 So far we came to Geometry model 3 Surface

More information

MIT Monte-Carlo Ray Tracing. MIT EECS 6.837, Cutler and Durand 1

MIT Monte-Carlo Ray Tracing. MIT EECS 6.837, Cutler and Durand 1 MIT 6.837 Monte-Carlo Ray Tracing MIT EECS 6.837, Cutler and Durand 1 Schedule Review Session: Tuesday November 18 th, 7:30 pm bring lots of questions! Quiz 2: Thursday November 20 th, in class (one weeks

More information

Photorealism: Ray Tracing

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

More information

Reflection and Shading

Reflection and Shading 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

More information

Global Illumination and Radiosity

Global Illumination and Radiosity Global Illumination and Radiosity CS434 Daniel G. Aliaga Department of Computer Science Purdue University Recall: Lighting and Shading Light sources Point light Models an omnidirectional light source (e.g.,

More information

Consider a partially transparent object that is illuminated with two lights, one visible from each side of the object. Start with a ray from the eye

Consider a partially transparent object that is illuminated with two lights, one visible from each side of the object. Start with a ray from the eye Ray Tracing What was the rendering equation? Motivate & list the terms. Relate the rendering equation to forward ray tracing. Why is forward ray tracing not good for image formation? What is the difference

More information

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

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

More information

Virtual Reality for Human Computer Interaction

Virtual Reality for Human Computer Interaction Virtual Reality for Human Computer Interaction Appearance: Lighting Representation of Light and Color Do we need to represent all I! to represent a color C(I)? No we can approximate using a three-color

More information

Deferred Rendering Due: Wednesday November 15 at 10pm

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

More information

Computer Graphics. Illumination and Shading

Computer Graphics. Illumination and Shading () 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

More information

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

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

More information

Schedule. MIT Monte-Carlo Ray Tracing. Radiosity. Review of last week? Limitations of radiosity. Radiosity

Schedule. MIT Monte-Carlo Ray Tracing. Radiosity. Review of last week? Limitations of radiosity. Radiosity Schedule Review Session: Tuesday November 18 th, 7:30 pm, Room 2-136 bring lots of questions! MIT 6.837 Monte-Carlo Ray Tracing Quiz 2: Thursday November 20 th, in class (one weeks from today) MIT EECS

More information

Radiosity. Johns Hopkins Department of Computer Science Course : Rendering Techniques, Professor: Jonathan Cohen

Radiosity. Johns Hopkins Department of Computer Science Course : Rendering Techniques, Professor: Jonathan Cohen Radiosity Radiosity Concept Global computation of diffuse interreflections among scene objects Diffuse lighting changes fairly slowly across a surface Break surfaces up into some number of patches Assume

More information

Intro to Ray-Tracing & Ray-Surface Acceleration

Intro to Ray-Tracing & Ray-Surface Acceleration Lecture 12 & 13: Intro to Ray-Tracing & Ray-Surface Acceleration Computer Graphics and Imaging UC Berkeley Course Roadmap Rasterization Pipeline Core Concepts Sampling Antialiasing Transforms Geometric

More information

Lecture 11: Ray tracing (cont.)

Lecture 11: Ray tracing (cont.) Interactive Computer Graphics Ray tracing - Summary Lecture 11: Ray tracing (cont.) Graphics Lecture 10: Slide 1 Some slides adopted from H. Pfister, Harvard Graphics Lecture 10: Slide 2 Ray tracing -

More information

782 Schedule & Notes

782 Schedule & Notes 782 Schedule & Notes Tentative schedule - subject to change at a moment s notice. This is only a guide and not meant to be a strict schedule of how fast the material will be taught. The order of material

More information

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. 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

More information

CS452/552; EE465/505. Intro to Lighting

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

More information

Ray tracing. EECS 487 March 19,

Ray tracing. EECS 487 March 19, Ray tracing EECS 487 March 19, 2007 http://radsite.lbl.gov/radiance/book/ 1 Conventional pipeline (rasterization) For each triangle Compute lighting at vertices For each pixel within triangle Compute interpolated

More information

Introduction to Radiosity

Introduction to Radiosity Introduction to Radiosity Produce photorealistic pictures using global illumination Mathematical basis from the theory of heat transfer Enables color bleeding Provides view independent representation Unfortunately,

More information

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

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

More information

Illumination & Shading: Part 1

Illumination & Shading: Part 1 Illumination & Shading: Part 1 Light Sources Empirical Illumination Shading Local vs Global Illumination Lecture 10 Comp 236 Spring 2005 Computer Graphics Jargon: Illumination Models Illumination - the

More information

Interactive Methods in Scientific Visualization

Interactive Methods in Scientific Visualization Interactive Methods in Scientific Visualization GPU Volume Raycasting Christof Rezk-Salama University of Siegen, Germany Volume Rendering in a Nutshell Image Plane Eye Data Set Back-to-front iteration

More information

Computer Graphics I Lecture 11

Computer Graphics I Lecture 11 15-462 Computer Graphics I Lecture 11 Midterm Review Assignment 3 Movie Midterm Review Midterm Preview February 26, 2002 Frank Pfenning Carnegie Mellon University http://www.cs.cmu.edu/~fp/courses/graphics/

More information

Topic 9: Lighting & Reflection models. Lighting & reflection The Phong reflection model diffuse component ambient component specular component

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

More information

CS354 Computer Graphics Ray Tracing. Qixing Huang Januray 24th 2017

CS354 Computer Graphics Ray Tracing. Qixing Huang Januray 24th 2017 CS354 Computer Graphics Ray Tracing Qixing Huang Januray 24th 2017 Graphics Pipeline Elements of rendering Object Light Material Camera Geometric optics Modern theories of light treat it as both a wave

More information

Lightscape A Tool for Design, Analysis and Presentation. Architecture Integrated Building Systems

Lightscape A Tool for Design, Analysis and Presentation. Architecture Integrated Building Systems Lightscape A Tool for Design, Analysis and Presentation Architecture 4.411 Integrated Building Systems Lightscape A Tool for Design, Analysis and Presentation Architecture 4.411 Building Technology Laboratory

More information

Pipeline Operations. CS 4620 Lecture 10

Pipeline Operations. CS 4620 Lecture 10 Pipeline Operations CS 4620 Lecture 10 2008 Steve Marschner 1 Hidden surface elimination Goal is to figure out which color to make the pixels based on what s in front of what. Hidden surface elimination

More information

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

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

More information

INFOGR Computer Graphics. J. Bikker - April-July Lecture 10: Shading Models. Welcome!

INFOGR Computer Graphics. J. Bikker - April-July Lecture 10: Shading Models. Welcome! INFOGR Computer Graphics J. Bikker - April-July 2016 - Lecture 10: Shading Models Welcome! Today s Agenda: Introduction Light Transport Materials Sensors Shading INFOGR Lecture 10 Shading Models 3 Introduction

More information

Introduction to Computer Graphics 7. Shading

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

More information

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models Computergrafik Matthias Zwicker Universität Bern Herbst 2009 Today Introduction Local shading models Light sources strategies Compute interaction of light with surfaces Requires simulation of physics Global

More information

CMSC427 Shading Intro. Credit: slides from Dr. Zwicker

CMSC427 Shading Intro. Credit: slides from Dr. Zwicker CMSC427 Shading Intro Credit: slides from Dr. Zwicker 2 Today Shading Introduction Radiometry & BRDFs Local shading models Light sources Shading strategies Shading Compute interaction of light with surfaces

More information

Comp 410/510 Computer Graphics. Spring Shading

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

More information

Visualisatie BMT. Rendering. Arjan Kok

Visualisatie BMT. Rendering. Arjan Kok Visualisatie BMT Rendering Arjan Kok a.j.f.kok@tue.nl 1 Lecture overview Color Rendering Illumination 2 Visualization pipeline Raw Data Data Enrichment/Enhancement Derived Data Visualization Mapping Abstract

More information

CS5620 Intro to Computer Graphics

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

More information

Ray Tracing. Outline. Ray Tracing: History

Ray Tracing. Outline. Ray Tracing: History Foundations of omputer Graphics Online Lecture 9: Ray Tracing 1 History and asic Ray asting Ravi Ramamoorthi Effects needed for Realism (Soft) Shadows Reflections (Mirrors and Glossy) Transparency (Water,

More information

The Traditional Graphics Pipeline

The Traditional Graphics Pipeline Last Time? The Traditional Graphics Pipeline Participating Media Measuring BRDFs 3D Digitizing & Scattering BSSRDFs Monte Carlo Simulation Dipole Approximation Today Ray Casting / Tracing Advantages? Ray

More information

Lighting. Figure 10.1

Lighting. Figure 10.1 We have learned to build three-dimensional graphical models and to display them. However, if you render one of our models, you might be disappointed to see images that look flat and thus fail to show the

More information

Ray Tracing III. Wen-Chieh (Steve) Lin National Chiao-Tung University

Ray Tracing III. Wen-Chieh (Steve) Lin National Chiao-Tung University Ray Tracing III Wen-Chieh (Steve) Lin National Chiao-Tung University Shirley, Fundamentals of Computer Graphics, Chap 10 Doug James CG slides, I-Chen Lin s CG slides Ray-tracing Review For each pixel,

More information

Chapter 7 - Light, Materials, Appearance

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,

More information

Computer Graphics Global Illumination

Computer Graphics Global Illumination Computer Graphics 2016 14. Global Illumination Hongxin Zhang State Key Lab of CAD&CG, Zhejiang University 2017-01-09 Course project - Tomorrow - 3 min presentation - 2 min demo Outline - Shadows - Radiosity

More information

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

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

More information

Interactive Computer Graphics A TOP-DOWN APPROACH WITH SHADER-BASED OPENGL

Interactive Computer Graphics A TOP-DOWN APPROACH WITH SHADER-BASED OPENGL International Edition Interactive Computer Graphics A TOP-DOWN APPROACH WITH SHADER-BASED OPENGL Sixth Edition Edward Angel Dave Shreiner Interactive Computer Graphics: A Top-Down Approach with Shader-Based

More information

CS452/552; EE465/505. Clipping & Scan Conversion

CS452/552; EE465/505. Clipping & Scan Conversion CS452/552; EE465/505 Clipping & Scan Conversion 3-31 15 Outline! From Geometry to Pixels: Overview Clipping (continued) Scan conversion Read: Angel, Chapter 8, 8.1-8.9 Project#1 due: this week Lab4 due:

More information

Other Rendering Techniques CSE 872 Fall Intro You have seen Scanline converter (+z-buffer) Painter s algorithm Radiosity CSE 872 Fall

Other Rendering Techniques CSE 872 Fall Intro You have seen Scanline converter (+z-buffer) Painter s algorithm Radiosity CSE 872 Fall Other Rendering Techniques 1 Intro You have seen Scanline converter (+z-buffer) Painter s algorithm Radiosity 2 Intro Some more Raytracing Light maps Photon-map Reyes Shadow maps Sahdow volumes PRT BSSRF

More information

Simple Lighting/Illumination Models

Simple Lighting/Illumination Models Simple Lighting/Illumination Models Scene rendered using direct lighting only Photograph Scene rendered using a physically-based global illumination model with manual tuning of colors (Frederic Drago and

More information

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

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

More information

Ray Tracing. Kjetil Babington

Ray Tracing. Kjetil Babington Ray Tracing Kjetil Babington 21.10.2011 1 Introduction What is Ray Tracing? Act of tracing a ray through some scene Not necessarily for rendering Rendering with Ray Tracing Ray Tracing is a global illumination

More information

Visual cues to 3D geometry. Light Reflection and Advanced Shading. Shading. Recognizing materials. size (perspective) occlusion shading

Visual cues to 3D geometry. Light Reflection and Advanced Shading. Shading. Recognizing materials. size (perspective) occlusion shading Visual cues to 3D geometry Light Reflection and Advanced Shading size (perspective) occlusion shading CS 4620 Lecture 17 1 2 Shading Recognizing materials Variation in observed color across an object strongly

More information

Topics and things to know about them:

Topics and things to know about them: Practice Final CMSC 427 Distributed Tuesday, December 11, 2007 Review Session, Monday, December 17, 5:00pm, 4424 AV Williams Final: 10:30 AM Wednesday, December 19, 2007 General Guidelines: The final will

More information

Photorealism. Ray Tracing Texture Mapping Radiosity

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

More information

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11 Pipeline Operations CS 4620 Lecture 11 1 Pipeline you are here APPLICATION COMMAND STREAM 3D transformations; shading VERTEX PROCESSING TRANSFORMED GEOMETRY conversion of primitives to pixels RASTERIZATION

More information

Global Illumination. CSCI 420 Computer Graphics Lecture 18. BRDFs Raytracing and Radiosity Subsurface Scattering Photon Mapping [Ch

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

More information

Three-Dimensional Graphics V. Guoying Zhao 1 / 55

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

More information

CS 428: Fall Introduction to. Radiosity. Andrew Nealen, Rutgers, /7/2009 1

CS 428: Fall Introduction to. Radiosity. Andrew Nealen, Rutgers, /7/2009 1 CS 428: Fall 2009 Introduction to Computer Graphics Radiosity 12/7/2009 1 Problems with diffuse lighting A Daylight Experiment, John Ferren 12/7/2009 2 Problems with diffuse lighting 12/7/2009 3 Direct

More information

Raytracing CS148 AS3. Due :59pm PDT

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

More information

Overview. Shading. Shading. Why we need shading. Shading Light-material interactions Phong model Shading polygons Shading in OpenGL

Overview. Shading. Shading. Why we need shading. Shading Light-material interactions Phong model Shading polygons Shading in OpenGL 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.

More information

CSE 167: Lecture #8: GLSL. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

CSE 167: Lecture #8: GLSL. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012 CSE 167: Introduction to Computer Graphics Lecture #8: GLSL Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012 Announcements Homework project #4 due Friday, November 2 nd Introduction:

More information

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

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

More information

Lighting and Reflectance COS 426

Lighting and Reflectance COS 426 ighting and Reflectance COS 426 Ray Casting R2mage *RayCast(R3Scene *scene, int width, int height) { R2mage *image = new R2mage(width, height); for (int i = 0; i < width; i++) { for (int j = 0; j < height;

More information