Presentation is loading. Please wait.

Presentation is loading. Please wait.

16.1 si31_01 SI31 Advanced Computer Graphics AGR Lecture 16 Radiosity - continued.

Similar presentations


Presentation on theme: "16.1 si31_01 SI31 Advanced Computer Graphics AGR Lecture 16 Radiosity - continued."— Presentation transcript:

1 16.1 si31_01 SI31 Advanced Computer Graphics AGR Lecture 16 Radiosity - continued

2 16.2 si31_01 Calculating Form Factors n The calculation of: is difficult n In practice a hemicube is formed about the centre of the patch - projection on to flat planes is much easier F di-j =  (cos  i cos  j ) /(  r 2 ) dA j

3 16.3 si31_01 Hemicube Continuing our 2D cross section view: AiAi NiNi but imagine this in 3D as a hemicube centred on the centre of A i

4 16.4 si31_01 Hemicube - Pixels Divide the faces of the hemicube into small ‘pixels’ - say 50x50 on top face AiAi NiNi

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

6 16.6 si31_01 Hemicube - Form Factors AiAi NiNi AjAj We compute mini form factors for each pixel - say, F q, for pixel q. These can be pre-computed and stored in a look up table Then we get F i-j as: F i-j =  F q 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 16.7 si31_01 Radiosity - Summary n The basic radiosity method is: 1) decompose the scene into patches A i 2) compute the form factors F i-j using hemicubes 3) solve the radiosity system of equations to get B i for each patch i (for R,G,B) 4) render by feeding the B i values into a Gouraud interpolation renderer n 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 16.8 si31_01 Radiosity - Further Examples Cornell group radiosity image, using progressive refinement approach 30,000 patches

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

10 16.10 si31_01 Radiosity - Analysis n Radiosity algorithm is expensive in computation and storage n For accuracy we need to decompose into many small patches (typically N>1000) n But this means N 2 form factors that need to be computed and stored

11 16.11 si31_01 Progressive Refinement n Aim is to generate sequence of improving images n 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 B 1, B 2, etc so it takes a long time before we calculate B N - even if B N is significant, say a light source

12 16.12 si31_01 Revisit the Basic Algorithm n Basic equation for B i : – B i = E i + R i  B j F i-j for each patch A i – each term of summation is patch j effect on patch i, ie – B i due to B j = R i B j F i-j gathers this gathers radiosity from all the other patches shoot n Different approach is to shoot radiosity from one patch to all other patches

13 16.13 si31_01 Shoot rather than Gather n So now: – B j due to B i = R j B i F j-i for all j – this shoots B i radiosity to each of the other patches in turn n But: different – F j-i for each j requires different hemicube calculation n So: – using reciprocity relationship (F j-i A j = F i-j A i ) – B j due to B i = R j B i F j-i = R j B i F i-j A i /A j for all j same – which uses same hemicube

14 16.14 si31_01 Progressive Refinement Algorithm n Algorithm works as follows: – Set initial radiosities B i and increments  B i to E i – For each patch i do build hemicube, calculate form factors F i-j for each patch j do  Radiosity = R j  B i F i-j A i / A j  B j =  B j +  Radiosity B j = B j +  Radiosity  B i = 0 – Repeat until convergence

15 16.15 si31_01 Radiosity - Further Examples Museum drawn using radiosity by progressive refinement.

16 16.16 si31_01 Progressive Refinement Algorithm - Optimization n Initially the scene will be dark apart from light sources, then gets steadily lighter n For best effect: – start off with simple ambient illumination – at each stage, select patch i for shooting that has highest  B i A i ie greatest unshot radiosity – gradually decrease the ambient term

17 16.17 si31_01 Issues in Radiosity n 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

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

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


Download ppt "16.1 si31_01 SI31 Advanced Computer Graphics AGR Lecture 16 Radiosity - continued."

Similar presentations


Ads by Google