Module 06 - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

Module 06

Description:

... unique type of objects (like chrome, polished metal, glass) which reflect the ... In practice, environment mapping applies a special texture map that contains an ... – PowerPoint PPT presentation

Number of Views:36
Avg rating:3.0/5.0
Slides: 11
Provided by: Raem5
Category:
Tags: chrome | module

less

Transcript and Presenter's Notes

Title: Module 06


1
Module 06
  • Advanced mapping techniques
  • Environment mapping

2
Overview
  • Environment mapping
  • Sphere mapping
  • Cube mapping

3
Environment mapping
  • Environment mapping technique is used to model
    unique type of objects (like chrome, polished
    metal, glass) which reflect the environment they
    are in.
  • In practice, environment mapping applies a
    special texture map that contains an image of the
    scene surrounding an object to the object itself.
  • The result approximates the appearance of a
    reflective surface, close enough to fool the eye,
    without incurring any of the expensive
    computations involved in ray-tracing.
  • The GL_SPHERE_MAP and GL_REFLECTION_MAP texture
    generation modes can be used in conjunction with
    an appropriate texture map to create realistic
    reflections.

4
Sphere mapping
  • For the GL_SPHERE_MAP mode, or sphere mapping the
    texture coordinates are generated using a vector
    from the eye to the point on the surface and the
    surface normal to create a reflection vector. The
    reflection vector is used to calculate the
    texture coordinates.
  • Drawbacks
  • - sphere mapping is view dependent, so viewing a
    reflective object from --
  • - anywhere other than the center of projection
    can produce incorrect results
  • - the reflection won't pick up any objects
    moving in the world
  • Advantage
  • - faster than cube mapping in static
    environments

5
Cube mapping (1)
  • In the GL_REFLECTION_MAP mode, or cube mapping
    the world is rendered six times (once for each
    direction) from the reflective object's
    perspective.
  • The results are then stored in the six faces of a
    cube map, which is then applied to the object.
  • This approach is much better than sphere mapping,
    since a reflection image can be generated
    anywhere in the world, and it can be updated
    dynamically to reflect objects in motion.
  • Cube maps are also view independent and can be
    easily mapped onto any objects.
  • For these reasons, sphere mapping is generally
    not used often.

6
Cube mapping (2)
  • Texture coordinates used in conjunction with cube
    texture maps are typically generated at runtime.
    For instance, environment mapping can be
    performed by calculating the reflection of the
    direction to the camera and storing it in the
    s,t,r) coordinates at each vertex of a triangle
    mesh. The reflection direction calculation is
    normally implemented in hardware, so this can be
    done very efficiently.
  • The s-, t-, and r-coordinates represent a
    direction vector emanating from the center of the
    cube that points toward the texel to be sampled.

7
Cube mapping (3)
  • Orientation of the cube map axes relative to each
    of the six faces

8
Cube mapping (4)
  • Cubemap covering the six faces of a cube

9
Final result
10
Practice

Open Lab06 /SphereMapping / SphereMapping.sln L
ab06 /CubeMapping / CubeMapping.sln
Write a Comment
User Comments (0)
About PowerShow.com