Real-Time Rendering

Document Sample
Real-Time Rendering Powered By Docstoc
					Real-Time Rendering


          Lecture 03
        Marina Gavrilova
Brief Outline
   Image based Rendering
   Lens Effects
   Billboarding
   Particle Effects
   Reflection
   Shadow mapping
   Edge Effects
   Volumetric rendering
The Rendering Spectrum
   Effects can be produced by manipulation of images or
    geometry or both
       Image Based Rendering
   Early games used sprites (image object)
   Move/scale and draw sprite on screen
   Animated texture  animated sprite

   Layered Rendering with transparency 
   Assign depth to sprite
   Render sprites in particular order
   Use transparency

   Talisman architecture renders objects into
    layers and composite them for several
   Lumigraph rendering  Render using
    image interpolation
   Create complex objects using
    texture and simple geometry

   Used extensively in particle
    rendering systems

   Use faceted quads  normal of
    the quad equals camera

   Used frequently in games

   High performance
     Types of billboarding
   Screen-aligned billboard
       Facted quads/sprites
       Flare/glow/smoke

   World aligned billboard
       Aligned facing camera
       Has it’s own up vector
       Scenery/complex objects

   Axial Billboard
       One rotation axis
       Tree/objects on terrain
Particle system
   Point based sprites
   Additive or other blending
   Physically based modeling
   Realistic volumetric effect
Lenz Effects

 Effects that makes a scene natural
  By mimicking physical properties
            of eye/camera
     Lens Flare
   Glow of light source
   Halo around the source
   Streaks and bloom formed around the
   Secondary lens effects (internal
    reflection and refraction)
Motion Blur
   Use accumulation buffer to render object
    with interpolated coordinate
   Requires several rendering passes
   Realistic effect
   Slow

   Texture based motion blur
   Other pseudo motion blur techniques are
    used in games
   Method 1: Use
    Environment mapping

   Method 2: Flat mirror
       Render scene from mirrors
        point of view
       Darken the scene
       Use that as a texture
Exposure control
   Method 1: render multiple scene and blend with exposure

   Method 2: Define per texture luminance
        Render using High Dynamic Range luminance (HDR)
Depth of Field
   Hold camera target
   Vary camera source
   Render several pass
   Accumulate scene
Shadow mapping

 Without darkness, light cannot exist
  Shadow mapping makes a scene
     significantly more realistic
Shadow in a scene
    Planar Shadow
   When occluders cast shadow on
    planar objects (i.e. floor)
       Fully shadowed region: umbra
       Partially shadowed region:
   Hard shadow  Projection
   Soft shadow  Shadow
          Projection Shadow
   Project the vertices of an         For any arbitrary plane:
    object on a plane
   Render the transformed object
    with dark color (without           Matrix M=
   Assume light source=l, vertex
    projected=v, projected

   In matrix form for plane y=0
     (p=Mv):
Problems with projective
   Hard edge  Less realistic
   Rendering on a plane tricky:
        Offset from the plane to avoid z buffer overlap
        Different offset for different view angle
   Anti-shadow problem:
Soft Projective Shadow
   Generate a texture (render
    into texture)
   Render the texture as a plain
   Only recompute texture if
    light source changes
   Method 1: Render into
    accumulation buffer with
    varying light source
        Use perspective projection
         on a plane
        Light source = a
        Receiver parallelogram: one
         vertex b and edge ex,ey
   Advantage: Free from Anti-
    shadows and false shadows
       Soft Projective Shadow
          Method 2: Use spherical light
               Less expensive computationally
               Looks better
               Problem: Visual artifact when
                object touching the plane

Shadow on arbitrary object:
Shadow Volume
   Uses the stencil buffer
   Extend a pyramid from a light source through vertices of a triangle
   Shadow Volume: volume under the pyramid
   Consider a ray from a pixel to an object: if number of times
    intersecting front face of shadow volume>0 then vertex is under
Shadow Volume Technique
   Render the scene with ambient and emission
   Compute the faces of shadow volume
   Clear the stencil buffer and set to increment
   Render the front faces of shadow volumes
    into stencil
   Set Stencil to decrement
   Render the back faces of shadow volumes
    into stencil
   Render the scene with light only where
   Shadow volume is slow for complex geometry
Shadow Volume
Shadow Mapping
   Render the z-buffer from the lights point of
   Shadow map = content of this z-buffer
   Render scene using viewer
       If distance between a rendered point and light is
        greater than projected z value then it is under
   Use texture mapping hardware
Shadow Mapping Using
   First generate the shadow map
   Render from viewer using ambient
    lighting only
   Convert shadow map z value to viewers
    coordinate system
   Shadow test: Test z values of point with
    z values in the shadow map
Shadow mapping steps…
   Shadow mapping for a complex scene

       the point
    light source
Shadow mapping steps…
   Scene from light’s point of view
Shadow mapping steps…
   Scene from light’s point of view
Shadow mapping steps…
   Scene from viewer with shadow map (z values)
Shadow mapping steps…
   Test Shadows: non green areas are
Shadow mapping steps…
   Finally the scene can be rendered with the shadow
Other Rendering Concerns
   Edge highlighting: Draw edge in
    different color (engineering app)
   Polygon Edge rendering:
       Render the filled polygon (all buffer active)
        with z buffer replacement=off
       Render the polygon edges (all active)
       Render the polygon only to the z buffer
Other Rendering Concerns
   Hidden line rendering: Draw filled
    polygon to z-buffer and lines only on
    the color buffer (no hidden lines drawn)
   Haloing: front-face lines halo the back
    faced lines
   Height field and volumetric rendering:
    Use of voxels and 3D textures 
Height fields and volumes
End of Lecture 03


Shared By: