Coding with ASCII: compact, yet text-based 3D content Martin Isenburg Jack Snoeyink University of North Carolina at Chapel Hill and INRIA Sophia-Antipolis
Overview Motivation Polygon Meshes Coding of Indices Position Indices + TexCoord Indices Quantizing & Coding of Coordinates Positions + Texture Coordinates Example Results, Demos & Conclusion
Motivation
Why ASCII? authors “like” text-based 3D formats wide acceptance read & modify scene with any text editor Web3D Developer survey: “very important” many Web3D APIs only support ASCII (rather than supporting two formats) no binary VRML specification
Why Compression? authors “want” compressed 3D content faster download Web3D Developer survey: “very important” data-heavy nodes audio images video geometry interpolators
Approaches readable text-based format: support only ASCII content exception: “standard” binary data VRML and its variants binary format: one (or more) binary files automatically “protects” the content proprietary (Cult, Shockwave, Viewpoint...)
Compression Standards (1) binary compression standards: image data: JPEG, GIF audio data:MP3 movie data:MPEG geometry data:? (MPEG-4/7 ??) interpolator data:? (MPEG-4/7 ??) “read” “edit” “write” software is plentiful
Compression Standards (2) the structure of 3D data is more complex audio : sequence of numbers image : block of numbers video : sequence of blocks of numbers geometry :+ positions + triangles (or polygons ?) + texcoords (1, 2, 3, or 8 layers ?) + normals or smoothing groups (?) + colors (per-face or per-vertex ?) + bones (1, 2 or 3 attachments ?)
Download on Demand java-based browsers Shout3D, Blaxxun3D, CortonaJet, Hotmedia provide decoder with the model. “light-weight” important it has to be downloaded also download less was motivation to compress proposed decoder: >> 5381 bytes <<
Polygon Meshes
Polygon Mesh = Indexed Face Set (IFS) minimally : p positions= float [ 3p ] f faces with c corners= int [ f + c ] optionally : t texCoords= float [ 2t ] f faces with c corners = int [ f + c ]
Example: “a box” IndexedFaceSet { coord Coordinate { point [ , , , , , , , ] } coordIndex [ ] }
coord ( Geometry )
coordIndex ( Connectivity ) face face face face face face
Example: “a textured box” IndexedFaceSet {... texCoord Coordinate { point [ , , , , , , , , , , , , , ] } texCoordIndex [ ] }
0.0 v u texCoord ( Property Values )
texCoordIndex ( Property Mapping ) face face face face face face
Coding of Indices (1) Position Indices
Coding Position Indices > don’t code indices “directly” < Assumption: “order of position doesn’t matter” Approach: “change order of positions” - code connectivity graph - enumerate positions based on traversal order - re-order accordingly > code indices “implicitly” <
Connectivity Coders for Triangle Meshes Topological Surgery, Taubin et al., `97 Triangle Mesh Compression, Touma & Gotsman, `98 Cut-Border-Machine, Gumhold & Strasser, `98 Edgebreaker, Rossignac, `99 for Polygon Meshes Face Fixer, Isenburg & Snoeyink, `00 Degree Duality Coder, Isenburg, `02 Near-Optimal Connectivity Encoding, Khodakovsky, Alliez, Desbrun & Schröder, `02
region growing encodes connectivity graph as a sequence of labels: one label.... per face one label per hole one label per handle labels and fix it all together number of labels = number of edges reverse decoding Face Fixer F4F4 F5F5 R F3F3 LS E HnHn M
Encoding
Encoding F4F
Encoding F4F4 F3F
Encoding F4F4 F3F3 R
Encoding F4F4 F3F3 F5F5 R
Encoding F4F4 F3F3 F5F5 R F5F
Encoding F4F4 F3F3 F5F5 R F5F5 R
Encoding F4F4 F3F3 F5F5 R F5F5 R R
Mapping Labels to ASCII Resulting label sequence: F4F4 F3F3 F5F5 R F5F5 R F4F4... RR F4F4 R R 0 L 1 S 2 E 3 M 4 F3F3 5 F4F4 6 F5F5 7 H3H3 5 6 H4H4 H5H5 7
Decoding R
Decoding R
Decoding F5F
Decoding F5F
Decoding R
Decoding F3F
Decoding F4F
Decoding
Non-Manifold Meshes cut
Coding of Indices (2) TexCoord Indices
Coding TexCoord Indices > don’t code indices “directly” < Assumption: “order of texCoords doesn’t matter” Approach: “change order of texCoords” - code “on top” of connectivity graph - enumerate texCoords based on traversal order - re-order accordingly > code indices “implicitly” <
Per-Corner Mappings “edge bits”, Gumhold & Strasser Real-time compression of triangle mesh connectivity, SIGGRAPH ‘98 “discontinuity bits”, Taubin et al. Geometry coding and VRML, Proceedings of the IEEE ‘98 “vertex and corner bits”, Isenburg & Snoeyink Face Fixer: Compressing Polygon Meshes with Properties, SIGGRAPH ‘00
Vertex and Corner Bits (1)
Vertex and Corner Bits (2)
Vertex and Corner Bits (3) crease vertexcorner vertexsmooth vertex smooth corner crease corner
Encoding 1
0 1 0
Quantizing & Coding of Coordinates
Quantize calculate bounding box (min x, min y, min z ) and (max x, max y max z ) calculate extends of bounding box range x = max x – min x range y = max y – min y … quantize with longest extend getting n bits
Delta Code coordinates are integer numbers only write difference to last resulting sequence has lower dispersion there are much better schemes !!! why delta-coding ??? simple, light-weight implementation submission deadline was close
Decoding Example
code_words [ ] = [ …] size of index arrays [ … ] indices[ ] = texindices[ ] = label E R 0 1
0 code_words [ ] = [ …] [ … ] indices[ ] = texindices[ ] = R label 1 2 R
code_words [ ] = [ …] [ … ] indices[ ] = texindices[ ] = R label F4F4
[ … ] code_words [ ] = [ …] indices[ ] = texindices[ ] = F4F4 label R
[ … ] indices[ ] = texindices[ ] = code_words [ ] = [ …] R label R
5 [ … ] indices[ ] = texindices[ ] = code_words [ ] = [ …] R label F4F4
5 [ … ] indices[ ] = texindices[ ] = code_words [ ] = [ …] F4F4 label R
[ … ] indices[ ] = texindices[ ] = code_words [ ] = [ …] R label R label 6 5
7 [ … ] indices[ ] = texindices[ ] = code_words [ ] = [ …] R label 6 5 F5F5 H5H5
3 8 H5H5 hole 7 [ … ] indices[ ] = texindices[ ] = code_words [ ] = [ …] vertex bit indicating crease vertex R label
0 1 hole 7 [ … ] indices[ ] = texindices[ ] = code_words [ ] = [ …] R label 4 F3F3
0 1 hole 7 [ … ] indices[ ] = texindices[ ] = code_words [ ] = [ …] label F3F label F3F3
[ … ] code_words [ ] = [ …] indices[ ] = texindices[ ] = hole label F3F3 vertex bit indicating smooth vertex 1
Results
“fish” scene Shape { appearance Appearance { material Material { modulateTextureWithDiffuse true diffuseColor } texture ImageTexture { url fish.jpg } } geometry IndexedFaceSet { coord Coordinate { point [ ] } coordIndex [ … ] texCoord TextureCoordinate { point [ … ] } texCoordIndex [ … ] } }
“fish” scene Shape { appearance Appearance { material Material { modulateTextureWithDiffuse true diffuseColor } texture ImageTexture { url fish.jpg } } geometry IndexedFaceSet { coord Coordinate { point [ ] } coordIndex [ … ] texCoord TextureCoordinate { point [ … ] } texCoordIndex [ … ] } } CodedIndexedFaceSet code [ … ]
lossless-coded “fish” scene Shape { appearance Appearance { material Material { modulateTextureWithDiffuse true diffuseColor } texture ImageTexture { url fish.jpg } } geometry CodedIndexedFaceSet { coord Coordinate { point [ ] } texCoord TextureCoordinate { point [ … ] } code [ … ] } } pos 4.884e-3 tex e-3
lossy-coded “fish” scene Shape { appearance Appearance { material Material { modulateTextureWithDiffuse true diffuseColor } texture ImageTexture { url fish.jpg } } geometry CodedIndexedFaceSet { coord Coordinate { point [ ] } texCoord TextureCoordinate { point [ … ] } code [ … ] pos 4.884e-3 tex e-3 } }
lion % % wolf % % raptor % % fish % % snake % % horse % % cat % % dog % % Results: Dense Scenes model plaincodedquantized
IFS % Results: Sparse Scene 33 indexed face sets 5 position interpolators 27 orientation interpolators file size of “swing.wrl.gz” in bytes 31 % 66 % IFS, OI, PI % % Only Indexed Face Sets
Demos
Shout3D ASCII coder :> local web <localweb Various Scenes Swing ( static ) > local web <localweb Swing ( animated ) > local web <localweb Fish > local web <localweb Lion > local web <localweb Snake > local web <localweb
Conclusion geometry coding for ASCII formats compressed, but not binary authors not forced to change habits VRML / X3D geometry compression long wanted feature (`96) VRML-CBF proposal refused (`98) BF call for proposals unanswered (`00) Conformance: ASCII BINARY
Current Work “Arithmetic ASCII” ( nearly ) as compact as a compressed binary format straight-forward mapping to binary no compromise on binary compression rates same decoding algorithm for binary and ASCII version of a node good for rapid prototyping / proof-of-concept
Acknowledgements Paul Isaacs for telling me “… no, we don’t have geometry compression because the Shout3D API does not support binary input …” Curious Labs & Shout3D for the models ARC TéléGeo of INRIA Sophia-Antipolis for partial funding
Thank You.