Bump Mapping

SyedZaidIrshad 329 views 13 slides Apr 06, 2017
Slide 1
Slide 1 of 13
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13

About This Presentation

Bump mapping is a technique in computer graphics for simulating bumps and wrinkles on the surface of an object. This is achieved by perturbing the surface normals of the object and using the perturbed normal during lighting calculations. The result is an apparently bumpy surface rather than a smooth...


Slide Content

Bump Mapping
1

Introduction
•Let’s consider an example for which a fragment program might make
sense
•Mapping methods
•Texture mapping
•Environmental (reflection) mapping
•Variant of texture mapping
•Bump mapping
•Solves flatness problem of texture mapping
2

Examples
3

Modeling an Orange
•Consider modeling an orange
•Texture map a photo of an orange onto a surface
•Captures dimples
•Will not be correct if we move viewer or light
•We have shades of dimples rather than their correct orientation
•Ideally we need to perturb normal across surface of object and
compute a new color at each interior point
4

Bump Mapping (Blinn)
•Consider a smooth surface
5
n
p

Rougher Version
6
n’
p
p’

Equations
7
p
u
=[ ∂x/ ∂u, ∂y/ ∂u, ∂z/ ∂u]
T
p(u,v) = [x(u,v), y(u,v), z(u,v)]
T
p
v
=[ ∂x/ ∂v, ∂y/ ∂v, ∂z/ ∂v]
T
n = (p
u
´ p
v
) / | p
u
´ p
v
|

Tangent Plane
8
p
u
p
v
n

Displacement Function
9
p’ = p + d(u,v) n
d(u,v) is the bump or displacement function
|d(u,v)| << 1

Perturbed Normal
10
n’ = p’
u
´ p’
v
p’
u
= p
u
+ (∂d/∂u)n + d(u,v)n
u
p’
v
= p
v
+ (∂d/∂v)n + d(u,v)n
v
If d is small, we can neglect last term

Approximating the Normal
11
n’ = p’
u
´ p’
v
≈ n + (∂d/∂u)n ´ p
v
+ (∂d/∂v)n ´ p
u


The vectors n ´ p
v
and n ´ p
u
lie
in the tangent plane
Hence the normal is displaced in the tangent plane
Must precompute the arrays ∂d/ ∂u and ∂d/ ∂v
Finally,we perturb the normal during shading

Image Processing
•Suppose that we start with a function d(u,v)
•We can sample it to form an array D=[d
ij]
•Then ∂d/ ∂u ≈ d
ij
– d
i-1,j

and ∂d/ ∂v ≈ d
ij – d
i,j-1
•Embossing: multipass approach using accumulation buffer
12

How to do this?
•The problem is that we want to apply the perturbation at all points
on the surface
•Cannot solve by vertex lighting (unless polygons are very small)
•Really want to apply to every fragment
•Can’t do that in fixed function pipeline
•But can do with a fragment program!!
13