Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Subdivision. 2 Subdivision for game Why? Large model require many memory for storage Need to dynamically tessellated during game play Make surface modeling.

Similar presentations


Presentation on theme: "1 Subdivision. 2 Subdivision for game Why? Large model require many memory for storage Need to dynamically tessellated during game play Make surface modeling."— Presentation transcript:

1 1 Subdivision

2 2 Subdivision for game Why? Large model require many memory for storage Need to dynamically tessellated during game play Make surface modeling easier How to method Convert surface patches to a set of triangles

3 3 Classify of surface patch Rectangle patches Triangle patches Cylinder patches Spheres or ellipsoids Two variations of subdivision Uniform Non-uniform

4 4 Subdivision of Bezier rectangles patches Uniform subdivision Subdivided by uniformly tessellating the parameter space to a specified level L>=0 Total vertex number : Total face number : L=0L=1 Parameter space for a rectangle patch

5 5 Subdivision of Bezier rectangles patches Non-uniform subdivision Problem recursive uniform subdivision Ignores two important aspects of rendering surfaces Patch may be flat in some sub-blocks Surface might be far away from the eye point Using the Non-uniform subdivision If Second derivatives is large, applying subdivision If second derivatives is small, not applying subdivision

6 6 Subdivision of Bezier rectangles patches Adjustments for the camera model To decide whether or not to subdivide Test the lengths of the nonlinear terms V If surface is near the eye point  accept subdivision If surface is far from the eye point  don’t accept subdivision Heuristic method (by Sharp, 1999) To get an estimate of the length of the projection of into screen space Select a slice and compute the width of that slice compute length of the projection of Compute the ratio of the length of to the slice Compare ratio to a tolerance, if small, subdivision accept

7 7 Subdivision of Bezier rectangles patches Cracking Because allow for neighboring blocks to be subdivided to different resolutions Occur the T-junction marked with a solid dot Contain the crack Solve “Sharp(1999)” Has no cracking Solve : Collapse the midpoint vertex to a corner vertex

8 8 Subdivision of Bezier rectangles patches Two processing for non-uniform subdivision To generate the vertices of the final mesh Using depth-first traversal of the quad tree To fix the cracking Subdivision that contains more complicated cracking

9 9 Subdivision of Bezier rectangles patches Partial subdivision By user definition Don’t want to subdivided the right edge (1) Don’t want to subdivided the right and bottom edges (2) Don’t want to subdivided the top and bottom edges (3) Only want to subdivided the top edge (4) (1)(2)(3)(4) (1), (2) : Continue partial subdivision (3), (4) : don’t continue partial subdivision

10 10 Subdivision of Bezier Rectangles Patches How to calculate information for subdivision A B C D Order : A  B  D  C L block : first traversal L block determine subdivision, compute A R block also subdivide, compute B and compute A If C is subdivided, first tinge need to compute D After compute D, compute C

11 11 Subdivision of Bezier Triangle Patches Bezier triangle patches More difficult to subdivide than Bezier rectangle patch more complicated indexing Uniform subdivision Total vertex number : Total face number : L=0L=1 Subdivision of parameter space for a triangle patch

12 12 Subdivision of Bezier Triangle Patches Non-uniform subdivision Use the equivalent of a symmetric triangulation for quad tree blocks A vertex dependency structure Subdivision corresponding binary tree

13 13 Subdivision of Bezier Triangle Patches H-adjacency Two adjacent triangles share the same hypotenuse If want to subdivide H-hypotenuse, the one must also. Apply the following relationships 1. 2.

14 14 Subdivision of Bezier Triangle Patches Pattern for non-uniform subdivision Number of vertices for L Number of triangle for L T = 2 L

15 15 Subdivision of Bezier Cylinder Surface Only the curve boundary need to be subdivided Uniform subdivision Parameter space L(curve direction), M(extruded direction) Similar Bezier rectangle patch Vertex number :, Triangle number : Non-uniform subdivision Cylinder surface which include two boundary curves The boundary curve : Non-uniform subdivision Extruded direction : uniform subdivision L M

16 16 Subdivision of Spheres and Ellipsoids Parameter surface Start inscribed convex triangular mesh an inscribed octahedron mesh with equilateral triangular faces Each triangle produce four triangle Insert midpoint on edge Midpoint move onto the sphere Projection midpoint through the ray on sphere The ray : from the centroid of polyhedron to midpoint Initial mesh centroid Projection processing

17 17 Subdivision of Spheres and Ellipsoids Data structure typedef struct { float x, y, z; } Point3; typedef struct { Point3* point; int numEdges; struct Edge ** edge; }Vertex; typedef struct { struct Vertex* vertex[2]; struct Triangle * triangle[2]; } Edge; typedef struct { struct Vertex* vertex[3]; struct Edge * edge[3]; struct Triangle * adjacent[3]; } Triangle; typedef struct { int numVertices; Vertex * vertex; int numEdges; Edge * edge; int numTriangles; Triangle * triangle; Point3 centroid; } ConvexPolyhedron; Goal - to have no reallocations of memory - to update the data structures in place(efficiently using memory)

18 18 Subdivision of Spheres and Ellipsoids Algorithm Calculate the centroid of the convex polyhedron Average of the current vertices in the polyhedron : Compute the midpoint of the edge Projecting point along the ray between centroid and midpoint on the sphere The ray : New vertex location occur where the ray and sphere intersect Location for the new vertex : : parameter value at the intersection > 1 and the squared length of : 1 Root of quadratic equation :

19 19 Subdivision of Spheres and Ellipsoids Relationship vertex, edge, triangle Working set of vertices, edges, trianglesSubdivided triangle


Download ppt "1 Subdivision. 2 Subdivision for game Why? Large model require many memory for storage Need to dynamically tessellated during game play Make surface modeling."

Similar presentations


Ads by Google