![]() | |
---|---|
|
Mesh Compression
Introduction
All have begun after a client in my company come for showing us a software for animating CAD mesh. They use a parametrized quantization of vertices on 8/16/32 bits
to reduce the size of their files.Reference
My work are based from the article Angle-Analyzer: A Triangle-Quad Mesh Codec by
Haeyoung Lee (USC), Pierre Alliez (INRIA / USC) and Mathieu Desbrun (USC).This article was pretty clear and understandable, I recommand you to read it if you want more information. I will not present here my own implementation in detail (like they differ on few points), just my result. Implementation
In the previous episode:For example a frog with 14940 faces and 7400 vertices gives : 176ko -> 45ko uncompressed (1:3.9) 66ko -> 16ko compressed (1:4) (7z compression) ie. 176ko -> 16ko (1:11) Here are some qualities screenshots from my frog test :) (see previous news for info on size result) : Original : ![]() ![]() Original : ![]() ![]() After some bug and debug session, the codec seems to run pretty well. But, on mesh with faces with a short and two long edges, the error was unacceptable. I think it is here the angle geometry coding meet his limit. The angle error was PI/2^n where n are the number of bit for the quantization. All meshes with angles and edge's lengths homogenous will be perfectly compressed. Meshes with very small angle and long edge will be compressed with distorsion. The angular error multiplied by the long edge create an unacceptable position error. Solution? Create an adaptative quantization. 2 ways: 1) by giving more bits for quantization 2) by having a fixed quantization precision but by mapping precision interval according to a mathematical function 1) More bits When the position error are above a treshold : I'm increasing the quantization precision to 8/16/24/32 bits giving the maximum precision of PI/2^(8/16/24/32) radian. I'm outputing a special code coding the new precision CAD Mesh with 14400 faces and 7200 vertices : Original : ![]() Compressed 8 bits: ![]() Compressed adaptive: ![]() Result 8bits/adaptive: 169ko -> 47ko/51ko uncompressed (1:3.3) 66ko -> 23ko/27ko compressed (1:2.4) (7z compression) ie. 169ko -> 27ko (1:6.2) For the moment i'm outputing a special code at each precision > 8. (Maybe) Later i will implement a little analyser to concatene outputs. 2) Mathematical function
Nithril
|
home about engine contact link |