Presentation is loading. Please wait.

Presentation is loading. Please wait.

® GDC’99 Subdivision Surfaces with the Pentium ® III Processor Mike Bargeron Senior Software Developer Intel Corporation (480)

Similar presentations


Presentation on theme: "® GDC’99 Subdivision Surfaces with the Pentium ® III Processor Mike Bargeron Senior Software Developer Intel Corporation (480)"— Presentation transcript:

1 ® GDC’99 Subdivision Surfaces with the Pentium ® III Processor Mike Bargeron Senior Software Developer Intel Corporation michael.l.bargeron@intel.com (480) 552-3256 March 18, 1999

2 ® GDC’99

3 ® Pros & Cons of Subdivision Surfaces Pros & Cons of Subdivision Surfaces Content Creation Content Creation Run-time Subdivision Run-time Subdivision Pentium ® III Processor Optimizations Pros & Cons of Subdivision Surfaces Pros & Cons of Subdivision Surfaces Content Creation Run-time Subdivision Pentium ® III Processor Optimizations Agenda

4 ® GDC’99 Platform Performance Trend Platform Performance (MHz) Time 20001989

5 ® GDC’99 High end for best impression Low end for more customers Scalable algorithms are the answer ? Developer's Dilemma

6 ® GDC’99 End User Experience Scalable Algorithm Platform Performance Looks, sounds & feels better! Fixed Algorithm Scalable Algorithms ?

7 ® GDC’99 Procedural detail-enhancement Procedural detail-enhancement Subset of Bezier surfaces (B-Splines) Subset of Bezier surfaces (B-Splines) First used for "reverse engineering" First used for "reverse engineering" Not a progressive mesh technology Not a progressive mesh technology Subdivision Surfaces

8 ® GDC’99 + Good for arbitrary curves and edges + Lower memory requirement + Transform fewer points "Pros" Checklist

9 ® GDC’99 - 4x polygons per iteration - Limited at ultra-low level of detail - Increased artist overhead - CPU-intensive "Cons" Checklist

10 ® GDC’99 Subdivision Final Grade Subdivision surfaces can be a great, scalable technology Subdivision surfaces can be a great, scalable technology

11 ® GDC’99 Pros & Cons of Subdivision Surfaces Pros & Cons of Subdivision Surfaces Content Creation Run-time Subdivision Pentium ® III Processor Optimizations Agenda

12 ® GDC’99 Attributes Attributes Connectivity Connectivity Subdivide Subdivide Control Mesh Control Mesh Edge Edge Valence Valence Buzz Words

13 ® GDC’99 ControlMesh After one subdivision After multiple subdivisions Subdivision Surfaces Example

14 ® GDC’99 Assign attributes Assign attributes smooth crease smooth Assign edge attributes Assign edge attributes smooth crease smooth Derive vertex attributes Derive vertex attributes crease Draw control mesh Draw control mesh Content Creation Generate connectivity Generate connectivity V3 V2 E2 E1 E3 V1

15 ® GDC’99 Hairline Fracture Drawing the Control Mesh Subdivision Design only continuous meshes

16 ® GDC’99 Edge Attributes smooth crease smooth

17 ® GDC’99 Vertex Attributes crease

18 ® GDC’99 Too Much Information Edge Connectivity IndexTypeVertexAVertexBPolygonAPolygonB 0 00112 Vertex Connectivity IndexValenceNeighborsPolygonsEdges 0 41, 3, 6, 72, 3, 5, 60, 1, 10, 11 Polygon Connectivity IndexEdgeAEdge BEdgeC 0 4610

19 ® GDC’99 Necessary Information Output a "Winged-Edge" data structure to reduce overhead Output a "Winged-Edge" data structure to reduce overhead A B CD

20 ® GDC’99 Agenda Pros & Cons of Subdivision Surfaces Pros & Cons of Subdivision Surfaces Content Creation Run-time Subdivision Pentium ® III Processor Optimizations

21 ® GDC’99 ControlMesh After one subdivision After multiple subdivisions Subdivision Surfaces Example

22 ® GDC’99 Bisect edges Bisect edges Reposition original vertices Reposition original vertices Generate new mesh Generate new mesh Run-time Subdivision

23 ® GDC’99 V new = 3A + 3B + C + D 8 A B CD Bisecting an edge Weighted average of edge neighbors

24 ® GDC’99 4 Simple Steps: Compute c 0 for the vertex you are repositioning Calculate c i for each neighbor Multiply each vertex by its coefficient Add results and divide by sum of c i 's Repositioning a vertex

25 ® GDC’99 v’ 0 =  c i v i /  c i i=0 n n a(n) = 5/8 – (3+2 cos (2  /n)) 2 / 64 b(n) = ( 3 + 2 cos (2  /n)) / 8 Coefficient constants v0v0 v1v1 v2v2 v3v3 v4v4 v5v5 Repositioning a vertex

26 ® GDC’99 v’ 0 = 6.892 v 0 + v 1 + v 2 + v 3 + v 4 + v 5 6.892 + 1 + 1 + 1 + 1 + 1 c 0 = 5 / a(5) - 5 = 5 /.4205 - 5 = 6.892 c 1 = c 2 = c 3 = c 4 = c 5 = 1 a(5) = 5/8–(3+2 cos (2  /5)) 2 / 64 =.4205 a(n) = 5/8 – ( 3 + 2 cos (2  /n)) 2 / 64 b(n) = ( 3 + 2 cos (2  /n)) / 8 Coefficient constants Weighted average of vertex neighbors Repositioning a vertex

