radiosity by liuqingyan

VIEWS: 23 PAGES: 39

									       CSc4820/6820
Computer Graphics Algorithms

          Ying Zhu
   Georgia State University

       Radiosity
                      Outline
• What is radiosity?
• Radiosity process
  – Form factor
  – Solve radiosity
• Advantages and limitations of radiosity




                                            2
              Background
• Radiosity method is based on the theory of
  thermal heat transfer.
• Heat transfer theory describes radiation as
  the transfer of energy from a surface when
  that surface has been thermally excited.
• This thermal radiation theory can be used
  to describe the transfer of many kinds of
  energy between surfaces, including light
  energy.
                                            3
           What is radiosity?
• The radiosity of a surface is the rate at which
  energy leaves that surface (energy per unit time
  per unit area).
• It includes the energy emitted by a surface as
  well as the energy reflected from other surfaces.
• Radiosity methods allow the intensity of radiant
  energy arriving at a surface to be computed.
• These intensities can then be used to determine
  the shading of the surface.
• In graphics, the term “radiosity” refers to the
  rendering algorithm that models the lighting
  process as energy transfer

                                                      4
            Radiosity Process
• Process
  – Group mesh surface into patches
  – Calculate form factors for patches
  – Solve radiosity
  – Display patches




                                         5
         The Radiosity Equation
• The "radiosity equation" describes the amount of energy
  which can be emitted from a surface, as the sum of the
  energy inherent in the surface (a light source, for
  example) and the energy which strikes the surface,
  being emitted from some other surface.
• The energy which leaves a surface (surface "j") and
  strikes another surface (surface "i") is attenuated by two
  factors:
   – the "form factor" between surfaces "i" and "j", which accounts for
     the physical relationship between the two surfaces
   – the reflectivity of surface "i", which will absorb a certain
     percentage of light energy which strikes the surface.




                                                                      6
The Radiosity Equation




                         7
               Form Factor
• The "form factor" describes the fraction of
  energy which leaves one surface and arrives at
  a second surface.
• It takes into account the distance between the
  surfaces, computed as the distance between the
  center of each of the surfaces.
• It also takes into account their orientation in
  space relative to each other, computed as the
  angle between each surface's normal vector and
  a vector drawn from the center of one surface to
  the center of the other surface.

                                                 8
              Form Factor
• To use this form factor with surfaces which
  have a positive area, the equation must be
  integrated over one or both surface areas.
• The form factor between a point on one
  surface and another surface with positive
  area can be used if the assumption is
  made that the single point is
  representative of all of the points on the
  surface.

                                            9
The Form Factor




                  10
             The Nusselt Analog
• Differentiation of the basic form factor equation is difficult
  even for simple surfaces.
• Nusselt developed a geometric analog which allows the
  simple and accurate calculation of the form factor
  between a surface and a point on a second surface.
• The "Nusselt analog" involves placing a hemispherical
  projection body, with unit radius, at a point on a surface.
• The second surface is spherically projected onto the
  projection body, then cylindrically projected onto the
  base of the hemisphere.
• The form factor is, then, the area projected on the base
  of the hemisphere divided by the area of the base of the
  hemisphere.

                                                              11
The Nusselt Analog




                     12
   The Hemicube Approximation
• In the "hemicube" form factor calculation, the center of a
  cube is placed at a point on a surface
• The upper half of the cube is used as a projection body
  as defined by the "Nusselt analog."
• Each face of the hemicube is subdivided into a set of
  small, usually square ("discrete") areas, each of which
  has a pre-computed form factor value.
• When a surface is projected onto the hemicube, the sum
  of the form factor values of the discrete areas of the
  hemicube faces which are covered by the projection of
  the surface is the form factor between the point on the
  first surface (about which the cube is placed) and the
  second surface (the one which was projected).



                                                           13
    The Hemicube Approximation

• The speed and
  accuracy of this
  method of form
  factor calculation
  can be affected
  by changing the
  size and number
  of discrete areas
  on the faces of
  the hemicube.


                                 14
       The Hemicube Anolog
• This illustration demonstrates the
  calculation of form factors between a
  particular surface on the wall of a room
  and several surfaces of objects in the
  room.




                                             15
          The Hemicube Anolog
• A radiosity algorithm will compute the form factors from a
  point on a surface to all other surfaces, by projecting all
  other surfaces onto the hemicube and storing, at each
  discrete area, the identifying index of the surface that is
  closest to the point.
• When all surfaces have been projected onto the
  hemicube, the discrete areas contain the indices of the
  surfaces which are ultimately visible to the point.
• From there the form factors between the point and the
  surfaces are calculated.
• For greater accuracy, a large surface would typically be
  broken into a set of small surfaces before any form factor
  calculation is performed.



                                                           16
Radiosity form factor learniing tools
• Brown University Exploratories project:
  – http://www.cs.brown.edu/exploratories/freeSof
    tware/catalogs/lighting_and_shading.html
• Radiosity Form Factor:
  – This applet shows how the form factor
    between two patches varies in magnitude
    depending on the relative geometry of the
    patches.



                                                17
 The Full Matrix Radiosity Algorithm
• Two classes of radiosity algorithms have been
  developed which will calculate the energy
  equilibrium solution in an environment.
• The "full matrix" radiosity solution calculates the
  form factors between each pair of surfaces in the
  environment, then forms a series of
  simultaneous linear equations.
• This matrix equation is solved for the "B" values,
  which can be used as the final intensity (or color)
  value of each surface.


                                                   18
The Full Matrix Radiosity Algorithm




                                  19
 The Full Matrix Radiosity Algorithm
• This method produces a complete solution, at
  the substantial cost of first calculating form
  factors between each pair of surfaces and then
  the solution of the matrix equation.
• Each of these steps can be quite expensive if
  the number of surfaces is large
   – complex environments typically have upwards of ten
     thousand surfaces, and environments with one million
     surfaces are not uncommon.
• This leads to substantial costs not only in
  computation time but in storage.

                                                       20
The Progressive Radiosity Algorithm
• The "progressive" radiosity solution is an
  incremental method, yielding intermediate
  results at much lower computation and storage
  costs.
• Each iteration of the algorithm requires the
  calculation of form factors between a point on a
  single surface and all other surfaces, rather than
  all N-squared form factors (where "N" is the
  number of surfaces in the environment).
• After the form factor calculation, radiosity values
  for the surfaces of the environment are updated.

                                                    21
The Progressive Radiosity Algorithm
• This method will eventually produce the
  same complete solution as the "full matrix"
  method, though, unlike the "full matrix"
  method, it will also produce intermediate
  results, each more accurate than the last.
• It can be halted when the desired
  approximation is reached.
• It also exacts no large (again, N-squared)
  storage cost.


                                            22
The Progressive Radiosity Algorithm




                                  23
Progressive Radiosity Example




                                24
 Progressive Radiosity Variants
• Several variations on the basic progressive
  radiosity algorithm have been developed.
   – “Gathering” variant
   – “Shooting” variant
• The "gathering" variant updates one surface by
  collecting light energy from all other surfaces.
• In this variant, as well as the "shooting" variant,
  the "base" surface is arbitrarily chosen.



                                                        25
  Progressive Radiosity Variants
• The "shooting" variant updates all surfaces by
  distributing light energy from one surface
• The "shooting and sorting" variant chooses the surface
  with the greatest unshot light energy and distributes its
  light energy to the surfaces in the environment.
   – The "shooting and sorting" method is the most desirable, as it
     finds the surface with the greatest potential contribution to the
     intensity solution and updates all other surfaces in the
     environment with its energy.
• In addition to these, an initial "ambient" term can be
  approximated for the environment and adjusted at each
  iteration, gradually replaced by the true ambient
  contribution to the rendered image.


                                                                         26
  Comparison of Progressive Variants

gathering                        shooting




Shooting                        Shooting
& sorting                       & sorting
                                & ambient

                                     27
The Two-Pass Radiosity Solution
• View independent, global diffuse
  illumination computed with radiosity pre-
  process.
• View dependent, global specular
  illumination computed with ray tracing
  post-process.
• Combining the strengths of radiosity and
  ray tracing achieves a more accurate and
  efficient solution to the problem of light
  transport.
                                               28
           Participating Media
• Another variation on the basic diffuse radiosity
  solution adds the contribution of light passing
  through a participating medium, such as smoke,
  fog, or water vapor in the air
  – Creating volumetric lighting effect
• In this algorithm, light energy is sent through a
  three-dimensional volume representing a
  participating medium, which both attenuates the
  light energy and adds to the intensity solution
  through illumination of the participating medium.

                                                  29
Participating Media




                      30
      Advantages of Radiosity
• Photorealistic image quality
• Accurate simulation of energy transfer
• Can simulate color bleeding.
  – Light reflected from a surface is attenuated by the
    reflectivity of the surface, which is closely associated
    with the color of the surface.
  – The reflected light energy often is colored, to some
    small extent, by the color of the surface from which it
    was reflected.




                                                               31
      Advantages of Radiosity

– The reflection of light energy in an environment
  often produces a phenomenon known as "color
  bleeding," where a brightly colored
  surface's color will "bleed" onto
  adjacent surfaces. The image in
  this slide illustrates this
  phenomenon, as both the red and
  blue walls "bleed" their color
  onto the white walls, ceiling
  and floor.



                                                     32
     Radiosity vs. Ray Tracing
• Simulate soft shadows: shadows with soft edges
  – Ray tracing often creates hard-edged shadows
• Viewpoint independent: the solution will be the
  same regardless of the viewpoint of the image

  – Ray tracing is viewpoint dependent
• Radiosity is an object space algorithm while ray
  tracing is an image space algorithm



                                                     33
      Limitations of Radiosity
• Large computational and storage costs
• Must preprocess polygonal environments
  – Difficult to compute form factor
• Does not consider transparent/translucent
  surfaces
• Non-diffuse components of light not
  represented
  – Specular highlights hard to achieve


                                           34
Radiosity Examples




                     35
Radiosity Examples




             Over 1 million
               polygons
                              36
Radiosity Examples




                     37
           Radiosity tools
• Pixar’s PRMan
• Radiosity is supported in POV-Ray
  – www.povray.org




                                      38
                 Summary
• What is radiosity?
• Radiosity process
  – Form factor
  – Solve radiosity
• Advantages and limitations of radiosity




                                            39

								
To top