Surface Effects CPSC 599.86 / 601.86 Sonny Chan University of - - PowerPoint PPT Presentation

surface effects
SMART_READER_LITE
LIVE PREVIEW

Surface Effects CPSC 599.86 / 601.86 Sonny Chan University of - - PowerPoint PPT Presentation

Surface Effects CPSC 599.86 / 601.86 Sonny Chan University of Calgary Todays Agenda Rendering the illusion of a bump Force shading Textured surfaces [From C.-H. Ho et al., Presence 8(5), 1999.] The Virtual Bump A haptic illusion?


slide-1
SLIDE 1

Surface Effects

CPSC 599.86 / 601.86 Sonny Chan University of Calgary

slide-2
SLIDE 2

Today’s Agenda

  • Rendering the illusion of a bump
  • Force shading
  • Textured surfaces

[From C.-H. Ho et al., Presence 8(5), 1999.]

slide-3
SLIDE 3

The Virtual Bump

A haptic illusion?

slide-4
SLIDE 4

Bump Demo

slide-5
SLIDE 5

What did you experience?

  • Is the plane flat?
  • Or is it curved?
slide-6
SLIDE 6

What did you experience?

  • Is the plane flat?
  • Or is it curved?

It’s both!

slide-7
SLIDE 7

Force Shading

  • D. Ruspini, K. Kolarov and O. Khatib, 1997
slide-8
SLIDE 8

A Virtual Sphere

Represented as a polygonal mesh

slide-9
SLIDE 9

Rendered Sphere

  • What do these spheres feel like with the god-object algorithm?

“flat” shaded “smooth” shaded

slide-10
SLIDE 10

The Problem

  • Polygonal representations

decompose objects into flat, piecewise (faceted) surfaces

  • The plane projection used in the

god-object algorithm always renders a normal direction force

  • How do we fix this?
slide-11
SLIDE 11

The Solution

  • Many polygonal models will have

associated vertex normals to facilitate smooth shading

  • We can interpolate the vertex

normals for haptic rendering

  • Haptics equivalent of the Phong

shading technique

slide-12
SLIDE 12

The Solution

  • But how do we integrate this

with the proxy algorithm?

slide-13
SLIDE 13

Proxy Rendering Solution #1

[From C.-H. Ho, C. Basdogan & M. Srinivasan, Presence 8(5), 1999.]

slide-14
SLIDE 14

Proxy Rendering Solution #2

interpolated normal finger position proxy position sub-goal f

  • r

c e s h a d i n g p l a n e constraint plane surface normal pass 1

[From D. Ruspini, K. Kolarov & O. Khatib, ACM SIGGRAPH, 1999.]

slide-15
SLIDE 15

Proxy Rendering Solution #2

interpolated normal finger position proxy position proxy goal sub-goal f

  • r

c e s h a d i n g p l a n e constraint plane surface normal pass 2 Figure 5: Two Pass Force Shading with Supplied Normals

[From D. Ruspini, K. Kolarov & O. Khatib, ACM SIGGRAPH, 1999.]

slide-16
SLIDE 16

Force Shading Proxy Path

Figure 6: Effect of Flat (a) vs. Force Shaded (b) surface on

[From D. Ruspini, K. Kolarov & O. Khatib, ACM SIGGRAPH, 1999.]

path on flat polygons force shaded path

slide-17
SLIDE 17

Shading Demo

slide-18
SLIDE 18

How do we do this in

three dimensions?

slide-19
SLIDE 19

Barycentric coordinates

p0 p1 p2 f(u, v) = (1 − u − v)p0 + up1 + vp2 u

v

w

(.6, .4, 0) (.3, .2, .5)

slide-20
SLIDE 20

Barycentric Coordinates

p0 p1

(.3, .2, .5)

p2

A0 A1 A2

u = A1 A v = A2 A A = 1

2 |(p1 − p0) × (p2 − p0)|

f(u, v) = (1 − u − v)p0 + up1 + vp2

slide-21
SLIDE 21

Barycentric Interpolation

  • On a triangle mesh, we can

interpolate using barycentric coordinates of the contact point:

  • where Ai is area of sub-triangle

[From C.-H. Ho, C. Basdogan & M. Srinivasan, Presence 8(5), 1999.]

N

= S

i1 3

Ai · N

=

i

  • i1

3

Ai

slide-22
SLIDE 22

Textured Surfaces

slide-23
SLIDE 23

Texture Images

  • We can use the barycentric

coordinates of the contact point to index a texture image

  • Just like texture mapping in

graphics!

  • But what properties are we after

for haptic rendering?

  • We can’t feel colour!
slide-24
SLIDE 24

Normal Maps

slide-25
SLIDE 25

Height Fields / Bump Maps

slide-26
SLIDE 26

Computing normals from height maps

h(u, v)

F

rh rh ⇡ 1 2δ h(u + δ, v) h(u δ, v) h(u, v + δ) h(u, v δ)

slide-27
SLIDE 27

Can we apply our normals directly?

F = krP rDk ˆ m ???

slide-28
SLIDE 28

Tangent Space

We need surface tangents!

slide-29
SLIDE 29

Tangent Directions

  • Can be computed from vertex

texture coordinates (u, v)

  • I’ll omit the details of the

derivation here

  • CHAI3D has a function that will

do this for you

[From learnopengl.com]

slide-30
SLIDE 30

Perturbing the surface normal without tangents

  • If we can define a texture “height” function in 3D space, and its gradient:
  • We can compute the perturbed normal directly from the gradient of h(x, y, z)

h(x, y, z) m = ˆ n rh + (rh · ˆ n)ˆ n rh = ∂h ∂x ˆ x + ∂h ∂y ˆ y + ∂h ∂z ˆ z

slide-31
SLIDE 31

One more issue…

F

slide-32
SLIDE 32

One more issue…

F F = ( (d − Kh)ˆ n + Kh ˆ m if d ≥ Kh d ˆ m

  • therwise

???

slide-33
SLIDE 33

What about a

friction map?

slide-34
SLIDE 34

Textures

in a modern visual renderer

slide-35
SLIDE 35

Summary

  • This week, we learned how to render surfaces beyond the flat, slippery plane
  • Friction: rendering surfaces with both static and dynamic coulomb friction
  • Shading: rendering smooth surfaces from faceted polygonal models
  • Textures: rendering textured surfaces by image lookup