05 Detail mapping Steve Marschner CS5625 Spring 2016 Hierarchy of - - PowerPoint PPT Presentation

05 detail mapping
SMART_READER_LITE
LIVE PREVIEW

05 Detail mapping Steve Marschner CS5625 Spring 2016 Hierarchy of - - PowerPoint PPT Presentation

05 Detail mapping Steve Marschner CS5625 Spring 2016 Hierarchy of scales macroscopic 1000 Geometry mesoscopic Object scale 100 microscopic Texture, bump maps 10 Milliscale Texels 1 mm (Mesoscale) 0.1 BRDF Microscale 0.01 Figure


slide-1
SLIDE 1

05 Detail mapping

Steve Marschner CS5625 Spring 2016

slide-2
SLIDE 2

Hierarchy of scales

macroscopic mesoscopic microscopic

0.01 0.1 1 mm 100 1000 10 BRDF Texels Texture, bump maps Geometry

Object scale Milliscale Microscale

Figure 1: Applicability of Techniques

(Mesoscale)

slide-3
SLIDE 3
  • Most flexible part of graphics hardware
  • Textures can modulate

– Material § Diffuse, Specular/roughness (gloss maps) – Geometry § Positions

  • displacement mapping

§ Normals

  • bump mapping, normal mapping

– Lighting § Environment mapping § Reflection mapping § Shadow mapping

slide courtesy of Kavita Bala, Cornell University

Texture Maps

slide-4
SLIDE 4
  • Mimic effect of geometric detail/meso geometry

– Also detail mapping

slide courtesy of Kavita Bala, Cornell University

Displacement and Bump/Normal Mapping

Geometry Bump mapping Displacement mapping

slide-5
SLIDE 5

slide courtesy of Kavita Bala, Cornell University

Displacement Mapping

p0(u, v) = p(u, v) + h(u, v)n(u, v)

slide-6
SLIDE 6

slide courtesy of Kavita Bala, Cornell University

Displacement Maps: where?

slide-7
SLIDE 7

slide courtesy of Kavita Bala, Cornell University

Displacement Maps: vertex map

slide-8
SLIDE 8
  • Pros

– Gives you very complex surfaces

  • Cons

– Gives you very complex surfaces – Or boring with small numbers of vertices

  • Relationship with tesselation shaders

slide courtesy of Kavita Bala, Cornell University

Displacement Maps

slide-9
SLIDE 9

slide courtesy of Kavita Bala, Cornell University

Original Tesselated Displacement Mapped

slide-10
SLIDE 10
  • “Simulation of Wrinkled Surfaces” Blinn 78
  • Blinn: keep surface, use new normals

slide courtesy of Kavita Bala, Cornell University

Bump mapping

slide-11
SLIDE 11
  • Alter normals of surface

– Only affects shading normals

  • Also, mimics effect of small scale geometry

– Detail map – Except at silhouette – Adds perceived bumps, wrinkles

slide courtesy of Kavita Bala, Cornell University

Bump Mapping

slide-12
SLIDE 12

slide courtesy of Kavita Bala, Cornell University

Bump Mapping

slide-13
SLIDE 13

slide courtesy of Kavita Bala, Cornell University

Bump Mapping

slide-14
SLIDE 14
  • First, need some frame of reference

– Normal is modified with respect to that – Have tangent space basis: t and b – Normal, tangent and bitangent vectors

slide courtesy of Kavita Bala, Cornell University

How to change the normal?

slide-15
SLIDE 15
  • Single scalar, more computation to infer N’

slide courtesy of Kavita Bala, Cornell University

Heightfield: Blinn’s original idea

slide-16
SLIDE 16

Perturbed normal given height map

Normal is determined by partial derivatives of height

  • in the local frame of the displacement map:
  • approx: heights are small compared to radius of curvature (constant normal)
  • then the displaced surface is locally a linear transformation of the height field
  • normal transforms by the adjoint matrix (as normals always to)
  • perform 4 lookups to get 4 neighboring height values
  • subtract to obtain finite difference derivatives

ndisp = (hu, hv, 1)

slide-17
SLIDE 17
  • Older technique, less memory
  • Texture map value is a height
  • Gray scale value: light is +, dark is -

slide courtesy of Kavita Bala, Cornell University

Height Field Bump Maps

slide-18
SLIDE 18
  • Look up bu and bv
  • N’ is not normalized
  • N’ = N + bu T + bv B

slide courtesy of Kavita Bala, Cornell University

Bump Mapping

slide-19
SLIDE 19
  • N’.L
  • Perturb N to get N’ using bump map
  • Transform L to tangent space of surface

