1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004...
-
date post
19-Dec-2015 -
Category
Documents
-
view
215 -
download
1
Transcript of 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004...
![Page 1: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/1.jpg)
1
Hardware
Feature Edges
Hardware
Feature Edges
June 7, 2004Morgan McGuire and John F. Hughes
Brown University
NPAR 2004
Hardware
Feature Edges
Hardware
Feature Edges
![Page 2: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/2.jpg)
2
GoalFind and stroke feature edges on the GPU
![Page 3: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/3.jpg)
3
Feature Edges
ContourFront-face meets back-face
BoundaryRidgeValleySilhouette
Subset of contour
All defined by derivatives of normals… i.e. for nice polyhedra, adjacent face
normals
![Page 4: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/4.jpg)
4
Feature Tests
1 :
:~|
cos0:
cos0:
)sgn()sgn(:
23
23
complexitydepthContourSilhouette
nArtistBoundary
nnnvvValley
nnnvvRidge
eyeneyenContour
B
valleyBAA
ridgeBAA
BA
eye = center of projection – v0
= depth complexity
v3
v2 v0
v1nA nB
n1
n0
A B
eye
![Page 5: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/5.jpg)
5
ChallengeGPU limitations:
No “Edge Processor”No access to adjacencyNo previous state for coherenceCannot create or destroy edge geometry
Vertex Processor
Pixel Processor
Rasterizer
Triangles
Edges
Adjacency
Vertices
x
x
![Page 6: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/6.jpg)
6
Related Work
CPU SilhouettesExhaustive: Sutherland (circa ’77)Randomized: Markosian et al. ’97Cutting sphere: Gooch ’99Dual space: Zorin and Hertzmann ’00
GPU SilhouettesG-Buffer: Saito and Takahashi ’90; McCool ’03 Environment maps: Gooch ’99, Deitrich ’99Halo: Raskar ’01, ’02Pixel Processor + Readback: Brabec and Seidel ’03Edge vertices: Card & Mitchell ’02, Brennan ’03, Gooch ’03(None allow thick lines or brush strokes)
![Page 7: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/7.jpg)
7
Vertex Attributes
GPUs allow 16 vertex “attributes”<position, normal, color, tex coords>
Can store other information…<position, face-normal A, face-normal B>
i.e. adjacent face normals
The edge from v0 to v1 with adjacent faces A and B.
v0
v1
nA nB
A B
![Page 8: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/8.jpg)
8
AgnosticismThe GPU doesn’t care
Attributes don’t have to be texture coords, colorsFace list doesn’t have to describe facesJust has to have the right form
Face list: set of indices into vertex tableVertex attributes: set of 4-vectors
e.g. store information about an EDGE of the model mesh:
In each VERTEX structure we send to the GPUCall these “edge vertices”
![Page 9: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/9.jpg)
9
Edge VerticesMake a new meshEvery edge becomes two vertices
<v0, nA, nB>, <v1, nA, nB>
Connected by a line
Use vertex processor to find vertices on contoursHide non-contours when rendering
Degenerate polygons, = 0, etc.
(nA eye > 0) xor (nB eye >
0)v0
v1
nA nB
A B
![Page 10: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/10.jpg)
10
Our ContributionExtend Edge Vertices with
More edge typesRidge, Valley, SilhouetteSmooth SilhouetteSuggestive Contour
Brush strokesAnimationPlan for Future Hardware
![Page 11: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/11.jpg)
11
The Edge-MeshEvery edge becomes four identical* verticesConnected into a quadrilateralStore adjacent vertices, not face normals
v3
v2 v0
v1nA nB
n1
n0A B
(i) = < v0, v1, v2, v3, n0, n1, r, i >
3D Vectors
* Differentiated by i = {0, 1, 2, 3}
Scalar texture parameter
![Page 12: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/12.jpg)
12
RenderingTest edges on the vertex processor
Feature Edge:Extrude into a screen-space rectangleChoose vertex position from i
Non-Feature Edge:Hide beyond clipping planeEarly-out avoids rasterization overhead
Animation:Animate v and n as a regular vertex and vertex-normal
i=0
i=1
i=2
i=3
v0
v1
![Page 13: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/13.jpg)
13
Result
![Page 14: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/14.jpg)
14
Building a Style
![Page 15: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/15.jpg)
15
![Page 16: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/16.jpg)
16
Performance
![Page 17: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/17.jpg)
17
Thick Lines
Thick quads leave visible gaps at jointsCommon problem (e.g. Raskar ’02)
![Page 18: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/18.jpg)
18
Solution: End Caps
s0 s1
pm0
m1
quad
start cap finish cap“outside”
“inside”
Computed in screen spaceFollow projected normals m0, m1
The only mutual information between adjacent edges!
![Page 19: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/19.jpg)
19
Result
No Caps Caps
Works well for smooth objects…
![Page 20: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/20.jpg)
20
Heuristic can Fail
Vertex normals poorly reflect curvature for this object and our heuristic fails.
![Page 21: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/21.jpg)
21
Heuristic can Fail
Hidden Failures:
Cap is on the wrong side, but the gap is inside the object.
![Page 22: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/22.jpg)
22
Heuristic can Fail
Visible Failure:
Cap is on the wrong side and the gap is outside the object.
![Page 23: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/23.jpg)
23
Analysis of FailureFailure occurs when s is on the “concave” side of joint:
i.e. 2D curvature is negative
Probability of failure increases when:Curvature is high and tessellation is lowVertex normal represents curvature poorly
0or 0 fdseds
fe
![Page 24: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/24.jpg)
24
Brush Textures
![Page 25: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/25.jpg)
25
Screen vs. Object Spaces = vx | vy
Good for still and high-poly models
s0 = r
s1 = r + L
Good for animated low-poly models
Attached to vertices during animation
![Page 26: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/26.jpg)
26
Applications
“Zero CPU cycles were harmed in therendering of the following images.”
![Page 27: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/27.jpg)
27
Bunny-Bot
Crayon-Bot Pen-Bot
Blue Print-Bot Wispy-Bot
Different Strokes
![Page 28: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/28.jpg)
28
Ink & Wash
![Page 29: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/29.jpg)
29
Hidden Line
![Page 30: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/30.jpg)
30
Toon Fur
![Page 31: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/31.jpg)
31
J. Lengyel’s Realistic Fur Algorithm
ShellsStack 16 sparse texturesPerform extrusion in vertex shaderLooks like fur when viewed “head on”Looks like 16 dots when viewed “side on”
FinsStriped texture near CONTOURSLooks like fur when viewed “side on”We move this onto GPU
Anisotropic shadingImages from Lengyel et. al, Real-Time Fur over Arbitrary Surfaces
![Page 32: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/32.jpg)
32
Realistic Fur
![Page 33: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/33.jpg)
33
Shadow Volumes Find polyhedron bounding shadowed points Any intersected surface is shadowed Compute intersection via stencil operations
Caps
– At the object and infinity
– E. Lengyel implemented with GPU Sides
– Find CONTOUR edges
– Extrude each one into a quad
Dark Cap (at infinity)
Light Cap
SideSide
![Page 34: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/34.jpg)
34
Shadows
![Page 35: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/35.jpg)
35
Zorin-Hertzmann Smooth Silhouettes
v0 v1
v2
A
n2
n1n0
B
Extend edge vertex to <v0, v1, v2, v3, n0, n1, n2, n3, r, i>
Define an “above-water” function f = eye • n
Either 0 or 2 edges have zero-crossings in f
Estimate zero-crossing points A, B and connect them
f0= 0.8
f2= -0.1
f1= -0.2
fA 0
fB 0
![Page 36: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/36.jpg)
36
Animation
![Page 37: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/37.jpg)
37
DeCarlo et. al’s Suggestive Contours*
Smooth silhouettes with new above-water function Only stroke when “ ”
– i.e.
Pack 1, 2, t1, t2, n, v (x4, for a quad) into edge vertex
0 rw 2
222
11 TwTwf
2)()( BAtwBABfAf d
A
B
![Page 38: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/38.jpg)
38
* Don’t try our S.C. method at home on GeForceFX… it is too hard to squeeze the curvature data into only 16 attributes!
Just use DeCarlo’s image space algorithm, or…
![Page 39: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/39.jpg)
39
GeForce 6800GeForce 6800 and Radeon X800 support texture reads in the vertex processor. Commercially available by August.
Pointers (stored in textures) cut redundant data.
Using 16-bit pointers:
Current: E = <v,v,v,v,n,n,r,i> x 4 = 304 bytes
New: E = <ptr, i> x 4 + <#,#,#,#,r> = 14 bytes
20x improvement!
(# is a pointer to a regular mesh vertex)
![Page 40: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/40.jpg)
40
GeForce 7800?
DirectX Next specification allows geometry to be created and destroyed– this eliminates the need for degenerate quads…
![Page 41: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/41.jpg)
41
Follow-UpJorn Loviscach extended our method to halos with MAX alpha blending and suggests a new curved silhouette algorithm.
![Page 42: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/42.jpg)
42
Acknowledgements
Evasion Group, INRIA Rhone-AlpesNVIDIATomer Moscovich
![Page 43: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/43.jpg)
43
![Page 44: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/44.jpg)
44
Feature Expressions
1 :
:~|
cos0:
cos0:
)sgn()sgn(:
23
23
complexitydepthContourSilhouette
nArtistBoundary
nnnvvValley
nnnvvRidge
eyeneyenContour
B
valleyBAA
ridgeBAA
BA
eye = center of projection – v0
= depth complexityv3
v2 v0
v1nA nB
n1
n0
A B
eye
<v0, v1, v2, v3, n0, n1, r, i>
nA = (v1 – v0) (v2 – v0)
nB = (v3 – v0) (v1 – v0)
![Page 45: 1 Hardware Feature Edges June 7, 2004 Morgan McGuire and John F. Hughes Brown University NPAR 2004 Hardware Feature Edges.](https://reader035.fdocuments.us/reader035/viewer/2022062714/56649d3a5503460f94a145d2/html5/thumbnails/45.jpg)
45
Silhouettes
1. Set S := (S + 1) mod 255 2. If S == 0 then clear stencil buffer to 255 3. Render the model, setting stencil to S wherever the depth test passes 4. Set the stencil test to pass where stencil
== S 5. Render contour edges