Surface Effects
CPSC 599.86 / 601.86 Sonny Chan University of Calgary
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?
Surface Effects
CPSC 599.86 / 601.86 Sonny Chan University of Calgary
Today’s Agenda
[From C.-H. Ho et al., Presence 8(5), 1999.]
The Virtual Bump
A haptic illusion?
Bump Demo
What did you experience?
What did you experience?
Force Shading
A Virtual Sphere
Represented as a polygonal mesh
Rendered Sphere
“flat” shaded “smooth” shaded
The Problem
decompose objects into flat, piecewise (faceted) surfaces
god-object algorithm always renders a normal direction force
The Solution
associated vertex normals to facilitate smooth shading
normals for haptic rendering
shading technique
The Solution
with the proxy algorithm?
Proxy Rendering Solution #1
[From C.-H. Ho, C. Basdogan & M. Srinivasan, Presence 8(5), 1999.]
Proxy Rendering Solution #2
interpolated normal finger position proxy position sub-goal f
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.]
Proxy Rendering Solution #2
interpolated normal finger position proxy position proxy goal sub-goal f
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.]
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
Shading Demo
How do we do this in
Barycentric coordinates
p0 p1 p2 f(u, v) = (1 − u − v)p0 + up1 + vp2 u
v
w
(.6, .4, 0) (.3, .2, .5)
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
Barycentric Interpolation
interpolate using barycentric coordinates of the contact point:
[From C.-H. Ho, C. Basdogan & M. Srinivasan, Presence 8(5), 1999.]
N
= S
i1 3
Ai · N
=
i
3
Ai
Textured Surfaces
Texture Images
coordinates of the contact point to index a texture image
graphics!
for haptic rendering?
Normal Maps
Height Fields / Bump Maps
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 δ)
Can we apply our normals directly?
F = krP rDk ˆ m ???
Tangent Space
We need surface tangents!
Tangent Directions
texture coordinates (u, v)
derivation here
do this for you
[From learnopengl.com]
Perturbing the surface normal without tangents
h(x, y, z) m = ˆ n rh + (rh · ˆ n)ˆ n rh = ∂h ∂x ˆ x + ∂h ∂y ˆ y + ∂h ∂z ˆ z
One more issue…
F
One more issue…
F F = ( (d − Kh)ˆ n + Kh ˆ m if d ≥ Kh d ˆ m
???
What about a
Textures
in a modern visual renderer
Summary