Computer Graphics as Virtual Photography real camera photo Photographic Photography: scene (captures processing print Radiosity light) processing camera Computer 3D synthetic tone model Graphics: models image reproduction (focuses simulated lighting) Don Greenberg Michael Cohen Assignments Projects • Project feedback • Checkpoint 5 • Approx 22 projects – Due today • Listing of projects now on Web • Checkpoint 6 • Presentation schedule – To be given today – Presentations (15 min max) • RenderMan – Last 3 classes (week 10 + finals week) – Due Nov 3rd – Sign up • Email me with 1 st , 2 nd , 3 rd choices • First come first served. Today’s Class - Radiosity ..but first • Basics • A video overview • The Radiosity Equation • Form Factors – What they are – The hemicube solution • Solving the Radiosity Equation • Rendering • Generating Meshes 1
Radiosity - Basics Radiosity - Basics • Based on thermal engineering models for • Ray tracing – Great for specular type reflections emission and reflection of radiation – Handles hidden surface calculations • Assumes the conservation of light energy in a – Doesn’t handle diffuse (inter-)reflections. closed system, i.e., that steady state can be – View dependent reached • Radiosity – Gorel, Torrance, et al. from Cornell! • Assumes that all surfaces are perfectly diffuse – More accurate solution to ambient light • To get radiant exitance at each point, a VERY – Not as elegant as ray tracing large system of linear equations must be solved – More physically-based Radiosity - Basics Radiosity - Basics • Radiant exitance - radiant flux out (misnamed • First determine all light interactions in an radiosity by CGers) environment in a view independent way. • Then create image using calculated radiant Φ d = exitance values in a standard rendering M process. dA – i.e., radiosity defines a “made to fit” texture dA mapping Radiosity - Basics Radiosity - Basics • Program Flow • View dependence vs view independence – Radiosity provides a view independent solution – Then rendered from a given view point. • Not points -- But patches – Scene is subdivided into patches – Radiant exitance is calculated for each patch [Sillion,35] 2
Radiosity - Basics Radiosity - Basic Idea • Patches • Each patch has two values associated with it: – Its illumination (how brightly lit) – Its surplus energy (radiant energy) • Each patch will receive light from the environment • It will reflect a fraction back [Ashdown,7] • Keep track of amount of light reflected back and where it went to • Continue until all light has been distributed. The Radiosity Equation Radiosity - Key Idea n ∑ = + ρ M M M F i oi i j ij = j 1 exitance init flux out reflectanc e • Since all objects are perfectly diffuse, can light from other surfaces determine where light distribution by simply • For each patch i , the M i is the radiant exitance considering the geometry of the scene. of that patch. • Closed form solution • All surfaces are perfectly diffuse, i.e. reflectivity is equal in all directions • Calculation of radiant exitance per patch is – Reflectance for each patch is a constant ρ i given by the radiosity equation. – ρ i can be wavelength dependent. ∑ n = + ρ • Geometry term F i,j indicates the fraction of M M M F i oi i j ij flux leaving patch i and arriving at patch j . = 1 j exitance init flux out reflectanc e light from other surfaces Radiosity Equation Radiosity System of Equations • Radiosity vs Rendering Equation • Rearrange terms [ ] n ∑ = + ρ ∫ ′ ′ ′ ′ ′ ′ ′ ′ ′ ′ ′ = ε + ρ M M M F I ( x , x ) g ( x , x ) ( x , x ) ( x , x , x ) I ( x , x ) d x i oi i j ij S = j 1 n n ∑ ∑ = + ρ = − ρ M M M F M M M F i oi i j ij oi i i j ij = j 1 = exitance init flux out reflectanc e 1 j light from other surfaces 3
Radiosity System of Equations Radiosity System of Equations • Expand the terms • Put into matrix form = − ρ + ρ + + ρ … − ρ − ρ … − ρ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ M M ( M F M F M F ) M 1 F F F M o 1 1 1 1 11 1 2 12 n n 1 n o 1 1 11 1 12 1 1 n 1 ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ = − ρ + ρ + + ρ − ρ − ρ … − ρ … M F 1 F F M M M ( M F M F M F ) ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ = o 2 2 21 2 22 2 2 n 2 o 2 2 2 2 21 2 2 22 n n 2 n ⎢ … ⎥ ⎢ … … … … ⎥ ⎢ … ⎥ … ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ − ρ − ρ … − ρ ⎣ ⎦ ⎣ ⎦ ⎣ ⎦ M F F 1 F M = − ρ + ρ + + ρ … on n n 1 n n 2 n nn n M M ( M F M F M F ) 1 1 2 2 on n n n n n n n nn Radiosity - Form Factors Radiosity System of Equations • Put in matrix notation • Form factors are based solely on geometry: = ( − M o I T ) M – Given the radiant exitance of a patch E i , what known fraction of it is received by another patch E j ? M o = initial n x 1 exitance vector – Remember: All patches are Lambertian surfaces and Trying to find I = n x n identity matrix distribute flux (radiant exitance) equally in all M = final n x 1 exitance vector directions. T = n x n matrix whose i,j element is ρ i F ij Still Need Radiosity - Form Factor Radiosity - Form Factor Note: •r is distance • Notice that between surfaces – Area of patches must be relatively small • φ i & φ I relative compared to distances between them orientations – Full visibility between patches is assumed •dA i & dA I relative areas – Patches are not points nor are they differential •cos φ i cos φ I areas differential angle [0,1] – Must in the end integrate over each patch. •bigger φ i & φ I mean smaller F ij Note: A’s and dA’s in this slide are denoted by E’s on other slides! 4
Radiosity - Form Factors Radiosity - Form Factor • Integration over patches (here dE is same as dA in • The final expression! H ij previous slide) θ θ cos cos 1 ∫ ∫ = i j F dA dA π ij i j 2 A r i A A i j Remember we assumed all patches could get to all others, the H ij term, if added, is the visibility factor [Ashdown, 43] Radiosity - Form Factors Radiosity - Form Factor Facts • Solution first developed in 1760 by Lambert • So how do we solve this thing? – There is an analytic solution. But it is very • A i F ij = A j F ji - Useful to find pairs of form factors ugly and impractical (note: discovered in 1993) • Form factor calculation assumes a nonparticipating – Classic solution: The Hemicube method medium (like air or vacuum) n n ∑ ∑ = F 1 ij = = i 1 j 1 Radiosity - Nusselt’s Analogy Radiosity - Form Factors • Computing F dEi-Ej is equivalent to Nusselt’s Analogy • Project E j onto plane – Projecting those parts of E j that are visible from of surface of a dE i onto a unit hemisphere centered about dE i hemisphere – Then, projecting this projected area • Form factor is a orthogonally onto the base of the hemispheres fraction of the – Finally, dividing by the area, i.e.., F dEi-Ej = projected surface A/ π area with respect to this projected area, i.e.., F dEi-Ej = A/ π [Ashdown, 273] 5
Radiosity - Form Factors Radiosity - Form Factors - Hemicube • Note from Nusselt’s Analogy that patches E j and E k • Image precision projections have the same form factor from patch dE i • Replace hemisphere with hemicube. • Hemicube is divided into equal sized square cells. • Can determine form factor for each cell (delta form factors). • The form factor for a patch is the sum of delta form factors for cells that the projection of the patch covers. [Ashdown, 275] Hemicube and Nusselt’s Analogy Radiosity - Form Factors - Hemicube • Why the hemicube works • Hemicube - Imagine that dE i represents a pinhole camera; hemicube is what it sees. [Watt&Watt, 278] [Ashdown, 276] Radiosity - Form Factors - Hemicube Radiosity - Form Factors - Hemicube • Hemicube - Delta Form Factors • Need a hemicube for each dE i – Gives an approximation of form factor for a • Stores patch ids of closest intersection patch cell on the hemicube. and contains precomputed delta form factors • Shooting light from source patch to destination θ θ cos cos ≈ ∆ i j through hemicube F A − π dE E j 2 i j r • Scale amount of shooter’s radiative energy by delta form factor associated with hemicube 6
Recommend
More recommend