Skip to topic | Skip to bottom
Home
TModeling
TModeling.Sm2smr1.1 - 16 Dec 2008 - 13:38 - Main.guesttopic end

Start of topic | Skip to actions
sm2sm

Software that can compress meshes on-the-fly in whichever triangle order they happen to be in. It can do so in a completely lossless manner if that is really needed.

We no longer need to give the entire mesh to the compressor and then wait several hours (for large meshes) until preprocessing has finished and then wait a few more hours until compression has completed. We simply compress the mesh triangle by triangle without any preprocessing or and without any temporary storage. As you see below we can simply "pipe" meshes to and from a compressed format.

Also, if our mesh triangles are in a particular order that we like to preserve (e.g. an order for efficient rendering on graphics cards with vertex cache) then we will not loose this order during compression.

Some people just do not like the idea of quantizing floating point numbers prior to compression. Therefore we have the option of doing the geometry compression completely losslessly (e.g. every single bit of each float will be put back into its place after decompression). This lowers the achieved compression but allows us to use compression whenever quantization is not allowed.

SM formats

(For more information regarding the various SM formats, go to StreamingCompression)

We currently use three streaming formats. SMA and SMB are uncompressed; SMC is compressed. You can convert between the formats using the sm2sm converter in the following manner:

sm2sm -i mesh.sma -o mesh.smc 

File type Description
*.sma a simple OBJ-like ASCII format
*.smb a simple PLY-like uncompressed binary format
*.smc our compressed binary format
More formats are being developed - stay tuned.

Compression

sm2sm -i cow.sma -o cow.smc
sm2sm -isma -o cow.smc < cow.sma 
sm2sm -isma -osmc < cow.sma > cow.smc
--> compresses cow.sma with 16 bits of precision

sm2sm -b 0 -i cow.sma -o cow_lossless.smc
--> compresses cow.sma in a lossless manner

sm2sm -b 12 -dry -i cow.sma -osmc
--> compresses cow.sma with 12 bits while only producing bit-rate information

sm2sm -compact -i canonical_cow.smf -o canonical_cow.smc
--> compress your own meshes in non-streaming formats such as *.obj or *.smf or *.ply. use the "-compact" flag to finalize vertices. Without finalizing the compression rates will be much higher because each explicit index will use many more bits. Note that meshes in non-streaming formats are pretty much loaded into memory completely before compression can start ...

Decompression

sm2sm -i cow.smc -o cow.sma
sm2sm -i cow.smb -osma > cow.sma
--> decompresses the compressed cow.smc to our ASCII SM format

sm2sm -i cow.smc -o cow.smb
sm2sm -i cow.smc -osmb > cow.smb
--> decompresses the compressed cow.smc to binary SM format

sm2sm -dry -i cow.smc
--> decompresses the compressed cow.smc without producing output

Compression with delay buffer

To improve compression rates we can give the compressor the option do some local re-orderings subject to a constraint of a maximal displacement of a triangle within the triangle array. This works great:

sm2sm -i cow.sma -osmc -dry -delay 250
--> compresses cow.sma using a delay buffer of 250 triangles

sm2sm -i cow.sma -osmc -dry -delay 5000
--> compresses cow.sma using a delay buffer of 5000 triangles Use the '-dry' flag to see itemized bit-rates.

Miscellaneous

For more on streaming compression, experiment! See http://www.cs.unc.edu/~isenburg/smc/ for papers and interesting models, most of which are compressed.

You can either first decompress them (to the binary format SMB),

sm2sm -i big_mesh.smc -o big_mesh.smb
sm2sm -i big_mesh.smb -osmc -delay 5000 -dry
or directly decompress and recompress them.
sm2sm -i big_mesh.smc -osmc -delay 5000 -dry
For fun ... you can also pipe decompressor and compressor together,
sm2sm -i big_mesh.smc -osmb | sm2sm -ismb -osmc -delay 5000 -dry
or pipe them together using the ASCII format.
sm2sm -i big_mesh.smc -osma | sm2sm -isma -osmc -delay 5000 -dry
This teaches you how inefficient ASCII conversion is ...
to top

Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback