1 / 20

GR2 Advanced Computer Graphics AGR

GR2 Advanced Computer Graphics AGR. Lecture 16 Radiosity - continued. Calculating Form Factors. The calculation of: is difficult In practice a hemicube is formed about the centre of the patch - projection on to flat planes is much easier.

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 16 Radiosity - continued

  2. Calculating Form Factors • The calculation of: is difficult • In practice a hemicube is formed about the centre of the patch - projection on to flat planes is much easier Fdi-j =  (cos i cos j ) /(  r2 ) dAj

  3. Ni Ai Hemicube Continuing our 2D cross section view: but imagine this in 3D as a hemicube centred on the centre of Ai

  4. Ni Ai Hemicube - Pixels Divide the faces of the hemicube into small ‘pixels’ - say 50x50 on top face

  5. Aj Ni Ai Hemicube - Project patch j Project Aj onto the hemicube, noting pixels which are covered. For these pixels, record patch (Aj) and its depth. If two patches project to same pixel, only record nearest since others are invisible to Ai - this is the same idea as z-buffering.

  6. Aj Ni Ai Hemicube - Form Factors We compute mini form factors for each pixel - say, Fq, for pixel q. These can be pre-computed and stored in a look up table Then we get Fi-j as: Fi-j =  Fq where the summation is over all pixels q covered by the projection. See Watt or Foley, van Dam for how to calculate the mini form factors

  7. Radiosity - Summary • The basic radiosity method is: 1) decompose the scene into patches Ai 2) compute the form factors Fi-j using hemicubes 3) solve the radiosity system of equations to get Bi for each patch i (for R,G,B) 4) render by feeding the Bi values into a Gouraud interpolation renderer • Note: • 1) and 2) depend only on geometry • 3) depends on 1) and 2) plus reflection and emission values • 4) depends on 1),2),3) and view

  8. Radiosity - Further Examples Cornell group radiosity image, using progressive refinement approach 30,000 patches

  9. Radiosity - Further Examples Scene from the opera ‘La Boheme’ by the Cornell group.

  10. Radiosity - Further Examples Museum drawn using radiosity by progressive refinement.

  11. Radiosity - Analysis • Radiosity algorithm is expensive in computation and storage • For accuracy we need to decompose into many small patches (typically N>1000) • But this means N2 form factors that need to be computed and stored

  12. Progressive Refinement • Aim is to generate sequence of improving images • Basic algorithm works against this: • large initial start up in generating ALL the form factors (which need to be stored) • during one iteration of Gauss-Seidel, we generate B1, B2, etc so it takes a long time before we calculate BN - even if BN is significant, say a light source

  13. Revisit the Basic Algorithm • Basic equation for Bi: • Bi = Ei + Ri Bj Fi-j for each patch Ai • each term of summation is patch j effect on patch i, ie • Bi due to Bj = Ri Bj Fi-j this gathers radiosity from all the other patches • Different approach is to shoot radiosity from one patch to all other patches

  14. Shoot rather than Gather • So now: • Bj due to Bi = Rj Bi Fj-i for all j • this shoots Bi radiosity to each of the other patches in turn • But: • Fj-i for each j requires different hemicube calculation • So: • using reciprocity relationship (Fj-i Aj = Fi-j Ai) • Bj due to Bi = Rj Bi Fj-i = Rj Bi Fi-j Ai /Aj for all j • which uses same hemicube

  15. Progressive Refinement Algorithm • Algorithm works as follows: • Set initial radiosities Bi and increments Bi to Ei • For each patch i do build hemicube, calculate form factors Fi-j for each patch j do Radiosity = RjBi Fi-j Ai / Aj Bj = Bj + Radiosity Bj = Bj + Radiosity Bi = 0 • Repeat until convergence

  16. Progressive Refinement Algorithm - Optimization • Initially the scene will be dark apart from light sources, then gets steadily lighter • For best effect: • start off with simple ambient illumination • at each stage, select patch i for shooting that has highest BiAi ie greatest unshot radiosity.

  17. Efficient Radiosity • Use shooting method to solve the radiosity equation, where increments are made to patches j from patch i • Choose patch i at each stage to achieve most effect • Add a (decreasing) ambient term in the early stages

  18. Issues in Radiosity • Artefacts in radiosity images occur due to: • approximations in hemicube method • using linear interpolation to reconstruct radiosity function across a patch • using a mesh structure which does not take into account variations in radiosity function

  19. Hemicube Approximations • Hemicube is divided into uniform set of pixels of finite size • … and it is assumed that each patch projects onto ‘whole’ pixels - which is unlikely to be the case • An example of an aliasing effect - cf jagged lines in line drawing in 2D graphics

  20. Interpolation of Radiosity Function • Situation analogous to Gouraud shading… • … reflectance calculation assumes radiosity constant over patch • … radiosity at vertices found by averaging • … internal radiosity within patch found by linear interpolations • … causing Mach banding due to discontinuities of radiosity gradient

More Related