1 / 25

GR2 Advanced Computer Graphics AGR

GR2 Advanced Computer Graphics AGR. Lecture 15 Radiosity. Review. First a review of the two rendering approaches we have studied: Phong reflection model ray tracing. I(  ) = K a (  )I a (  ) + ( K d (  )( L . N ) + K s ( R . V ) n ) I*(  ) / dist. Phong Reflection Model.

maren
Download Presentation

GR2 Advanced Computer Graphics AGR

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. GR2Advanced Computer GraphicsAGR Lecture 15 Radiosity

  2. Review • First a review of the two rendering approaches we have studied: • Phong reflection model • ray tracing

  3. I() = Ka()Ia() + ( Kd()( L . N ) + Ks( R . V )n ) I*() / dist Phong Reflection Model • This is the most common approach to rendering • objects represented as polygonal faces • intensity of faces calculated by Phong local illumination model • polygons projected to viewplane • Gouraud shading applied with Z buffer to determine visibility

  4. Phong Reflection Model • Strengths • simple and efficient • models ambient, diffuse and specular reflection • Limitations • only considers light incident from a light source, and not inter-object reflections - ie it is a local illumination method (ambient term is approximation to global illumination • empirical rather than theoretical base • objects typically have plastic appearance

  5. Ray Tracing • Ray traced from viewpoint through pixel until first object intersected • Colour calculated as summation of: • local Phong reflection at that point • specularly reflected light from direction of reflection • transmitted light from refraction direction if transparent

  6. Ray Tracing • This is done recursively • Colour of light incoming along reflection direction found by: • tracing ray back until it hits an object • colour of light emitted by object is itself summation of local component, reflected component and transmitted component • and so on

  7. Ray Tracing - Strengths and Weaknesses • Advantages • increased realism through ability to handle inter-object reflection • Disadvantages • much more expensive than local reflection • still empirical • only handles specular inter-object reflection • entire calculation is view-dependent

  8. Radiosity • Based on the physics of heat transfer between surfaces • Developed in 1980s at Cornell University in US (Cohen, Greenberg) • Determine energy balance of light transfer between all surfaces in an enclosed space • equilibrium reached between emission of light and partial absorption of light • Assume surfaces are opaque, are perfect diffuse reflectors and are represented as sets of rectangular patches Ai

  9. Radiosity Examples

  10. Radiosity - Definition • Radiosity defined as: • energy (Bi ) per unit area leaving a surface patch (Ai ) per unit time Bi Ai = Ei Ai + Ri  ( Fj-i Bj Aj) i=1,2,..N j light leaving light emitted light reflected Ei is the light energy emitted by Ai per unit area Ri is the fraction of incident light reflected in all directions Fj-i is the fraction of energy leaving Aj that reaches Ai

  11. Radiosity - Pictorial Definition Form factor Fj-i is fraction of energy leaving Aj that reaches Ai. It is determined by the relative orientation of the patches and distance r between them Aj j r Nj Ni Form factors are hard to calculate! Let’s assume for now we can do it. i Ai Bi Ai = Ei Ai + Ri  (Fj-i Bj Aj) j

  12. Simplifying the Equation Bi Ai = Ei Ai + Ri  (Fj-i Bj Aj) ie Bi Ai = Ei Ai + Ri  (Bj Fj-i Aj) j j There is a reciprocity relationship: Fj-i Aj = Fi-jAi Hence: Bi Ai = Ei Ai + Ri  (Bj Fi-j Ai) j So the radiosity of patch Ai is given by: Bi = Ei + Ri ( Bj Fi-j ) j

  13. B1 = E1 + R1 ( Bj F1-j ) j Creating a System of Equations • We get one equation for each patch • assume we can calculate form factors • then N equations for N unknowns B1,B2,..BN • First equation is: (1-R1F1-1)B1 - (R1F1-2)B2 - (R1F1-3)B3 - .. - (R1F1-N)BN = E1 • ..and we get in all N equations like this. • Generally Fi-i will be zero - why? • Most of the Ei will be zero - why?

  14. Solving the Equations • Equations are solved iteratively - ie a first guess chosen, then repeatedly refined until deemed to converge • Suppose we guess solution as: B1(0), B2(0), .. BN(0) • Rewrite first equation as: B1 = E1 + (R1F1-2)B2 + .. + (R1F1-N)BN • Then we can ‘improve’ estimate of B1 by: B1(1) = E1 + (R1F1-2)B2(0) + .. + (R1F1-N)BN(0) • .. and so on for other Bi

  15. Solving the Equations • This gives an improved estimate: B1(1), B2(1), .. BN(1) and we can continue until the iteration converges. • This is known as the Jacobi iterative method • An improved method is Gauss-Seidel iteration • this always uses best available values • eg B1(1) (rather than B1(0) ) used to calculate B2(1), etc

  16. Rendering • What have we calculated? • The Bi are the intensities of light emanating from each patch • the form factors do not depend on wavelength , but the Ri do • thus Bi depend on , so we need to calculate BiRED, BiGREEN, BiBLUE • We get vertex intensities by averaging the intensities of surrounding faces • Then we can pass to Gouraud renderer code for interpolated shading

  17. Pause at this stage • Number of equations can be very large • Calculation is not view dependent • Only diffuse reflection • We still have not seen how to calculate the form factors! • Their calculation dominates

  18. Form Factors • The calculation of the form factors is unfortunately quite hard • We begin by looking at the form factor between two infinitesimal areas on the patches

  19. Form Factors - Notation Form factor Fdi-dj gives the fraction of energy reaching dAj from dAi. Aj dAj Nj j Ni r i Ai r is distance between elements Ni, Nj are the normals i, j are angles made with normals by line joining elements dAi

  20. Aj dAj Ai dAi Form Factor Calculation : 2D Cross Section View Draw in 2D but imagine this in 3D: * create unit hemisphere with dAi at centre * light emits/reflects equally in all directions from dAi * form factor Fdi-dj is fraction of energy reaching dAj from dAi

  21. Aj dAj dAi Form Factor Calculation : 2D Cross Section View We begin calculation by * projecting dAj onto the surface of the hemisphere (blue) * this resulting area is (cos j / r2 ) dAj Nj j r This gives us the relative area of light energy reaching dAj from dAi

  22. Aj dAj dAi Form Factor Calculation : 2D Cross Section View But we need a measure per unit area of Ai so need to adjust for orientation of Ai This gives a ‘corrected’ area as: ( cos i cos j / r2 ) dAj i

  23. Form Factor Calculation : 2D Cross Section View Total energy comes from integrating over whole hemisphere - this comes to  Hence form factor is given by: Fdi-dj = ( cos i cos j ) / (  r2 )dAj dAi

  24. Aj Ai dAi Form Factor Calculation : 2D Cross Section View Finally we need to sum up for ALL dAj. This means integrating over the whole of the patch: Fdi-j =  (cos i cos j ) /(  r2 ) dAj

  25. Aj Ai dAi Form Factor Calculation Strictly speaking, we should now integrate over all dAi. In practice, we take Fdi-j as representative of Fi-j and this assumption: Fi-j = Fdi-j works OK in practice. However the calculation of the integral  (cos i cos j ) /(  r2 ) dAj is extremely difficult. Next lecture will discuss an approximation.

More Related