ray casting of trimmed nurbs surfaces on the gpu · on the gpu hans-friedrich pabst janp. springer...
TRANSCRIPT
Ray Casting of Trimmed NURBS Surfaceson the GPU
Hans-Friedrich Pabst Jan P. Springer Andre SchollmeyerRobert Lenhardt Christian Lessig Bernd Frohlich
Bauhaus University Weimar · Faculty of Media · Virtual Reality Systems Group
IEEE Symposium on Interactive Ray Tracing 2006
1 / 21
OverviewI GPUCAST system
I Framework for single pass ray casting on the GPUI Generic library: algorithms, data structuresI Type/value transform iterators on the GPUI Shader metaprogrammingI Scene graph integration
I PublicationI Pabst, Springer, Schollmeyer, Lenhardt, Lessig, Froehlich:
Ray Casting of Trimmed NURBS Surfaces on the GPU
Introduction 2 / 21
Motivation
I Trimmed NURBS surfacesI CAD standard
I Ray castingI Direct renderingI Pixel-accurate
I GPUI Lots of gigaflops per value
Main Goal
Interactive rendering of trimmed NURBS surfaces using ray castingon commodity hardware.
Introduction 3 / 21
Motivation
I Trimmed NURBS surfacesI CAD standard
I Ray castingI Direct renderingI Pixel-accurate
I GPUI Lots of gigaflops per value
Main Goal
Interactive rendering of trimmed NURBS surfaces using ray castingon commodity hardware.
Introduction 3 / 21
NURBS
I NURBS surfaces providelocal and explicit control
I Primitives included, e. g.curve, sphere, cone, cube
I Compact representation
I Continuity between curves and patches
I Trimming allows complex boundaries and topologies
Introduction 4 / 21
Outline
I Integrate NURBS primitives into hardware graphics pipeline
I Ray-NURBS intersection and accurate trimming on the GPU
I Demonstration
I Results and conclusions
Introduction 5 / 21
Surface Rendering: Algorithm Overview
Transform
Create Rays
Shading
IntersectionCalc.
Primitive
Result
I PreprocessingI Create bounding volume
(convex hull)I Send vertices and
parametric data
I For each surfaceI Transform convex hullI Rasterize convex hullI Compute ray-surface
intersectionI TrimmingI Shading
Surface Rendering 6 / 21
Surface Rendering: Algorithm Overview
Screen
CPU
Transform
Create Rays
Shading
IntersectionCalc.
Primitive
Result
I PreprocessingI Create bounding volume
(convex hull)I Send vertices and
parametric data
I For each surfaceI Transform convex hullI Rasterize convex hullI Compute ray-surface
intersectionI TrimmingI Shading
Surface Rendering 6 / 21
Surface Rendering: Algorithm Overview
Screen
CPU
VertexUnit
RasterUnit
Transform
Create Rays
Shading
IntersectionCalc.
Primitive
Result
I PreprocessingI Create bounding volume
(convex hull)I Send vertices and
parametric data
I For each surfaceI Transform convex hullI Rasterize convex hullI Compute ray-surface
intersectionI TrimmingI Shading
Surface Rendering 6 / 21
Surface Rendering: Algorithm Overview
Screen
CPU
FragmentUnit
VertexUnit
RasterUnit
Transform
Create Rays
Shading
IntersectionCalc.
Primitive
Result
I PreprocessingI Create bounding volume
(convex hull)I Send vertices and
parametric data
I For each surfaceI Transform convex hullI Rasterize convex hullI Compute ray-surface
intersection
I TrimmingI Shading
Surface Rendering 6 / 21
Surface Rendering: Algorithm Overview
CPU
RenderTarget
Transform
Create Rays
Shading
IntersectionCalc.
Primitive
Result
RasterUnit
Mem
ory
FragmentUnit
VertexUnit
Screen
I PreprocessingI Create bounding volume
(convex hull)I Send vertices and
parametric data
I For each surfaceI Transform convex hullI Rasterize convex hullI Compute ray-surface
intersection
I TrimmingI Shading
Surface Rendering 6 / 21
Numeric Intersection Computation
I Evaluation: (uv)→ (x , y , z)Solving: (x , y , z)→ (uv)
I Methods: general root finding vs. geometrical contextI SubdivisionI Numerical (iterative)I AlgebraicI Hybrid
I Newton IterationI Only parameters of one step necessaryI Only function values and partial derivatives neededI Quadratic convergence
Surface Rendering 7 / 21
Initial Values for the Newton Iteration
Problem: An approximate solution is needed to get a solution
� Information about geometrical context can be used
Ray
I Two complementary approaches: subdivision and uv -texturing
I Motivation: good initial values will result in fast convergence
Surface Rendering 8 / 21
Subdivision of the Convex Hull
I Quadratically increasing tightnessI Trade-off between ray casting and
standard graphics pipelineI Minimizes number of fragments/raysI Number of vertices increased
I Adaptive subdivisionI Minimizes number of
generated vertices
I Union of all convex hullsI Approximation of the surface
Surface Rendering 9 / 21
uv -Texturing
I Idea: interpolated guess for each rayI Associate an initial value (vertex
attribute) with each vertexI Complement outer control pointsI Mapping parameter range between
I Subdivision-aware
I Subdivsion increases qualityI Problem
I Good heuristic for points of thecontrol mesh
I Invalid for some edges/faces ofthe convex hull
0
⅓ ⅔
1
t = 0.75
Surface Rendering 10 / 21
Trimming: Algorithm Overview
I Ray casting in parameter domain
I Similar to point-in-polygon test
I Bezier form provides exactrepresentation of NURBS curves
I Accurate intersection computationusing Bezier Clipping
odd
odd
even
Trimming 11 / 21
Bezier Clipping
I Numerical root finding algorithm (subdivision)
I Makes use of the convex hull property
u
d2
d0
d3
d1
v
td1
d
d0
d2
d3
⅔
⅓
1
I Transformation into local equidistant coordinate system,invariant with respect to the intersection points
Trimming 12 / 21
Bezier Clipping (cont.)
t
d
t
d
tmax
tmin
I Compute convex hull intersections with t-axis
I Split curve at tmin and tmax (”clipping”)
I Interval contraction driven by clipping and subdivision
Trimming 13 / 21
Iterative Bezier Clipping
Problem: Subdivision implies recursive processing ofsub-intervals
hit
clip
subdivide
clip
subdivide
clip
I Only two intervals at a time are needed
I Only one scalar value needed to represent remaining interval
Trimming 14 / 21
Iterative Bezier Clipping (cont.)
I Favors re-computation over storing values
I Consists of a state machine inside a loop tosimulate function calls
I Intersection test takes advantage ofBernstein-Bezier form
I PropertiesI Iterative depth-first algorithmI Enumerates roots in ascending order
”This is the first implementation of a subdivision-likesingle pass algorithm on current graphics hardware.”
Trimming 15 / 21
Direct Trimming
I Interactive manipulation of existing control points possible
I Complements the direct rendering of surfaces
I Can also be used for trimming triangulated patches
Trimming 16 / 21
Limitations
I Hardware and tool chainI Registers, writeable memoryI Compiler, graphics driver, debugging
I AlgorithmI Artifacts (ray-surface intersection)I Trimming without acceleration data
structure
I Large modelsI Usually one program per surfaceI Limited degree (≈ 6× 6):
M + 2N ≤ 19 with N ≤ M
Limitations 17 / 21
The Trimmed Utah TeapotIteration + Manipulation
Demo 18 / 21
Results
Figure Triangles Subdivision FPS4 FPS8
Duck3732 1× 1 18 15
15648 2× 2 20 1663602 4× 4 20 16
Teapot3092 2× 2 33 24
12698 4× 4 36 2851160 8× 8 30 25
TeapotOrient3092 2× 2 22 18
12698 4× 4 24 1951160 8× 8 22 18
TeapotNV3092 2× 2 18 15
12698 4× 4 19 1651160 8× 8 17 15
Resolution 1280× 1024, screen covering 80 % of width, GPU Geforce 7900GT
Results 19 / 21
Results
Figure Triangles Subdivision FPS4 FPS8
Duck3732 1× 1 18 15
15648 2× 2 20 1663602 4× 4 20 16
Teapot3092 2× 2 33 24
12698 4× 4 36 2851160 8× 8 30 25
TeapotOrient3092 2× 2 22 18
12698 4× 4 24 1951160 8× 8 22 18
TeapotNV3092 2× 2 18 15
12698 4× 4 19 1651160 8× 8 17 15
Resolution 1280× 1024, screen covering 80 % of width, GPU Geforce 7900GT
Results 19 / 21
Results
Figure Triangles Subdivision FPS4 FPS8
Duck3732 1× 1 18 15
15648 2× 2 20 1663602 4× 4 20 16
Teapot3092 2× 2 33 24
12698 4× 4 36 2851160 8× 8 30 25
TeapotOrient3092 2× 2 22 18
12698 4× 4 24 1951160 8× 8 22 18
TeapotNV3092 2× 2 18 15
12698 4× 4 19 1651160 8× 8 17 15
Resolution 1280× 1024, screen covering 80 % of width, GPU Geforce 7900GT
Results 19 / 21
Results
Figure Triangles Subdivision FPS4 FPS8
Duck3732 1× 1 18 15
15648 2× 2 20 1663602 4× 4 20 16
Teapot3092 2× 2 33 24
12698 4× 4 36 2851160 8× 8 30 25
TeapotOrient3092 2× 2 22 18
12698 4× 4 24 1951160 8× 8 22 18
TeapotNV3092 2× 2 18 15
12698 4× 4 19 1651160 8× 8 17 15
Resolution 1280× 1024, screen covering 80 % of width, GPU Geforce 7900GT
Results 19 / 21
Conclusions
I Direct renderingI Ideal solution for CADI Low CPU overheadI Minimal storage
I Pixel-accurateI SilhouettesI InterpenetrationsI Normals
I Future WorkI Reliable ray-surface
intersection testI Trimming acceleration
data structure
”Higher order primitives willcomplement triangles as theprimary rendering primitive.”
Conclusions 20 / 21
Conclusions
I Direct renderingI Ideal solution for CADI Low CPU overheadI Minimal storage
I Pixel-accurateI SilhouettesI InterpenetrationsI Normals
I Future WorkI Reliable ray-surface
intersection testI Trimming acceleration
data structure
”Higher order primitives willcomplement triangles as theprimary rendering primitive.”
Conclusions 20 / 21
The End.
Thank you for your attention.
Conclusions 21 / 21