+ All Categories
Home > Documents > Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer...

Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer...

Date post: 22-May-2020
Category:
Upload: others
View: 6 times
Download: 0 times
Share this document with a friend
30
Ray Casting of Trimmed NURBS Surfaces on the GPU Hans-Friedrich Pabst Jan P. Springer Andr´ e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ ohlich Bauhaus University Weimar · Faculty of Media · Virtual Reality Systems Group IEEE Symposium on Interactive Ray Tracing 2006 1 / 21
Transcript
Page 1: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

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

Page 2: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

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

Page 3: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

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

Page 4: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

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

Page 5: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

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

Page 6: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

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

Page 7: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

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

Page 8: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

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

Page 9: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

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

Page 10: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

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

Page 11: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

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

Page 12: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

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

Page 13: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

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

Page 14: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

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

Page 15: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

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

Page 16: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

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

Page 17: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

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

Page 18: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

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

Page 19: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

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

Page 20: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

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

Page 21: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

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

Page 22: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

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

Page 23: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

The Trimmed Utah TeapotIteration + Manipulation

Demo 18 / 21

Page 24: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

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

Page 25: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

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

Page 26: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

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

Page 27: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

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

Page 28: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

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

Page 29: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

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

Page 30: Ray Casting of Trimmed NURBS Surfaces on the GPU · on the GPU Hans-Friedrich Pabst JanP. Springer Andr´e Schollmeyer Robert Lenhardt Christian Lessig Bernd Fr¨ohlich Bauhaus University

The End.

Thank you for your attention.

Conclusions 21 / 21


Recommended