coding with ascii: compact, yet text-based 3d content martin isenburg jack snoeyink university of...

Post on 21-Dec-2015

234 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Coding with ASCII:compact, yet text-based 3D content

Martin Isenburg Jack Snoeyink

University of North Carolina at Chapel Hilland

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 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 [ -1.0 1.0 -1.0 , -1.0 -1.0 -1.0 , 1.0-1.0 -1.0 , 1.0 1.0 -1.0 , -1.0 -1.0 1.0 , 1.0 -1.0 1.0, -1.0 1.0 1.0, 1.0 1.0 1.0 ]}coordIndex [ 0 1 2 3 -1 3 2 5 7 -1 1 4 5 2 -1 6 0 3 7 -1 6 4 1 0 -1 6 7 5 4 -1 ]

}

coord (Geometry)

4

00

11 22

33

5

5

66

77

coordIndex (Connectivity)

0 3

1 2

4

7

5

6

face0 0 1 2 3

0

2

3

5

4 1face1 3 2 5 7face2 1 4 5 2face3 6 0 3 7face4 6 4 1 0face5 6 7 5 4

Example: “a textured box”

IndexedFaceSet {. . . . . .texCoord Coordinate {

point [ 0.4 0.5 , 0.4 0.3 , 0.6 0.3 , 0.6 0.5, 0.8 0.3 , 0.8 0.5 , 0.4 0.1 , 0.6 0.1 , 0.2 0.5 , 0.2 0.3 , 0.4 0.7 , 0.6 0.7 , 0.4 0.9 , 0.6 0.9 ]}texCoordIndex [ 0 1 2 3 -1 3 2 4 5 -1 1 6 7 2-1 10 0 3 11 -1 8 9 1 0 -1 10 11 13 12 -1 ]

}

0.0

v

u

1.0

1.00.0

1

1

1 1

2

2 2

23

3

3 3

4

45

5

6

6

7

78

8

9

9

10

10

10

11

11

11

13

13

12

12

0

0

0

0

texCoord (Property Values)

texCoordIndex (Property Mapping)

face0 0 1 2 3

0

2

3

5

4 10

1

2

30

0

1 1 2

2

3 3

4

5

6 7

8

9

10 11

10 11

1312

face1 3 2 4 5face2 1 6 7 2face3 10 0 3 11face4 8 9 1 0face5 10 11 13 12

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

F4 F5

R

F3

L S E

Hn

M

Face Fixer

Encoding

5

9

2

0

22

25

29

78

31

43

67

98

11

8653

68

1427

77

72

91

6

Encoding

F4

5

9

2

0

22

25

29

78

31

43

67

98

11

8653

68

1427

77

72

91

6

Encoding

F4

F3

5

9

2

0

22

25

29

78

31

43

67

98

11

8653

68

1427

77

72

91

6

Encoding

F4

F3

R

5

9

2

0

22

25

29

78

31

43

67

98

11

8653

68

1427

77

72

91

6

Encoding

F4

F3F5

R

5

9

2

0

22

25

29

78

31

43

67

98

11

8653

68

1427

77

72

91

6

Encoding

F4

F3F5

R

F5

5

9

2

0

22

25

29

78

31

43

67

98

11

8653

68

1427

77

72

91

6

Encoding

F4

F3F5

R

F5

R

5

9

2

0

22

25

29

78

31

43

67

98

11

8653

68

1427

77

72

91

6

Encoding

F4

F3F5

R

F5

R R

5

9

2

0

22

25

29

78

31

43

67

98

11

8653

68

1427

77

72

91

6

Mapping Labels to ASCII

• Resulting label sequence:

F4 F3 F5R F5 R F4. . . R RF4 R . . .

R 0

L 1

S 2

E 3

M 4

F3 5

F4 6

F5 7. . .

. . .

H3 5 -1

6H4 -1

H5 7 -1

Decoding

R61

4243

44

45

46

47

2627

26

25

24

23 11

12

13

14

Decoding

R62

61

4243

44

45

46

47

2627

26

25

24

23 11

12

13

14

