Introduction to normal mapping Karl Tarbe Faculty of Mathematics - - PowerPoint PPT Presentation

introduction to normal mapping
SMART_READER_LITE
LIVE PREVIEW

Introduction to normal mapping Karl Tarbe Faculty of Mathematics - - PowerPoint PPT Presentation

Introduction to normal mapping Karl Tarbe Faculty of Mathematics and Computer Science October 2, 2014 The problem What we want? better graphics better frame rate Karl Tarbe Bump mapping October 2, 2014 2 / 14 Solution - More polygons!


slide-1
SLIDE 1

Introduction to normal mapping

Karl Tarbe

Faculty of Mathematics and Computer Science

October 2, 2014

slide-2
SLIDE 2

The problem

What we want?

better graphics better frame rate

Karl Tarbe Bump mapping October 2, 2014 2 / 14

slide-3
SLIDE 3

Solution - More polygons!

What we get?

better graphics better frame rate

Karl Tarbe Bump mapping October 2, 2014 3 / 14

slide-4
SLIDE 4

Solution - More polygons!

What we get?

better graphics better frame rate

Karl Tarbe Bump mapping October 2, 2014 3 / 14

slide-5
SLIDE 5

Shading makes the difference

Example

Karl Tarbe Bump mapping October 2, 2014 4 / 14

slide-6
SLIDE 6

Bump mapping

Example from wikipedia

Karl Tarbe Bump mapping October 2, 2014 5 / 14

slide-7
SLIDE 7

Bump mapping

Example from wikipedia How to:

Simulate displacement of surface. Profit!

Karl Tarbe Bump mapping October 2, 2014 5 / 14

slide-8
SLIDE 8

Bump mapping

Example from wikipedia How to:

Simulate displacement of surface. Profit! Topic of today.

Karl Tarbe Bump mapping October 2, 2014 5 / 14

slide-9
SLIDE 9

Texture mapping

Texture Textured plane

Karl Tarbe Bump mapping October 2, 2014 6 / 14

slide-10
SLIDE 10

Normal compression

Normal vector

Three components Range −1.0 ≤ ni ≤ 1.0

  • n = (x, y, z)

RGB color

Three components Range 0 ≤ ci ≤ 255

  • color = (r, g, b)

Karl Tarbe Bump mapping October 2, 2014 7 / 14

slide-11
SLIDE 11

Normal compression

Normal vector

Three components Range −1.0 ≤ ni ≤ 1.0

  • n = (x, y, z)

RGB color

Three components Range 0 ≤ ci ≤ 255

  • color = (r, g, b)

Compression

ci = 127.5 ∗ (ni + 1.0) ni = 1 127.5 ∗ ci − 1.0

Karl Tarbe Bump mapping October 2, 2014 7 / 14

slide-12
SLIDE 12

Normal map example

3D model Corresponding normal map

Karl Tarbe Bump mapping October 2, 2014 8 / 14

slide-13
SLIDE 13

Height map

Texture Corresponding height map

Karl Tarbe Bump mapping October 2, 2014 9 / 14

slide-14
SLIDE 14

From height map to normal map

Gradient

xgrad = pix(x −1, y)−pix(x +1, y) ygrad = pix(x, y −1)−pix(x, y +1)

  • n′ =

n + U · xgrad + V · ygrad

Karl Tarbe Bump mapping October 2, 2014 10 / 14

slide-15
SLIDE 15

Revisiting Blinn-Phong lighting model

Different terms

Diffuse Ambient Specular

Final equation

I = LA · MA + nT · l · LD · MD + (r T · v)c · LS · MS

Karl Tarbe Bump mapping October 2, 2014 11 / 14

slide-16
SLIDE 16

Applying normal map

How to

Choose a consistent base. Convert normal to that base. Use that normal in the lighting model.

Example from The Cg Tutorial

Karl Tarbe Bump mapping October 2, 2014 12 / 14

slide-17
SLIDE 17

Disadvantages of bump mapping

Example from wikipedia Disadvantages

Shadows Outline

Karl Tarbe Bump mapping October 2, 2014 13 / 14

slide-18
SLIDE 18

Parallax mapping

Bump mapping Parallax mapping

Karl Tarbe Bump mapping October 2, 2014 14 / 14