Triangle Meshes Two main parts: Mesh Compression Mesh Compression Connectivity: � Often, triangulated graph CS101 - Meshing � Sometimes, polygons � 3-connected graphs Geometry: � Positions in space CS101b - Meshing 2 Basic Definitions (I) Basic Definitions (II) Vertex: node V vertices Valence of a vertex: number of emanating edges Edge: between 2 vertices - E edges Face: face between edges - F faces Degree of a face: Euler Formula: F – E + V = 2(c-g) –b number of edges around c: # of connected components g: genus b: # of boundary edges CS101b - Meshing CS101b - Meshing 3 4 History of Multimedia Compression (De)Compression of 3D Meshes: Success of Digital Signal Processing (DSP) � Sounds, images, videos � Huge meshes � Technology followed scientific evolution � Arbitrary topology � Compression allows small download times � Irregular connectivity � MP3, JPEG, MPEG… � Non-uniform sampling I am too fat…. 70 80 90 00 text sound images video geometry CS101b - Meshing CS101b - Meshing 5 6 Page 1
A Common Format: VRML Geometry - Naïve Encoding Vertices V R M L (geometry) v1 (x1;y1;z1) Vertices Faces Naïve: (geometry) (connectivity) v2 (x2;y2;z2) 3 * float 3 2 = 9 6 b/ v v1 (x1;y1;z1) f1 (v1;v3;v2) v3 (x3;y3;z3) v2 (x2;y2;z2) f2 (v4;v3;v1) v4 (x4;y4;z4) v3 (x3;y3;z3) f3 (v4;v1;v5) v5 (x5;y5;z5) v4 (x4;y4;z4) f4 (v1;v6;v5) Direct ( quantization) : v6 (x6;y6;z6) v5 (x5;y5;z5) f5 (v6;v1;v7) 3 * 1 0 bits = 3 0 b/ v v6 (x6;y6;z6) f6 (v2;v7;v1) v7 (x7;y7;z7) v7 (x7;y7;z7) f7 (…) Valence n: n redundancies → average 6 CS101b - Meshing CS101b - Meshing 7 8 Connectivity -Naïve Encoding And Yet… Far from Optimal From a census of planar maps [Tutte ’64], Faces ( ) + #triangulation(V) = 2 4 V 1 ! (connectivity) ( ) ( ) ! f1 (v1;v3;v2) + + 3 V 2 ! V 1 Naïve: f2 (v4;v3;v1) 3 * int 3 2 = 9 6 bit/ face f3 (v4;v1;v5) For large V (>1000), ⎛ ⎞ ≈ 1 9 2 b/ v 256 V ⎜ ⎟ ⎛ ⎞ f4 (v1;v6;v5) log V 256 2 = ⎝ ⎠ 3 . 24 #triangulation(V) ≈ ⎜ ⎟ 27 V 2 2 f5 (v6;v1;v7) Direct: ⎝ ⎠ 27 f6 (v2;v7;v1) 3 * log 2 ( V) bit/ face f7 (…) ≈ 5 0 b/ f for 1 0 0 k vertices Theoretical connectivity bound: 3.24b/v ≈ 1 0 0 b/ v CS101b - Meshing CS101b - Meshing 9 10 A Look at Data Compression Lossless Encoding Data compression: Data compression: Data Data Data Data 0 1 1 00 1 0 01 0 00 1 00 0 1 0 1 1 00 1 0 01 0 00 1 00 0 1 … … Storing data in a format that requires Storing data in a format that requires encoding encoding decoding decoding less space than usual = packing data less space than usual = packing data = = Improves: Improves: Well suited for text, files, medical data, … •Storage Big file •Transmission Goal: Remove all redundancy •Retrieval Small file CS101b - Meshing CS101b - Meshing 11 12 Page 2
Lossy Encoding The Notion of Entropy First, decompose a data set into a sequence of events. Data Data Data Data 0 1 1 00 1 0 01 0 01 0 1 1 00 1 0 01 0 01 … … Entropy: encoding encoding decoding decoding Smallest possible expected numbers of bits needed to != != encode a sequence of events. Well suited for sound, images, videos, etc… Goal: Remove unnoticeable features, then all redundancy p i = probability of occurrence of event i CS101b - Meshing CS101b - Meshing 13 14 Entropy Encoding Run-Length Encoding Run: consecutive values The game: Find bit-rate closest to entropy Example: Sequence: The idea: R T A A A A A A S D E E E E E Give shortest codewords to most probable events. Replaced by: Two problems: R T *6A S D *5E 1. How to turn this notion into an algorithm? 2. How to benefit from statistical modeling? CS101b - Meshing CS101b - Meshing 15 16 Dictionary methods Huffman Encoding Generate codes with variable length The idea: many data types contain repeating - Higher probabilities → shorter code words patterns → find an earlier occurrence in the input data, and only output a pointer/length. - Lower probabilities → longer code words Extensions: Cons: Symbol Code word - combined with Huffman, etc. A 0 - Integer code length - Must transmit probabilities B 10 Extensions: C 110 [Lempel- -Ziv 77] Ziv 77] [Lempel - Adaptive (non stationary data) D 111 lha, arc, arj, zip - Extended (groups of symbols) CS101b - Meshing CS101b - Meshing 17 18 Page 3
Arithmetic Encoding Statistical Modeling Pros: Massaging the data can pay off - Non-integer code length - Delta-encoding - Optimal for large #symbols -> (entropy + ε ) b/symbol - Prediction Cons: - Transform - Must transmit probabilities Extensions: Prior knowledge on the data helps - adaptive (avoid transmission of probabilities) - order-n: inter-symbol probability - stack-run: coupled with detection of runs CS101b - Meshing CS101b - Meshing 19 20 Example of Lossy encoding Needs in 3D Encoding (I) Typically: Order of transmission: 1) Transform Single-rate coders: DCT Encode a mesh in one single bitstream. Wavelets Bloc sorting, Distance coding, etc. Also called single-resolution coders. 2) Quantization Progressive coders: Scalar Vector Encode a mesh as successive 3) [Detection of runs] refinements. 4) Entropy encoding Coarse-to-fine style. CS101b - Meshing CS101b - Meshing 21 22 Needs in 3D Encoding (I) Needs in 3D Encoding (II) Integrity of encoding: Order of transmission: Lossless coders: Single-rate Preserve connectivity and/or geometry. For: collaborative design, games, medical data… Lossy coders: T r a n s m i s s i o n Optimize the ratio rate/distortion For: geometry over the internet, e-commerce… Progressive CS101b - Meshing CS101b - Meshing 23 24 Page 4
Needs in 3D Encoding (III) Part I Additional features: Resilience: robust to packet loss Single-Rate Codecs Efficiency: fast, or low memory requirements Guaranteed bounds: ensuring max bit rate Scalability: max speed vs min bit rate Etc… CS101b - Meshing CS101b - Meshing 25 26 Redundancy and VRML Naïve Encoding Connectivity Geom etry f1 (v1; v3; v2) v1 ( x1 ;y1 ;z1 ) V R M L f2 (v4; v3; v1) v2 ( x2 ;y2 ;z2 ) Vertices Faces f3 (v4; v1; v5) v3 ( x3 ;y3 ;z3 ) (geometry) (connectivity) v4 ( x4 ;y4 ;z4 ) f4 (v1; v6; v5) v1 (x1;y1;z1) f1 (v1;v3;v2) v5 ( x5 ;y5 ;z5 ) f5 (v6; v1; v7) v2 (x2;y2;z2) f2 (v4;v3;v1) v6 ( x6 ;y6 ;z6 ) v3 (x3;y3;z3) f3 (v4;v1;v5) f6 (v2; v7; v1) V = 50k v4 (x4;y4;z4) f4 (v1;v6;v5) v7 ( x7 ;y7 ;z7 ) f7 (… ) v5 (x5;y5;z5) f5 (v6;v1;v7) -> 3V float -> 3F log 2 (V) ~ 6V log 2 (V) v6 (x6;y6;z6) f6 (v2;v7;v1) v7 (x7;y7;z7) f7 (…) 9 6 b/ v ~ 1 00 b/ v Valence n ~ redundancy -> average 6 to give an order of magnitude CS101b - Meshing CS101b - Meshing 27 28 Single-Rate Encoding Link to Other Fields In Graph Theory, some previous work Review: 3 main approaches based on: � Review: 3 main approaches based on: � � Graphs can be huge, so encoding is good − Triangle strips Triangle strips − � But mainly designed to compress (nearly) − Edge/gate traversal Edge/gate traversal complete graphs − � Far away from our 3-connected graphs − − Valence Valence � Different approaches � Recent developments Recent developments � � using Lipton-Tarjan for instance [DL98] − Improvement − Improvement − Hint of optimality − Hint of optimality CS101b - Meshing CS101b - Meshing 29 30 Page 5
Triangle Strips Deering 95 (I) Connectivity: - Generalized triangle strips - Vertex buffer (size: 16) Idea: use stack operations to reuse vertices. → reduce random access to vertices Geometry: - Quantization, Delta coding and Huffman CS101b - Meshing CS101b - Meshing 31 32 Deering 95 (II) Deering 95 (III) Features: - Fast - Local → well suited for hardware - 8-11 b/v for connectivity - Geometry: highly variable - Integrated in JAVA 3D Redundancy ~ 2 One symbol per face → 2V symbols CS101b - Meshing CS101b - Meshing 33 34 Taubin & Rossignac 98 (I) Taubin & Rossignac 98 (II) The idea: Geometry: Cut a mesh by using 2 interlocked trees: - Prediction from multiple ancestors - a spanning tree of vertices, of the vertex tree - a spanning tree of triangles. Features: Connectivity: vertex tree - average: 4 b/v for connectivity - Spanning trees - Marching pattern → zigzag walking CS101b - Meshing CS101b - Meshing 35 36 Page 6
Recommend
More recommend