Bump Mapping - Interactive Computer Graphics | CS 418, Study notes of Computer Graphics

Material Type: Notes; Class: Interactive Computer Graphics; Subject: Computer Science; University: University of Illinois - Urbana-Champaign; Term: Spring 2009;

Typology: Study notes

Pre 2010

Uploaded on 03/16/2009

koofers-user-1b0-3
koofers-user-1b0-3 🇺🇸

10 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Mapping More than Color
Basic texture mapping applies colors to surfaces
but the method is much more general than this
can be used to map wide range of data onto surfaces
although not necessarily supported by OpenGL
We’ll look at a couple of examples today
bump mapping
normal mapping
displacement mapping
Bump Mapping
This is a method of playing a dirty trick on the human viewer
perception of shape is determined by shading
which is determined by surface normal
We want to add surface texture to an object
start with a smooth surface (with few polygons)
interpret the 3 channels of each texel as a vector
use this vector to perturb the surface normal
This is not directly supported by OpenGL
P
N
'
original normal
from bump map
=+Δnn n
Bump Mapping
Here are 3 geometric spheres, with bump mapping
note the tell-tale sign of bump mapping
“rough” surfaces with perfectly smooth silhouettes
Variations/Relatives of Bump Mapping
Normal mapping
interpret each texel as a normal vector (rather than offset)
essentially a hard-coded bump map
Displacement mapping
interpret texels as offset vectors and apply to surface position
unlike bump mapping, this actually modifies the geometry
pf3
pf4
pf5

Partial preview of the text

Download Bump Mapping - Interactive Computer Graphics | CS 418 and more Study notes Computer Graphics in PDF only on Docsity!

Mapping More than Color Basic texture mapping applies colors to surfaces

  • but the method is much more general than this• can be used to map wide range of data onto surfaces• although not necessarily supported by OpenGL

We’ll look at a couple of examples today

  • bump mapping• normal mapping• displacement mapping

Bump Mapping This is a method of playing a dirty trick on the human viewer

  • perception of shape is determined by shading• which is determined by surface normal

We want to add surface texture to an object

  • start with a smooth surface (with few polygons)• interpret the 3 channels of each texel as a vector• use this vector to perturb the surface normal

This is

not

directly supported by OpenGL

original normal

from bump map

n

n

n

Bump Mapping Here are 3 geometric spheres, with bump mapping

  • note the tell-tale sign of bump mapping• “rough” surfaces with perfectly smooth silhouettes

Variations/Relatives of Bump Mapping Normal mapping

  • interpret each texel as a normal vector (rather than offset)• essentially a hard-coded bump map

Displacement mapping

  • interpret texels as offset vectors and apply to

surface position

  • unlike bump mapping, this actually modifies the geometry

Environment Mapping We can also use texturing to simulate reflections

  • imagine enclosing object in a box• project the world onto the sides of the box• for any point on the object, compute reflection by looking up

appropriate reflected direction in the cube map

Fairly easy to generate

  • place camera at center of object• render scene for each side of the box

But not totally accurate

  • reflections are only accurate for point at

which the images were taken

  • all other reflections are incorrect• but people generally never notice

Projection of Reflection Vectors Environment mapping maps reflection vectors to textureNeed a projection function for reflection vector

reflection vector

r

viewing direction

u

s t

r

Projecting Reflection Directions The set of all unit direction vectors is the unit sphereThus, any parameterization of the unit sphere will do

  • but some are better than others

Example: compute latitude/longitude angles and scale to [0,1]

  • introduces significant distortion• especially at poles

Geometry of Sphere Maps

image plane

reflected rays

Texture Maps as Lookup Tables Texture maps are not (just) imagesTexture maps are 2-D look-up tables of 3-vectorsTextures can encode any bivariate triple-valued functionWe can do a lot with look-up tables!

Texture Shading Suppose we have some bivariate shading equationWe could shade a surface purely through texturing

  • precompute values of

I

in a texture map

  • turn off lighting• at each vertex, compute (

s

t

) and emit as texture coordinate

Texture map serves as look-up table for our shading equation

color to shade given point

[ , ]

[ , ]

I

s t

s

t

Texture Shading: Phong Model Recall the Phong illumination modelWe can write this as a bivariate function

max( ,(

(max( ,

n

a

a

d

d

s

s

I

k I

k I

k I

n L

r v

where

[ , ]

[ , ]

n

a

a

d

d

s

s

I s t

k I

sk I

t k I

s t

n L r v

s

n L

t

r v

Texture Shading: Skin One approximation for the reflectance of skincan also be written as a bivariate function

d

d

I

k I

n L

n L

n v

where

[ , ]

[ , ]

d

d

s

I s t

k I

s

t

s t

n L n v

s

n L

t

n v

Sphere Maps for Texture Shading

Adding “Silhouettes” with Sphere Maps

Add black rim around the

edge of the sphere map

(not shown)