Docstoc

appearance-9

Document Sample
appearance-9 Powered By Docstoc
					Real-Time Rendering
 COMS 6998-3, Lecture 9
  Real-Time Rendering Demo
Motivation: Interactive rendering with complex
natural illumination and realistic, measured BRDFs
Complex Light Transport
                  Challenges

• Illumination complexity


• Material (BRDF)/view complexity


• Transport complexity (shadows, interreflection)
              Reflection Maps




Blinn and Newell, 1976
           Environment Maps




Miller and Hoffman, 1984
      Environment Maps




Interface, Chou and Williams (ca. 1985)
          Environment Maps


               Cylindrical Panoramas




                               180 degree fisheye
Cubical Environment Map        Photo by R. Packo
             Reflectance Maps
• Reflectance Maps (Index by N)
•     Horn, 1977
• Irradiance (N) and Phong (R) Reflection Maps
•     Hoffman and Miller, 1984




     Mirror Sphere   Chrome Sphere   Matte Sphere
    Irradiance Environment Maps
                        R                             N




       Incident Radiance         Irradiance Environment Map
(Illumination Environment Map)
              Assumptions
• Diffuse surfaces
• Distant illumination
• No shadowing, interreflection


Hence, Irradiance is a function of surface normal
              Diffuse Reflection

                    B  E
   Radiosity              Reflectance             Irradiance
(image intensity)       (albedo/texture)       (incoming light)



                    =                      ×

                                               quake light map
  Analytic Irradiance Formula
                               
Lambertian surface acts
                                   2 / 3
like low-pass filter
                          Al            /4
 Elm  Al Llm             0
                              0 1 2
                                                   l
                                      (1)
                                            l 1
                                            2      l! 
                           Al  2                 l           l even
                                   (l  2)(l  1)  2  2 ! 
                                                  
                                                        l 2
                                                             
       9 Parameter Approximation


                                                      Order 0
Exact image
                                                      1 term



                                                          Ylm ( ,  )
                                      m
                         0
      RMS error = 25 %       l

                         1                y      z        x


                         2   xy           yz   3z 2  1   zx   x2  y 2

                                 -2       -1      0       1        2
       9 Parameter Approximation


                                                     Order 1
Exact image
                                                     4 terms



                                                         Ylm ( ,  )
                                     m
                        0
       RMS Error = 8%       l

                        1                y      z        x


                        2   xy           yz   3z 2  1   zx   x2  y 2

                                -2       -1      0       1        2
       9 Parameter Approximation


                                                              Order 2
Exact image
                                                              9 terms



                                                                  Ylm ( ,  )
                                              m
                                 0
       RMS Error = 1%                l

                                 1                y      z        x
 For any illumination, average
 error < 3% [Basri Jacobs 01]    2   xy           yz   3z 2  1   zx   x2  y 2

                                         -2       -1      0       1        2
               Comparison




  Incident         Irradiance map         Irradiance map
illumination     Texture: 256x256        Texture: 256x256
  300x300          Hemispherical        Spherical Harmonic
                 Integration 2Hrs        Coefficients 1sec
         Time  300  300  256  256   Time  9  256  256
                         Rendering
 Irradiance approximated by quadratic polynomial

E (n)  c4 L001  2c2 L11 x  2c2 L11 y  2c2 L10 z  c5 L20 (3z  1) 
                                                                2


        2c1L22 xy  2c1L21 xz  2c1L21 yz  c1 L22 ( x 2  y 2 )


                  E (n)  n Mn        t

                   4x4 matrix                                    x
                                          Surface Normal vector  
                (depends linearly         column 4-vector        y
               on coefficients Llm)                             z
                                                                 
                                                                1
                                                                 
         Hardware Implementation

               E (n)  n Mn         t

Simple procedural rendering method (no textures)
   • Requires only matrix-vector multiply and dot-product
   • In software or NVIDIA vertex programming hardware

     surface float1 irradmat (matrix4 M, float3 v) {
             float4 n = {v , 1} ;
             return dot(n , M*n) ;
     }
Reflectance Space Shading
              Cabral, Olano, Nemec
              1999
            OLF Parameterization

B( N ,V )
             N                N    L
   V
            OLF Parameterization

B( N ,V )                       B ( R, V )
             N                               N
   V              Reparameterize V               R

                 by reflection vector
            OLF Parameterization

B( N ,V )                          B ( R, V )
             N                                  N
   V                  Reparameterize V                  R

                    by reflection vector


  • Captures structure of BRDF (and hence OLF) better
  • Reflective BRDFs become low-dimensional
        OLF Structure: Lafortune
          BV ( R)

                     • Single 2D reflection map
                     no longer sufficient
Viewy




                     • But variation with viewing
                     direction is slow




          Viewx
        OLF Structure: Lafortune
          BV ( R)                       BR (V )




                     Reflectiony
Viewy




          Viewx                          Reflectionx
                                   View maps vary slowly
         A Simple Factorization
           BV ( R)                         BR (V )




                            Reflectiony
Viewy




            Viewx                         Reflectionx

                           *
        B ( R, V )   f ( R) * g (V )
Precomputed Radiance Transfer
 for Real-Time Rendering in Dynamic,
Low-Frequency Lighting Environments


       Peter-Pike Sloan, Microsoft Research
            Jan Kautz, MPI Informatik
         John Snyder, Microsoft Research
     Previous Work – Where We Fit
 Lighting



                         ? ?
          [Blinn76]
 full                   our
 env.                   technique
 map
                      [Moeller02]     [Ashikhmin02]
single
  area
  light
                                                      Non-Interactive
                      [Crow77]
                                                      [Matusik02]
 point
lights
                                                      Transport
                                    [Heidrich00]



          simple       shadows          inter-        Complexity
                                     reflections
                          Motivation
