surface effects
play

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?


  1. Surface Effects CPSC 599.86 / 601.86 Sonny Chan University of Calgary

  2. Today’s Agenda • Rendering the illusion of a bump • Force shading • Textured surfaces [From C.-H. Ho et al., Presence 8(5), 1999.]

  3. The Virtual Bump A haptic illusion?

  4. Bump Demo

  5. What did you experience? • Is the plane flat? • Or is it curved?

  6. What did you experience? • Is the plane flat? • Or is it curved? It’s both!

  7. Force Shading D. Ruspini, K. Kolarov and O. Khatib, 1997

  8. A Virtual Sphere Represented as a polygonal mesh

  9. Rendered Sphere • What do these spheres feel like with the god-object algorithm? “flat” shaded “smooth” shaded

  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?

  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

  12. The Solution • But how do we integrate this with the proxy algorithm?

  13. Proxy Rendering Solution #1 [From C.-H. Ho, C. Basdogan & M. Srinivasan, Presence 8(5), 1999.]

  14. Proxy Rendering Solution #2 surface normal interpolated normal proxy position constraint plane sub-goal f o r c e s h finger position a d i n g p l a n e pass 1 [From D. Ruspini, K. Kolarov & O. Khatib, ACM SIGGRAPH , 1999.]

  15. Proxy Rendering Solution #2 surface normal interpolated normal proxy goal proxy position constraint plane sub-goal f o r c e s h finger position a d i n g p l a n e pass 2 Figure 5: Two Pass Force Shading with Supplied Normals [From D. Ruspini, K. Kolarov & O. Khatib, ACM SIGGRAPH , 1999.]

  16. Force Shading Proxy Path path on flat polygons force shaded path Figure 6: Effect of Flat (a) vs. Force Shaded (b) surface on [From D. Ruspini, K. Kolarov & O. Khatib, ACM SIGGRAPH , 1999.]

  17. Shading Demo

  18. How do we do this in three dimensions?

  19. p 2 v ( . 6 , . 4 , 0) Barycentric coordinates p 1 ( . 3 , . 2 , . 5) w f ( u, v ) = (1 − u − v ) p 0 + u p 1 + v p 2 u p 0

  20. p 2 u = A 1 A v = A 2 A A 0 Barycentric Coordinates p 1 A 1 ( . 3 , . 2 , . 5) f ( u, v ) = (1 − u − v ) p 0 + u p 1 + v p 2 A 2 p 0 A = 1 2 | ( p 1 − p 0 ) × ( p 2 − p 0 ) |

  21. Barycentric Interpolation • On a triangle mesh, we can interpolate using barycentric coordinates of the contact point: 3 S � � = A i · N i i � 1 = N 3 � A i i � 1 • where A i is area of sub-triangle [From C.-H. Ho, C. Basdogan & M. Srinivasan, Presence 8(5), 1999.]

  22. Textured Surfaces

  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!

  24. Normal Maps

  25. Height Fields / Bump Maps

  26. Computing normals from height maps h ( u, v ) r h F  h ( u + δ , v ) � h ( u � δ , v ) � r h ⇡ 1 h ( u, v + δ ) � h ( u, v � δ ) 2 δ

  27. Can we apply our normals directly? F = k r P � r D k ˆ m ???

  28. Tangent Space We need surface tangents!

  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]

  30. Perturbing the surface normal without tangents • If we can define a texture “height” function in 3D space, and its gradient: h ( x, y, z ) r h = ∂ h x + ∂ h y + ∂ h ∂ x ˆ ∂ y ˆ ∂ z ˆ z • We can compute the perturbed normal directly from the gradient of h(x, y, z) m = ˆ n � r h + ( r h · ˆ n )ˆ n

  31. F One more issue…

  32. ??? F One more issue… ( ( d − Kh )ˆ n + Kh ˆ if d ≥ Kh m F = d ˆ otherwise m

  33. What about a friction map?

  34. Textures in a modern visual renderer

  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

Recommend


More recommend