– Have N, T (tangent), bitangent B = T x N

slide courtesy of Kavita Bala, Cornell University

Rendering with Bump Maps

slide-20
SLIDE 20

slide courtesy of Kavita Bala, Cornell University

http://www.youtube.com/watch?v=1mdR2imNeZI

slide-21
SLIDE 21
  • Preferred technique for bump mapping for

modern graphics cards

  • Store new normals in texture map

– Encodes (x, y, z) mapped to [-1, 1]

  • More memory but lower computation

slide courtesy of Kavita Bala, Cornell University

Normal Maps

Normal Map Height Map

slide-22
SLIDE 22

colorComponent = 0.5 * normalComponent + 0.5

  • slide courtesy of Kavita Bala, Cornell University

normalComponent = 2* colorComponent -1

  • Store
  • Use
slide-23
SLIDE 23

slide courtesy of Kavita Bala, Cornell University

Normal Map

slide-24
SLIDE 24
  • First create complex geometry
  • Simplify (in modeling time) to simple mesh

with normal map

slide courtesy of Kavita Bala, Cornell University

Creating Normal Maps

slide-25
SLIDE 25

slide courtesy of Kavita Bala, Cornell University

Displacement Maps vs. Normal Maps

slide-26
SLIDE 26

slide courtesy of Kavita Bala, Cornell University

Compare with the opposite view

Original Tesselated Displacement Mapped

slide-27
SLIDE 27

slide courtesy of Kavita Bala, Cornell University

Unreal 3

slide-28
SLIDE 28

slide courtesy of Kavita Bala, Cornell University

2M polys

slide-29
SLIDE 29

slide courtesy of Kavita Bala, Cornell University

5k

slide-30
SLIDE 30

slide courtesy of Kavita Bala, Cornell University

Creating Normal Maps

slide-31
SLIDE 31
  • World space

– Easy computation

§ Get normal § Get light vector § Compute shading

– Can we use the same normal map for…

§ two walls § A rotating object

  • Object space

– Better, but cannot be reused for symmetric parts

  • f object

slide courtesy of Kavita Bala, Cornell University

Which space is normal map in?

slide-32
SLIDE 32
  • Tangent space normals

– Can reuse for deforming surfaces – Transform lighting to this space and shade

slide courtesy of Kavita Bala, Cornell University

Which space is normal in?

slide-33
SLIDE 33
  • Problem with normal mapping

– No self-occlusion – Supposed to be a height field but never see this

  • cclusion across different viewing angles
  • Parallax mapping

– Positions of objects move relative to one other as viewpoint changes

slide courtesy of Kavita Bala, Cornell University

Parallax Mapping

slide-34
SLIDE 34
  • Want Tideal
  • Use Tp to approximate it

slide courtesy of Kavita Bala, Cornell University

Parallax Mapping

v h

slide-35
SLIDE 35
  • Problem: at steep viewing, can offset too

much

  • Limit offset

slide courtesy of Kavita Bala, Cornell University

Parallax Offset Limiting

slide-36
SLIDE 36
  • Widely used in games

– the standard in bump mapping

slide courtesy of Kavita Bala, Cornell University

Parallax Offset Limiting

Normal Mapping Parallax Mapping Offset Limiting

slide-37
SLIDE 37

slide courtesy of Kavita Bala, Cornell University

1,100 polygon object w/ parallax occlusion mapping 1.5 million polygon

slide-38
SLIDE 38

slide courtesy of Kavita Bala, Cornell University

http://www.youtube.com/watch?v=nZPsQtlHthQ

slide-39
SLIDE 39
  • Aka Parallax occlusion mapping, relief

mapping, steep parallax mapping

  • Tries to find where the view ray intersects

the height field

– Kinda

slide courtesy of Kavita Bala, Cornell University

Relief Mapping

slide-40
SLIDE 40

slide courtesy of Kavita Bala, Cornell University

Relief Mapping

slide-41
SLIDE 41

slide courtesy of Kavita Bala, Cornell University

Sample along ray (green points) Lookup violet points (texture values) /* Inferthe black line shape */ Compare green points with black points Find intersect between two conditions prev: green above black next: green below black

slide-42
SLIDE 42

slide courtesy of Kavita Bala, Cornell University

Parallax Mapping Relief Mapping

slide-43
SLIDE 43

slide courtesy of Kavita Bala, Cornell University

http://www.youtube.com/watch?v=_erYebogWUw http://www.youtube.com/watch?v=5gorm90TXJM

slide-44
SLIDE 44

slide courtesy of Kavita Bala, Cornell University

Crysis, Crytek