Decoding

F5

63

62

61

4243

44

45

46

47

2627

26

25

24

23 11

12

13

14

Decoding

F5

63

62

61

4243

44

45

46

47

2627

26

25

24

23 11

12

13

14

Decoding

R 63

62

61

4243

44

45

46

47

2627

26

25

24

23 11

12

13

14

Decoding

F3

6463

62

61

4243

44

45

46

47

2627

26

25

24

23 11

12

13

14

Decoding

F464

63

62

61

4243

44

45

46

47

2627

26

25

24

23 11

12

13

14

Decoding

6463

62

61

4243

44

45

46

47

2627

26

25

24

23 11

12

13

14

Non-Manifold Meshes

cutcut

Coding ofIndices (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 & StrasserReal-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)

1

12 1

2 3

12 3

4 12 3

45 1

2 34

6 5

Vertex and Corner Bits (2)

211

21 3

Vertex and Corner Bits (3)

crease vertex corner vertexsmooth vertex

smoothcorner

creasecorner

Encoding

1

Encoding

0

1

0

Encoding

1

10 0

Encoding

1

1

00 0

Encoding

11

1

00 0

Encoding

11

1

00 0

01

Encoding

11

1

00 0

010

Encoding

11

1

00 0

0100

Encoding

11

1

00 0

0100 1

Encoding

11

1

00 0

0100 10

Encoding

11

1

00 0

0100 100

Encoding

11

1

00 0

0100 100

01

Encoding

11

1

00 0

0100 100

011

Encoding

11

1

00 0

0100 100

0111

Encoding

11

1

00 0

0100 100

0111

0

Encoding

11

1

00 0

0100 100

0111

0

01

Encoding

11

1

00 0

0100 100

0111

0

01 0

Encoding

11

1

00 0

0100 100

0111

0

1 00 1

Encoding

11

1

00 0

0100 100

0111

0

1 010

0

Encoding

11

1

00 0

0100 100

0111

0

1 010

0

1

Encoding

11

1

00 0

0100 100

0111

0

1 010

0

1

Quantizing & Coding of

Coordinates

Quantize

• calculate bounding box• (minx, miny, minz) and (maxx, maxy maxz)

• calculate extends of bounding box• rangex = maxx – minx

• rangey = maxy – miny

• …

• 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 [ ] =

[ 438 3 0 0 6 0 0 6 0 0 7 -1 6 0 -1 4 5 5 0 …]

size of index arrays

[ • • • • • • • • • • • • • • • • • • … ]

[ • • • • • • • • • • • • • • • • • • … ]

indices[ ] =

texindices[ ] =

label E Rlabel

01

0

code_words [ ] =

[ 438 3 0 0 6 0 0 6 0 0 7 -1 6 0 -1 4 5 5 0 …]

[ • • • • • • • • • • • • • • • • • • … ]

[ • • • • • • • • • • • • • • • • • • … ]

indices[ ] =

texindices[ ] =

Rlabel

1

2

Rlabel

3

2

01

code_words [ ] =

[ 438 3 0 0 6 0 0 6 0 0 7 -1 6 0 -1 4 5 5 0 …]

[ • • • • • • • • • • • • • • • • • • … ]

[ • • • • • • • • • • • • • • • • • • … ]

indices[ ] =

texindices[ ] =

Rlabel F4label

[ • • • • • • • • • • • • • • • • • • … ]

[ • • • • • • • • • • • • • • • • • • … ]

3

2

01

code_words [ ] =

[ 438 3 0 0 6 0 0 6 0 0 7 -1 6 0 -1 4 5 5 0 …]

23

0

1

-11 03 2

-1

indices[ ] =

texindices[ ] =

F4label Rlabel

[ • • • • • • • • • • • • • • • • • • … ]

[ • • • • • • • • • • • • • • • • • • … ]

indices[ ] =

texindices[ ] =

4

3

2

01

code_words [ ] =

[ 438 3 0 0 6 0 0 6 0 0 7 -1 6 0 -1 4 5 5 0 …]

23

0

1

-11 03 2

-1

Rlabel Rlabel

5

[ • • • • • • • • • • • • • • • • • • … ]

[ • • • • • • • • • • • • • • • • • • … ]

indices[ ] =

texindices[ ] =

4

3

2

01

code_words [ ] =

[ 438 3 0 0 6 0 0 6 0 0 7 -1 6 0 -1 4 5 5 0 …]

23

0

1

-11 03 2

-1

Rlabel F4label

5

[ • • • • • • • • • • • • • • • • • • … ]

[ • • • • • • • • • • • • • • • • • • … ]

indices[ ] =

texindices[ ] =

4

3

2

01

code_words [ ] =

[ 438 3 0 0 6 0 0 6 0 0 7 -1 6 0 -1 4 5 5 0 …]

23

0

1

-11 03 2

-1

F4label

6

8

7

5

Rlabel

4 35 0 -1

-1

[ • • • • • • • • • • • • • • • • • • … ]

[ • • • • • • • • • • • • • • • • • • … ]

indices[ ] =

texindices[ ] =

4

3

2

01

code_words [ ] =

[ 438 3 0 0 6 0 0 6 0 0 7 -1 6 0 -1 4 5 5 0 …]

23

0

1

-11 03 2

-1

6

8

7

5

Rlabel

4 35 0 -1

-1

Rlabel

6

5

7

[ • • • • • • • • • • • • • • • • • • … ]

[ • • • • • • • • • • • • • • • • • • … ]

indices[ ] =

texindices[ ] =

4

3

2

01

code_words [ ] =

[ 438 3 0 0 6 0 0 6 0 0 7 -1 6 0 -1 4 5 5 0 …]

23

0

1

-11 03 2

-1

6

8

7

5

4 35 0 -1

-1

Rlabel

6

5

label F5H5

3 8

label H5

hole

7

[ • • • • • • • • • • • • • • • • • • … ]

[ • • • • • • • • • • • • • • • • • • … ]

indices[ ] =

texindices[ ] =

4

3

2

01

code_words [ ] =

[ 438 3 0 0 6 0 0 6 0 0 7 -1 6 0 -1 4 5 5 0 …]

2

0

1

-11 03 2

-1

6

7

5

4 35 0 -1

-1

6

5

vertex bit indicating crease vertex

1 0

01

Rlabel

01

hole

7

[ • • • • • • • • • • • • • • • • • • … ]

[ • • • • • • • • • • • • • • • • • • … ]

indices[ ] =

texindices[ ] =

4

3

2

01

code_words [ ] =

[ 438 3 0 0 6 0 0 6 0 0 7 -1 6 0 -1 4 5 5 0 …]

2

0

1

-11 03 2

-1

6

7

5

4 35 0 -1

-1

6

5

1 0

Rlabel

4

label F3

01

hole

7

[ • • • • • • • • • • • • • • • • • • … ]

[ • • • • • • • • • • • • • • • • • • … ]

indices[ ] =

texindices[ ] =

4

3

2

01

code_words [ ] =

[ 438 3 0 0 6 0 0 6 0 0 7 -1 6 0 -1 4 5 5 0 …]

2

0

1

-11 03 2

-1

6

7

5

4 35 0 -1

-1

6

5

1 0

4

label F3

10

11

12

1 -14 7

-1

label F3

[ • • • • • • • • • • • • • • • • • • … ]

[ • • • • • • • • • • • • • • • • • • … ]

1 2 -14 3-1 51 03 2

code_words [ ] =

[ 438 3 0 0 6 0 0 6 0 0 7 -1 6 0 -1 4 5 5 0 …]

indices[ ] =

texindices[ ] =

hole

20

1

3

4

5

67

4

2

12

15

2

22

0

1 6

7

5

10

11

16

14

0

41 -14 70 -1

2 -1-12 1 2 -10 -1

01

label F3vertex bit indicating smooth vertex

1

Results

