CS 376 Introduction to Computer Graphics 04 / 16 / 2007 Instructor: Michael Eckmann.

Slides:



Advertisements
Similar presentations
SI31 Advanced Computer Graphics AGR
Advertisements

Computer graphics & visualization Global Illumination Effects.
Computer Graphics In4/MSc Computer Graphics Lecture Notes #15 Illumination III View Independent Rendering.
Shadow Rendering Techniques A point is in the shadow of a light source if it can not be “seen” by the light source, i.e. the line segment that connects.
Modeling the Interaction of Light Between Diffuse Surfaces Cindy M. Goral, Keenth E. Torrance, Donald P. Greenberg and Bennett Battaile Presented by: Chris.
Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.
Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.
Illumination Model & Surface-rendering Method 박 경 와.
Course Website: Computer Graphics 18: Ray-tracing.
Computer Graphics - Class 10
CS 325 Introduction to Computer Graphics 04 / 09 / 2010 Instructor: Michael Eckmann.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Alla Sheffer Advanced Rendering Week.
CS 376 Introduction to Computer Graphics 04 / 09 / 2007 Instructor: Michael Eckmann.
Rendering theory & practice. Introduction  We’ve looked at modelling, surfacing and animating.  The final stage is rendering.  This can be the most.
Advanced Computer Graphics (Fall 2010) CS 283, Lecture 10: Global Illumination Ravi Ramamoorthi Some images courtesy.
Parallelizing Raytracing Gillian Smith CMPE 220 February 19 th, 2008.
CSCE 641 Computer Graphics: Radiosity Jinxiang Chai.
CS 376 Introduction to Computer Graphics 03 / 26 / 2007 Instructor: Michael Eckmann.
CS 376 Introduction to Computer Graphics 04 / 06 / 2007 Instructor: Michael Eckmann.
1 7M836 Animation & Rendering Global illumination, ray tracing Arjan Kok
CIS 310: Visual Programming, Spring 2006 Western State College 310: Visual Programming Ray Tracing.
Foundations of Computer Graphics (Spring 2010) CS 184, Lecture 21: Radiosity
CS 376 Introduction to Computer Graphics 04 / 04 / 2007 Instructor: Michael Eckmann.
CSCE 641 Computer Graphics: Radiosity Jinxiang Chai.
CSCE 441 Computer Graphics: Radiosity Jinxiang Chai.
CSC418 Computer Graphics n Raytracing n Shadows n Global Illumination.
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 Radiosity What we can do with scan line conversion and ray tracing What we can’t do Radiosity.
12/05/02(c) 2002 University of Wisconsin Last Time Subdivision techniques for modeling Very brief intro to global illumination.
Reflections Specular reflection is the perfect reflection of light from a surface. The law a reflection states that the direction of the incoming ray and.
CS 376 Introduction to Computer Graphics 04 / 11 / 2007 Instructor: Michael Eckmann.
-Global Illumination Techniques
CS 325 Introduction to Computer Graphics 04 / 26 / 2010 Instructor: Michael Eckmann.
CS447/ Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
Week 10 - Wednesday.  What did we talk about last time?  Shadow volumes and shadow mapping  Ambient occlusion.
CS 325 Introduction to Computer Graphics 03 / 24 / 2010 Instructor: Michael Eckmann.
Graphics Lecture 13: Slide 1 Interactive Computer Graphics Lecture 13: Radiosity - Principles.
Introduction to Radiosity Geometry Group Discussion Session Jiajian (John) Chen 9/10/2007.
111/17/ :21 Graphics II Global Rendering and Radiosity Session 9.
CS 325 Introduction to Computer Graphics 04 / 14 / 2010 Instructor: Michael Eckmann.
Radiosity Jian Huang, CS594, Fall 2002 This set of slides reference the text book and slides used at Ohio State.
DPL11/27/2015 CS 551/651: Radiosity David Luebke
04/30/02(c) 2002 University of Wisconsin Last Time Subdivision techniques for modeling We are now all done with modeling, the standard hardware pipeline.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Global Illumination: Radiosity, Photon Mapping & Path Tracing Rama Hoetzlein, 2009 Lecture Notes Cornell University.
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.
Monte-Carlo Ray Tracing and
CS 325 Introduction to Computer Graphics 04 / 12 / 2010 Instructor: Michael Eckmann.
CS 376 Introduction to Computer Graphics 04 / 02 / 2007 Instructor: Michael Eckmann.
CSCE 441: Computer Graphics Ray Tracing
In the name of God Computer Graphics. Last Time Some techniques for modeling Today Global illumination and raytracing.
Illumination and Shading Prof. Lizhuang Ma Shanghai Jiao Tong University.
CS 445 / 645 Introduction to Computer Graphics Lecture 16 Radiosity Radiosity.
Render methods. Contents Levels of rendering Wireframe Plain shadow Gouraud Phong Comparison Gouraud-Phong.
02/07/03© 2003 University of Wisconsin Last Time Finite element approach Two-pass approaches.
CS 325 Introduction to Computer Graphics 04 / 07 / 2010 Instructor: Michael Eckmann.
CS552: Computer Graphics Lecture 33: Illumination and Shading.
CS 376 Introduction to Computer Graphics 04 / 13 / 2007 Instructor: Michael Eckmann.
CS 376 Introduction to Computer Graphics 04 / 18 / 2007 Instructor: Michael Eckmann.
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
Computer Graphics: Illumination
Illumination and Shading Prof. Lizhuang Ma Shanghai Jiao Tong University.
© University of Wisconsin, CS559 Spring 2004
Shading Revisited Some applications are intended to produce pictures that look photorealistic, or close to it The image should look like a photograph A.
Global Illumination: Radiosity, Photon Mapping & Path Tracing
CSCE 441 Computer Graphics: Radiosity
Illumination and Shading
CS 480/680 Computer Graphics Shading.
Advanced Computer Graphics: Radiosity
Presentation transcript:

CS 376 Introduction to Computer Graphics 04 / 16 / 2007 Instructor: Michael Eckmann

Michael Eckmann - Skidmore College - CS Spring 2007 Today’s Topics Questions? bump mapping radiosity reducing ray-object intersection calculations

Limitation of texture and environment mapping One could create a texture map/environment map of the look of a bumpy surface and then use that to color an object. But what's a limitation of these methods –what if lighting in the scene changes? –what if the viewpoint changes?

Bump mapping Texture mapping and environment mapping cannot handle the view dependent & lighting dependent nature of shadows and other effects that are seen on surfaces that are bumpy like raisins, oranges, etc. To achieve details based on lighting calculations, bump mapping can be used. Bump mapping takes a simple smooth mathematical surface like a sphere or other curved surface as its model, but renders it so that it does not appear smooth --- before the lighting calculations are done, the surface normals are perturbed across the surface. The normal at a particular surface point is the key to lighting that point of the surface. Therefore, changing the surface normals causes the surface to be rendered as not smooth.

Bump mapping The sphere or other mathematically described parametric surface that we are rendering will be defined as a function P(u,v), where u and v are the parameters and P(u,v) the positions on the surface. The actual normal (before bump mapping) of a point on the surface at P(u,v) can be calculated as the cross product of the vectors representing the slopes in the u and v directions. The slopes are the partial derivatives of P with respect to u and v (the parameters.) I'll draw a picture on the board for this (unfortunately there is no diagram in the book to describe this). Notation: P u is the partial derivative of P with respect to u P v is the partial derivative of P with respect to v the normal N is: N = P u x P v

Bump mapping N = P u x P v n = N / |N| make n a unit vector We use a bump function B(u,v) that generates relatively small values that will be added to our points from P(u,v). We compute a perturbed normal for the point by first –adding B(u,v) to P in the direction of n to get P' P'(u,v) = P(u,v) + B(u,v) n –then compute N' (which is the normal at P') to be N' = P' u x P' v –now we have to figure out what P' u and P' v are Note: the use here of the ' is NOT notation for derivative.

Bump mapping We know that P'(u,v) = P(u,v) + B(u,v) n so, P' u = partial derivative with respect to u of (P + B n) which is P u + B u n + Bn u and, P' v = partial derivative with respect to v of (P + B n) which is P v + B v n + Bn v we assume that the magnitude of B is small so we can ignore the last term in both equations to get approximations like: P' u = P u + B u n and P' v = P v + B v n

Bump mapping We need to calculate N' = P' u x P' v so, N' = ( P u + B u n ) x ( P v + B v n ) which after we do the math is (P u x P v ) + B v (P u x n) + B u (n x P v ) + B u B v (n x n) n x n = 0, so we get a good approximation for N' to be (P u x P v ) + B v (P u x n) + B u (n x P v ) then we should normalize (make unit magnitude) the N'

Bump mapping Now that we have the N' (the perturbed normal) at the point, what do we do?

RayTracing / Radiosity Ray Tracing is a type of direct llumination method in image space. Direct illumination in image space because the scene that we're rendering is made up of surfaces and lights and we compute the colors of the pixels one at a time. –If the view moves --- have to ray trace again –If the world moves --- have to ray trace again Ray tracing results in some realism but with a few drawbacks + Handles both diffuse and specular reflections as well as refractions –Compute intensive –Shadows are too crisp Radiosity is a type of global illumination method that works in object space. + If the view moves, we DO NOT have to rerun the radiosity algorithm = view independent –Only diffuse, no specular reflection (therefore no mirrorlike surfaces) + Shadows are softer, more realistic +/- Color bleeds from surfaces to nearby surfaces Radiosity and Ray tracing can be combined to produce a more realistic image than either one separately.

Radiosity What follows is an overview of radiosity We won't go into as much detail as ray tracing I can point you to some sources if you wish to learn more about radiosity

Radiosity Light reflects off of surfaces and onto other surfaces. The amount of reflected light that hits a surface is determined by –how much it is attenuated and –how much is absorbed before reflection. When some light is reflected off of surface S the color of the surface S colors that reflected light to some extent. This reflected light then hits other surface(s). This effect causes color bleeding from one surface to another. Example image of radiosity “color bleeding”. Radiosity is a method of rendering a scene by considering the global illumination of the scene (as opposed to the way ray tracing does it) –scene is divided into patches (generally the smaller the better) –a patch will emit (if it's a light source) and reflect light uniformly over its surface

Radiosity Radiosity assumes –surfaces are diffuse emitters and diffuse reflectors –the emitting and reflecting is done uniformly over a “patch” –all light energy in the scene will be conserved --- either absorbed or reflected The radiosity of a surface is computed to be the sum of the light energy emitted (if a light source) and the (incident) light energy hitting the surface (coming from elsewhere). Attenuation is taken care of by –Form Factors (which represents the fraction of the light that is transferred from one surface to another) and –Reflectivity values (which represents the fraction of the light that is reflected from a surface)

Radiosity The Form Factor (the fraction of light that arrives at one surface from another) is computed based on –areas of the 2 surfaces involved –angles between the light travelling from one surface to the other and the surface normals –see text if you would like details A form factor is defined between all directed pairs of patches. F jk is the form factor from patch j to k it is the light energy incident on patch k divided by the total light energy leaving patch j

Radiosity The radiosity equation for a patch k, in a scene with n patches is: B k = E k + p k * Sum n j=1 [ B j F jk ] B k is the radiosity of patch k E k is the light emitted from patch k p k is the reflectivity fraction for patch k (the fraction of incident light that is reflected in all directions) F jk is the form factor from patch j to k

Radiosity For all n patches in the scene you have a radiosity equation that is based on the radiosity of all the n patches. To compute the radiosities you have to solve the n simultaneous equations. –Techniques exist to solve a system of simultaneous equations so not to worry, but it could be expensive The more patches we have the longer the radiosity calculations take, but the prettier our pictures will look (up to some point where reducing the size of our patches will not have any noticeable effect on the picture). Radiosity is compute intensive but the surfaces can have their radiosities precomputed if the world does not change. The radiosities are view independent. Therefore the radiosity of each patch can be precomputed and stored with the patch.

RayTracing / Radiosity Revisit the comparison Ray tracing results in some realism but with a few drawbacks + Handles both diffuse and specular reflections as well as refractions –Compute intensive –Shadows are too crisp –If the viewer moves --- have to ray trace again –If the world moves --- have to ray trace again Radiosity is a type of global illumination method that works in object space. + If the view moves, we DO NOT have to rerun the radiosity algorithm = view independent –Only diffuse, no specular reflection (therefore no mirrorlike surfaces) + Shadows are softer, more realistic + Color bleeds from surfaces to nearby surfaces (diffuse-diffuse reflections)

RayTracing / Radiosity Radiosity and Ray tracing can be combined to produce a more realistic image than either one separately. Radiosity algorithm would execute on the first pass and store the output with the surfaces. Then do Ray Tracing next based on viewer position. If the viewer position changes, but the world stays constant, radiosity does NOT need to be rerun (therefore we can precompute the radiosity of a scene.) However, radiosity would need to be rerun if the world changes in any way (e.g. lights move, objects move, etc.)

Reducing Intersection calcs Let's return to ray tracing for a minute Our text says that ray-object intersection calculations can make up up-to 95% of the processing time of the ray tracer. Reducing this would obviously be worth the effort.

Reducing Intersection calcs enclose objects that are near each other within a bounding volume (e.g. a sphere, a cube, etc.) do this for all the clusters of objects that are in your world then when testing for ray object intersections, first determine which bounding volumes the ray intersects with then only among the objects in those bounding volumes that the ray intersects with do we try to compute the ray- object intersection –all the objects in all the bounding volumes that do not intersect the ray can be ignored picture on the board

Reducing Intersection calcs Space subdivision methods –picture the world in a large cube which is subdivided into smaller cubes cubes that contain surfaces can be subdivided into 8 smaller cubes can do this until you get some programmer-defined maximum numbers of allowable surfaces inside a cube –can store these cubes in a binary partition tree –shoot a ray and find out which small cube it first intersects with if the cube doesn't contain any surfaces continue down the ray to find the next cube it hits and so on if there are surface(s) inside the cube determine if there's an intersection if so, that's the one we use; if not, continue with next cube... picture on the board

Reducing Intersection calcs smaller maximum number of surfaces per cube implies less ray-object intersection calculations however, this leads to an increase in the number of cubes which increases the calculation to determine the ray path through the cubes