• Better light integration and
  transport
   • dynamic, area lights
   • self-shadowing
   • interreflections

                                 point light        area light
• For diffuse and
  glossy surfaces

• At real-time rates




                                 area lighting,   area lighting,
                                  no shadows        shadows
                 Diffuse Self-Transfer
2D example, piecewise constant basis, shadows only

 Preprocess           Project Light       Rendering



             p2                                    p2
            p1                                    p1
       p3                                    p3

  p1                  light           • p1              =
  p2                                  • p2              =
                       light
  p3                                  • p3              =
           Precomputation

    .
    .
    .
Basis 16




Basis 17        illuminate   result




Basis 18
    .
    .
    .
       Diffuse Transfer Results




No Shadows/Inter   Shadows   Shadows+Inter
        Arbitrary BRDF Results




Anisotropic BRDFs   Other BRDFs   Spatially Varying
       Shadow Mapping
with Today’s OpenGL Hardware

         CEDEC 2001
         Tokyo, Japan



    Mark J. Kilgard
    Graphics Software Engineer
    NVIDIA Corporation
                   Motivation

• Shadows increase scene realism
  • Real world has shadows
  • More control of the game’s feel
     • dramatic effects
     • spooky effects
  • Other art forms recognize the value of shadows
  • But yet most games lack realistic shadows
    Common Real-time Shadow Techniques

               Projected               Shadow
               planar                  volumes
               shadows




                                Hybrid
                                approaches




Light maps
                      Problems

• Mostly tricks with lots of limitations
   • Projected planar shadows
      • well works only on flat surfaces
   • Stenciled shadow volumes
      • determining the shadow volume is hard work
   • Light maps
      • totally unsuited for dynamic shadows
   • In general, hard to get everything shadowing
     everything
             Shadow Mapping

• Image-space shadow determination
  • Lance Williams published the basic idea in 1978
     • By coincidence, same year Jim Blinn invented bump
       mapping (a great vintage year for graphics)
  • Completely image-space algorithm
     • means no knowledge of scene’s geometry is required
     • must deal with aliasing artifacts
  • Well known software rendering technique
     • Pixar’s RenderMan uses the algorithm
     • Basic shadowing technique for Toy Story, etc.
                   References

• Important SIGGRAPH papers
  • Lance Williams, “Casting Curved Shadows on Curved
    Surfaces,” SIGGRAPH 78
  • William Reeves, David Salesin, and Robert Cook
    (Pixar), “Rendering antialiased shadows with depth
    maps,” SIGGRAPH 87
  • Mark Segal, et. al. (SGI), “Fast Shadows and Lighting
    Effects Using Texture Mapping,” SIGGRAPH 92
   Shadow Mapping Concept (1)

• Depth testing from the light’s point-of-view
   • Two pass algorithm
   • First, render depth buffer from the light’s point-of-view
      • the result is a “depth map” or “shadow map”
      • essentially a 2D function indicating the depth of the
        closest pixels to the light
   • This depth map is used in the second pass
   Shadow Mapping Concept (2)

• Shadow determination with the depth map
  • Second, render scene from the eye’s point-of-view
  • For each rasterized fragment
     • determine fragment’s XYZ position relative to the light
     • this light position should be setup to match the frustum
       used to create the depth map
     • compare the depth value at light position XY in the depth
       map to fragment’s light position Z
  Shadow Mapping Concept (3)

• The Shadow Map Comparison
  • Two values
     • A = Z value from depth map at fragment’s light XY position
     • B = Z value of fragment’s XYZ light position
  • If B is greater than A, then there must be something
    closer to the light than the fragment
     • then the fragment is shadowed
  • If A and B are approximately equal, the fragment is lit
      Visualizing Shadow Mapping
  • A fairly complex scene with shadows




   the point
light source
    Visualizing Shadow Mapping
• Compare with and without shadows




      with shadows         without shadows
     Visualizing Shadow Mapping
• The scene from the light’s point-of-view




                                        FYI: from the
                                        eye’s point-of-view
                                        again
     Visualizing Shadow Mapping
• The depth buffer from the light’s point-of-view




                                      FYI: from the
                                      light’s point-of-view
                                      again
     Visualizing Shadow Mapping
• Projecting the depth map onto the eye’s view




                                      FYI: depth map for
                                      light’s point-of-view
                                      again
       Visualizing Shadow Mapping
• Comparing light distance to light depth map


     Green is
   where the
 light planar
                                                Non-green is
distance and
                                                where
     the light
                                                shadows
  depth map
                                                should be
           are
approximatel
      y equal
     Visualizing Shadow Mapping
• Scene with shadows




  Notice how              Notice how
    specular              curved
   highlights             surfaces cast
never appear              shadows on
 in shadows               each other
   Hardware Shadow Map Filtering

• “Percentage Closer” filtering
   • Normal texture filtering just averages color components
   • Averaging depth values does NOT work
   • Solution [Reeves, SIGGARPH 87]
      • Hardware performs comparison for each sample
      • Then, averages results of comparisons
   • Provides anti-aliasing at shadow map edges
      • Not soft shadows in the umbra/penumbra sense
   Hardware Shadow Map Filtering

GL_NEAREST: blocky             GL_LINEAR: antialiased edges




    Low shadow map resolution
    used to heightens filtering artifacts
Soft Shadows?
                    Conclusion
• Variety of techniques
   • Shadows
   • Complex illumination
   • Complex materials

• Limited manipulability in most cases
   • Cannot change lighting, geometry, viewpoint etc.

• Is it possible to have everything simultaneously?

				
DOCUMENT INFO
Shared By:
Categories:
Stats:
views:7
posted:6/23/2011
language:English
pages:53