“fish” sceneShape {

appearance Appearance {material Material {

modulateTextureWithDiffuse truediffuseColor 1 1 1

}texture ImageTexture {

url fish.jpg}

}geometry IndexedFaceSet {

coord Coordinate {point [ -0.0715 4.7609 6.3930 -0.0715 ... -0.4479 -4.5153 4.5304 ]

}coordIndex [ 7 6 209 204 -1 4 217 210 … 4577 -1 4577 4223 4222 -1 ]texCoord TextureCoordinate {

point [ 0.3735 0.9441 0.3289 0.9315 … 0.2666 0.4990 0.1082 ]}texCoordIndex [ 0 1 2 3 -1 4 5 6 7 -1 8 … 4311 -1 4311 4293 4683 -1 ]

}}

“fish” sceneShape {

appearance Appearance {material Material {

modulateTextureWithDiffuse truediffuseColor 1 1 1

}texture ImageTexture {

url fish.jpg}

}geometry IndexedFaceSet {

coord Coordinate {point [ -0.0715 4.7609 6.3930 -0.0715 ... -0.4479 -4.5153 4.5304 ]

}coordIndex [ 7 6 209 204 -1 4 217 210 … 4577 -1 4577 4223 4222 -1 ]texCoord TextureCoordinate {

point [ 0.3735 0.9441 0.3289 0.9315 … 0.2666 0.4990 0.1082 ]}texCoordIndex [ 0 1 2 3 -1 4 5 6 7 -1 8 … 4311 -1 4311 4293 4683 -1 ]

}}

CodedIndexedFaceSet

code [ 24045 3 0 3 1 1 2 0 0 0 0 0 0 3 … 5 0 5 0 5 0 5 0 6 0 0 0 0 2 ]

lossless-coded “fish” sceneShape {

appearance Appearance {material Material {

modulateTextureWithDiffuse truediffuseColor 1 1 1

}texture ImageTexture {

url fish.jpg}

}geometry CodedIndexedFaceSet {

coord Coordinate {point [ -0.1195 -2.0148 ... -4.5153 4.5304 -0.4689 -4.4092 4.4136 ]

}texCoord TextureCoordinate {

point [ 0.0150 0.5031 … 0.2549 0.3889 0.2581 0.3825 0.2520 ]}code [ 24045 3 0 3 1 1 2 0 0 0 0 0 0 3 … 5 0 5 0 5 0 5 0 6 0 0 0 0 2 ]

}}

pos 4.884e-3tex 3.8234e-3

lossy-coded “fish” sceneShape {

appearance Appearance {material Material {

modulateTextureWithDiffuse truediffuseColor 1 1 1

}texture ImageTexture {

url fish.jpg}

}geometry CodedIndexedFaceSet {

coord Coordinate {point [ -2 -4 -1 -3 -3 0 -4 -47 ... 37 4 -21 24 -0.4689 -4.4092 4.4136 ]

}texCoord TextureCoordinate {

point [ 0 0 0 0 0 -4 0 1 … -1 -1 0 0 0 -1 5 3 -4 0 2 2 0.3825 0.2520 ]}code [ 24045 3 0 3 1 1 2 0 0 0 0 0 0 3 … 5 0 5 0 5 0 5 0 6 0 0 0 0 2 ]

pos 4.884e-3tex 3.8234e-3

}}

lion 441.6 201.646 % 66.215 %wolf 183.1 84.546 % 29.416 %

raptor 199.8 100.750 % 34.917 %fish 122.9 55.445 % 22.819 %

snake 312.3 138.144 % 34.811 %horse 266.4 124.347 % 40.915 %

cat 267.3 128.448 % 39.915 %dog 186.2 87.347 % 34.619 %

Results: Dense Scenes

model plain coded quantized

--- 29895IFS 1836461 %

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 1299643 %

20564899344 %

Only Indexed Face Sets

Demos

Demos

• Shout3D ASCII coder : > local web <

• Various Scenes• Swing (static) > local web <

• Swing (animated) > local web <

• Fish > local web <

• Lion > local web <

• Snake > local web <

http://www.cs.unc.edu/~isenburg/asciicoder/

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 geometrycompression 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.

http://www.cs.unc.edu/~isenburg/asciicoder/

top related