27 ® GDC’99 Generating a New Mesh C2 A2 B2 D2 E2 F2 B1 A1 C1 D1 E1 F1 1 2 A B C D Preserve polygon winding rules

28 ® GDC’99 v0v0 v2v2 v1v1 v3v3 v4v4 v5v5 v6v6 v7v7 v8v8 v Vcount... Repositioning function v' 0 v' 2 v' 1 v' 3 v' 4 v' 5 v' 6 v' 7 v' 8 v’ Vcount... Output Buffer (Reposition)

29 ® GDC’99 e0e0 e1e1 e2e2 e3e3 e4e4 e5e5 e Ecount-1... Subdivision function v' 0 v' 1 v' Vcount... v' Vcount + 1 v' Vcount + 2... v' Vcount + Ecount { { Repositioned Vertices Bisected Vertices Original boundary Output Buffer (Bisection)

30 ® GDC’99

31 ®

32 ®

33 ®

34 ®

35 ® Pros & Cons of Subdivision Surfaces Pros & Cons of Subdivision Surfaces Content Creation Run-time Subdivision Pentium ® III Processor Optimizations Agenda

36 ® GDC’99... X0Y0Z0X1Y1Z1X2Y2Z2X3~~~ 32-byte Boundaries Cache Line split No split... X0Y0Z0A0X0Y1Z1A1X2Y2 Many wasted CPU clocks ! Cache Line Split Stalls

37 ® GDC’99 “Array of Structures” - AoS “Array of Structures” - AoS – Ordinary interleaved data elements – Data typically not 32B aligned – Risk of cache line split stalls struct { float x, y, z, nx, ny, nz; }AoS_xyz_abc[200]; Conventional Data Structures

38 ® GDC’99 Structure of Arrays - SoA (Planar) Structure of Arrays - SoA (Planar) – Data in good order for SIMD – Cache only data that gets used – Avoids cache line splits struct { float x[200], y[200], z[200]; float nx[200], ny[200], nz[200]; }SoA_xyz_abc; Better Order for Subdivision?

39 ® GDC’99 Hybrid SoA - Array of SoA order Hybrid SoA - Array of SoA order – Easy to access memory sequentially – Address with one register plus offsets – Avoid multiple page issues struct { float x_nx[8], y_ny[8], z_nz[8]; }Hybrid[50]; Ideal Order for Subdivision?

40 ® GDC’99 Array-of-Structures X0Y0Z0NX0NY0 NZ0X1 Y1... Structure-of-Arrays X0NX0X1NX1... Y0NY0Y1NY1... Z0NZ0Z1NZ1... Hybrid Structure MTMT X0NX0X1NX1Y0NY0Y1NY1... Z0NZ0 Loading Vertex Data xmm0 X0NX1X1NX0 xmm1 X7NX3X3NX7 xmm2 X2NX8X8NX2

41 ® GDC’99 xmm2 xmm3 xmm0 xmm1 movlps NX 7 X7X7 movlps c i7 NX 3 X3X3 movhps c i3 movhps movlps NX 0 X0X0 movlps c 0 (0) c 0 (1) movhps NX 1 X1X1 movhps mulps Exploiting the Streaming SIMD Extensions™ CNX 0 CX 0 CNX 1 CX 1 CNX 7 CX 7 CNX 3 CX 3 mulps

42 ® GDC’99 Exploiting the Streaming SIMD Extensions™ c 0 (0) c 0 (1) c i7 c i3 addps CNX 0 CX 0 CNX 1 CX 1 CNX 7 CX 7 CNX 3 CX 3 addps NX 0 X0X0 NX 1 X1X1 C0C0 C0C0 C1C1 C1C1 divps NX 0 'X0'X0'NX 1 'X1'X1'

43 ® GDC’99  11 bits of precision  11 bits of precision Newton-Raphson Newton-Raphson – rcp_a = 2 * rcp(a) - a * rcp(a)^2 – rsqrt_a = 0.5 * rsqrt(a) * ( 3 - (rsqrt(a)^2) ) Approximation Instructions

44 ® GDC’99 NX 0 X0X0 NX 1 X1X1 1/C 0 1/C 1 mulps NX 0 'X0'X0'NX 1 'X1'X1'C0C0 C0C0 C1C1 C1C1 rcpps Approximation Instructions

45 ® GDC’99 Optimizations Some subdivision can be done real-time on Pentium ® III processor Some subdivision can be done real-time on Pentium ® III processor

46 ® GDC’99 Great scalable technology Great scalable technology Continuous, winged-edge meshes Weighted averages of neighbors Optimize for the Pentium ® III processor for real-time subdivision In Summary

47 ® GDC’99 Q & A

48 ® GDC’99 References Piecewise Smooth Surface Reconstruction, Hugues Hoppe, Tony DeRose, Tom Duchamp, Hubert Jin, Mark Halstead, John McDonald, Jean Schweitzer, Werner Stuetzle, pp. 295-302 in Siggraph 94 Conference Proceedings, July 1994. Edge Based Data Structures for Solid Modeling in Curved- Surface Environments, K. Weiler, IEEE Computer Graphics and Applications, Vol. 5. No. 1, January, 1985. Fast Rendering of Subdivision Surfaces, K. Pulli and M. Segal, Siggraph 96 Conference Proceedings, 1996. Smooth Subdivision Surfaces Based on Triangles, C. Loop, University of Utah Master's Theseis, 1987.


Download ppt "® GDC’99 Subdivision Surfaces with the Pentium ® III Processor Mike Bargeron Senior Software Developer Intel Corporation (480)"

Similar presentations


Ads by Google