当前位置:网站首页>Draco - gltf model compression tool
Draco - gltf model compression tool
2022-07-07 02:24:00 【Brain in new VAT】
Draco It is used for mesh compression glTF Extension and by Google Open source library developed , Used for compression and decompression 3D Mesh to significantly reduce 3D The size of the content . It compresses vertex positions 、 normal 、 Color 、 Texture coordinates and any other common vertex attributes , So as to improve the transmission on the network 3D Efficiency and speed of content .
It means Smaller file size and Faster streaming , Especially in 3D Tiles Under the circumstances , When a new block appears or a new level of detail is required , It often streams new glTF Model .
We've been working with Khronos and Google Cooperative make Draco Become glTF Expand , You can be in now Cesium Load in Draco Compression model and 3D Tile set !
2、Khronos glTF Draco Compression expansion
glTF Now there is KHR_draco_mesh_compression Expand , It can be loaded with Draco Buffer of compressed geometry . from Cesium 1.44 Start , We use Google The open source JavaScript The decompression library supports the use of Draco Compressed data loading glTF assets .
Using compressed meshes can reduce glTF The final file size of the model , This means that these assets take up less space , Download less data , Streaming is faster . To illustrate the difference , We use Draco The encoder compresses the following files , The default compression level for all attributes is 7.
This is a glTF 2.0 Draco Compress Cesium Milk truck example model And glTF 2.0 Cesium Comparison of milk truck example models , Both contain textures and animations .
Draco Compress | non-compressed | file |
---|---|---|
2.1 KB | 2.2 KB | CesiumMilkTruck.gltf |
14.0 KB | 107 KB | 0.bin |
418 KB | 418 KB | CesiumMilkTruck.png |
Since this extension only compresses geometry , So texture payload (CesiumMilkTruck.png) Keep the same size (418 KB). Extra created with extensions JSON Metadata for .gltf Files have little impact (2.1 KB And 2.2 KB).
Next , Here is glTF 2.0 Draco Compressed Buggy Example model And glTF 2.0 Buggy Comparison of example models , The latter is a mesh with more complex geometry .
Draco | Compress | non-compressed |
---|---|---|
824 KB | 391 KB | Off-road vehicle .gltf |
0.824 MB | 7.6 MB | Buggy0.bin |
We see a smaller .gltf file (824 KB Yes 391 KB), Because each primitive needs to be specified JSON Less metadata , And a significantly smaller .bin file , Because you can use extensions to compress a lot of geometry .
3、Cesium 3D Tiles
Use 3D Tiles when ,Cesium Often send requests and stream new 3D Content . Now you can use Draco Expand and compress the glTF Content , And use less data to stream faster . below , We use glTF 2.0 Processed 12.8 GB Of City GML data , It includes 110 Ten thousand New York City buildings ,Draco The compression level is 5.
Total tile set size | |
---|---|
belt Gzip Compression of the glTF | 2.0 |
with Draco Compression of the glTF 2.0 | 179 MB |
with Draco and Gzip Compression of the glTF 2.0 | 149 MB |
In terms of loading time , Although we are performing loading and compiling Draco modular Web The overhead of the assembly is subject to a small initial impact , But after that, the streaming and decompression speed of all slices are faster than none Draco Faster compression . This is used only gzip Compression of the glTF 2.0 And use Draco Compression and gzip Of glTF 2.0 Comparison of the lumped loading time of tiles .*
glTF 2.0( Compressed package ) | with Draco Compression of the glTF 2.0 (gzipped) |
---|---|
Tile set size :738 MB | Tile set size :149 MB |
Loading time :18.921 second | Loading time :10.548 second |
* Image with 2 Times the speed to demonstrate .
4、 performance optimization
Cesium Of Draco The decoding implementation utilizes Web Assembly Asynchronous decoding and GPU De quantification on , This means decoding multiple models in parallel ( Or part of the model ), And use less overall memory .
5、 Parallel decompression
Cesium utilize Web Workers Decode multiple meshes in parallel . stay 3D Tiles Under the circumstances , This means that multiple can be streamed and decoded at the same time Tile. Besides , Every element of the grid ( Or part of it ) Can be decoded separately , In order to decode complex models faster . Before returning the data needed to render the mesh to the main thread , We can retrieve each segment of the encoding buffer and pass the data to a separate worker for parallel asynchronous decoding .
When the browser supports , We load and compile the decoding module Web Assembly Binary files and shared among multiple staff , With the use of pure JavaScript Solution compared to , Further improve the compression speed .
6、GPU De quantification on
Cesium still GPU Decode some attributes on , Decode outside the main thread and use less memory . Usually stored as 32 Vertex attribute of bit floating-point number , For example, location attribute data , It can be decoded into quantized 16 Bit integer value . Besides , For unit vector attributes like normals , We can decode it into Octal code data .
stay GPU When decoding on , We skip Draco Quantization or octahedral transformation operation in decoder module , Instead, retrieve and store any transformation constants . Smaller decoded data can be passed to GPU, Perform dequantization or octal decoding operations in shaders at render time . This leads to CPU The main application thread running on and GPU Running in parallel on requires less memory .
When using the previously mentioned New York City 3D Tiles gather GPU When performing inverse quantization in ,GPU The memory used is saved 52%, There is no difference in file size , There is no difference in visual quality , And it has no effect on the total loading time of the tile set , Because with full use Draco The decoding module decodes and compares .
Draco Compress | stay GPU Using inverse quantization compression Draco | |
---|---|---|
memory | 119MB | 57MB |
Tile set loading time | 7.45 second | 7.44 second |
Link to the original text : use Draco Compress 3D Model — BimAnt
边栏推荐
- Time synchronization of livox lidar hardware -- PPS method
- Robot team learning method to achieve 8.8 times human return
- The foreground downloads network pictures without background processing
- fiddler的使用
- [paper reading | deep reading] graphsage:inductive representation learning on large graphs
- Draco - glTF模型压缩利器
- 【森城市】GIS数据漫谈(二)
- Halcon knowledge: segment_ contours_ XLD operator
- 一片葉子兩三萬?植物消費爆火背後的“陽謀”
- ZABBIX 5.0: automatically monitor Alibaba cloud RDS through LLD
猜你喜欢
随机推荐
Vingt - trois mille feuilles? "Yang mou" derrière l'explosion de la consommation végétale
Why am I warned that the 'CMAKE_ TOOLCHAIN_ FILE' variable is not used by the project?
The last line of defense of cloud primary mixing department: node waterline design
Processus général de requête pour PostgreSQL
XML to map tool class xmlmaputils (tool class V)
This week's hot open source project!
leetcode:736. Lisp 语法解析【花里胡哨 + 栈 + 状态enumaotu + slots】
Pgadmin4 of PostgreSQL graphical interface tool
建议收藏!!Flutter状态管理插件哪家强?请看岛上码农的排行榜!
3D激光SLAM:Livox激光雷达硬件时间同步
MFC Windows 程序设计[147]之ODBC数据库连接(附源码)
Freeswitch dials extension number source code tracking
15million employees are easy to manage, and the cloud native database gaussdb makes HR office more efficient
A new path for enterprise mid Platform Construction -- low code platform
Collection recommandée!! Quel plug - in de gestion d'état flutter est le plus fort? Regardez le classement des manons de l'île, s'il vous plaît!
FLIR blackfly s industrial camera: configure multiple cameras for synchronous shooting
Robot team learning method to achieve 8.8 times human return
Jacob Steinhardt, assistant professor of UC Berkeley, predicts AI benchmark performance: AI has made faster progress in fields such as mathematics than expected, but the progress of robustness benchma
[xlua notes] array of lua to array of C #
Tiflash source code reading (IV) design and implementation analysis of tiflash DDL module