47
View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Embed Size (px)

Citation preview

Page 1: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

View-dependent Adaptive Tessellation of Spline Surfaces

Jatin Chhugani & Subodh Kumar

Johns Hopkins University

Page 2: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Motivation

Why use Splines?

• CAD/CAM , Entertainment Industry

• Medical Visualization

• Examples– Submarines– Animation Characters– Human body especially the heart and brain

Page 3: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Garden Model ( 38,646 patches)

Page 4: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Splines

• Non-Uniform Rational B-Spline (NURBS)

• Bezier patch (rational)

Degree m x n

Domain space (u, v) [0,1] x [0,1]

For 0 i m, 0 j n,

Control points : pij

Weights: wij

Page 5: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

m n

wijpij Bm

i(u) Bn

j (v)

i=0 j=0

F(u,v) =

m n

wij Bm

i(u) Bn

j (v)

i=0 j=0

where

Bernstein function Bn

i (t) = t i (1- t)

n-i

Page 6: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Rendering Splines• Ray tracing

– J. Kajiya, T. Nishita et al., J. Whitted

• Pixel level surface subdivision– E.Catmull, M. Shantz et al.

• Scan-line based– J. Blinn, J. Lane et al., J. Whitted

• Polygonal Approximations– Forward (static)– Backward (dynamic)

Page 7: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Forward Technique• View-dependent tessellation

• Incremental triangulation

Backward Technique• Pre-tessellate patches densely

• Apply polygon simplification

Page 8: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Forward TechniqueAdvantage• Allows arbitrary precision

Disadvantage• Significant computation overhead

Backward TechniqueAdvantage

• Low run-time computation

Disadvantages

• Large storage requirement

• Upper limit on detail of the model

Page 9: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Our Approach

• Hybrid of backward and forward techniques

• Pre-compute domain samples

• Select samples and triangulate dynamically

• Generate additional detail when necessary

Page 10: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Sampling the Domain Space

Page 11: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Domain Space Tessellation

• Uniform Tessellation

• Adaptive Tessellation

Page 12: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Uniform Tessellation

Domain Space

Page 13: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Uniform Tessellation

• Fast– Step size computation– Triangulation

• Over-tessellation– Triangle Rendering Bottleneck

Page 14: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Adaptive Tessellation

Domain Space

Page 15: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Adaptive Tessellation

• Generates triangles only where needed

• Inefficient– Many ‘stopping test’ computations– Triangulation algorithm not simple

Page 16: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Basic Idea• Pre-sample adaptively to some precision

– Maintain samples in ‘order of importance’– More importance in the areas of high curvature

• At rendering time– Select samples– Triangulate

• If higher precision needed– Perform uniform tessellation

Page 17: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Pre-Sampling

Choose samples on each patch

Page 18: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Questions: #1

For a predefined deviation (between the surface and its triangulation) threshold, what is the minimum number of points required on a patch for a given position and orientation of the patch? And where?

Computationally Intractable

Page 19: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Questions: #2

Is there a correlation between these points as the viewing parameters change?

Not Always.

Page 20: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Deviation = Δ0 Deviation = Δ1 (< Δ0)

No common points (except the end points)

Figure 1 Figure 2

Page 21: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Heuristic

Given a triangulation of a surface that deviates by more than Δ, add samples at the points of highest deviation until the resulting deviation is less than Δ.

Page 22: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Pre-Processing Algorithm

Page 23: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Pre-Sampling

Domain Space

1 2

3 4

Page 24: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Pre-Sampling

Point B

Point A

Point of maximum object space deviation for a triangle

1 2

3 4

Page 25: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Pre-Sampling

5

Domain Space

1 2

3 4

Page 26: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Pre-Sampling

5

Point of maximum object space deviation for a triangle

1 2

3 4

B

A

D

C

Page 27: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Pre-Sampling

5

Domain Space

1 2

3 4

6

Page 28: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

What is stored ?

• Ordered set of (u,v) pairs – by decreasing deviation

• Deviation in object space– i.e., deviation after the sample is added

• 3-d Vertex– optional

Page 29: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Rendering Time Algorithm

Given screen space deviation bounds

Page 30: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Scaling Factor for a patch

Scaling Factor for a vector at point P =

Minimum ratio of the length of the vector to its projected length on the image plane.

Image PlaneEye

Q

PP

Q Ratio = |''|

||

QP

PQ

Page 31: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Scaling Factor for a patch

• Pre-processing– Partition space– For each patch, use the partition containing it– If too many partitions for a patch, subdivide patch

• Run-time (for each frame)– Compute the scaling factor for each partition – Scaling factor a patch is that of its partition

Page 32: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Runtime Algorithm

• Compute max allowable deviation (say c)

• Let p = max deviation in current triangulation

• if (c > p)– delete domain samples having deviation less than c – update triangulation

Page 33: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Example

P1 P2 P3 P4 P5 P6 P7 P8UV Values

Deviation 26 24 21 19 14 13 6 3

Here p = 3

Let c = 20

P1 P2 P3 P4

Deviation 26 24 21 19

UV Values

Page 34: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Runtime Algorithm

• if (c < p) – add domain samples having deviation greater than c

– update triangulation – if pre-computed set is exhausted

• Uniformly tessellate triangles having deviation greater than c

Page 35: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Adaptive + Uniform Tessellation

Pre-computed SamplesComputed at run time to uniformly tessellate triangles having deviation greater than threshold

Page 36: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Potential Problem

Cracks in the model

Page 37: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Crack

Page 38: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Crackv

u

Boundary Curve

Different samples on adjacent boundary curves

Samples on the boundary curve for left patchSamples on the boundary curve for the right patch

Page 39: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Crack Prevention

• Sample the boundary curves separately from the interior, to prevent cracks in adjacent patches.

• Modify the interior patch sampling by deleting points too close to the boundary.

Page 40: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Crack Prevention

v

u

Boundary Curve

Same samples on adjacent boundary curves

Samples on the boundary curve for the two adjacent patches

Page 41: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Results

Model details

Page 42: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Results

Pre-sampling Performance

Page 43: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Results

Comparison for average number of triangles generated per frame

[20]: “Interactive display of large NURBS models” by S. Kumar, D. Manocha and A. Lastra

Page 44: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Results

Run-time behavior of our algorithm

Page 45: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Conclusions

• Combines forward and backward techniques

• Uses adaptive and uniform tessellation

• Low triangle count, small memory footprint

• Applicable to class of parametric surfaces

• Towards real-time spline surface rendering

Page 46: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

Acknowledgements

• Shankar Krishnan

• Lifeng Wang

• UBC Modeling group

• Alpha 1 Modeling system

• National Science Foundation

Page 47: View-dependent Adaptive Tessellation of Spline Surfaces Jatin Chhugani & Subodh Kumar Johns Hopkins University

The End.