tinygltf icon indicating copy to clipboard operation
tinygltf copied to clipboard

Draco encoding

Open greenbrettmichael opened this issue 5 years ago • 9 comments

This source file implements draco encoding,

https://github.com/GPUOpen-Tools/Compressonator/blob/master/Compressonator/Applications/_Plugins/Common/gltf/tiny_gltf2.h

what is the relationship between these two projects?

is it possible to integrate a similar functionality in this project?

greenbrettmichael avatar Sep 13 '19 19:09 greenbrettmichael

what is the relationship between these two projects?

There is no relationship. I didn't know that Compressonator uses customized version of tinygltf.

is it possible to integrate a similar functionality in this project?

Yes, you can backport draco encoding to tinygltf. PR is appreciated!

syoyo avatar Sep 14 '19 05:09 syoyo

Compressonator solution seems to be outdated, non-buildable and non-working.

What I have checked through - draco compression is disabled by default, after hacking projects and enabling draco, gltf refuses to load "JOINT_0" attributes, and also does not saves them.

So Compressonator project is outdated, please don't analyze it any further.

But @syoyo - do you have any idea when we could have draco encoder support added into tinygltf. Would be interested in that one even if it's in early stage.

tiny_gltf2.h introduces so many changes changes in diff wise, so I'm not even sure if it's wise to go using that implementation (which is also non working).

tapika avatar Sep 20 '19 13:09 tapika

@tapika glTF-Maya-Exporter's SaveToDraco code would be a good reference.

https://github.com/lighttransport/glTF-Maya-Exporter/blob/61116bc6950d270b716969a4236e3c74ea77b751/src/kml/SaveToDraco.cpp#L1

glTF-Maya-Exporter creates glTF with draco compression with picojson library. It creates valid glTF with draco-compressed data.

syoyo avatar Sep 21 '19 05:09 syoyo

+1 for this. I'm using gltf-pipeline and it is quite slow on mesh with several million tris (might take an hour or more on ryzen 5950x), really hoping tinygltf directly using the c++ version of encoder helps speed it up multiple times.

Ben-Mack avatar Jul 07 '21 01:07 Ben-Mack

@Ben-Mack I think it would be enough fast just using tinygltf(or C++ glTF tool) even without draco compression for meshes with millions of triangles.

https://github.com/syoyo/tinygltf/blob/master/examples/build-gltf/create_triangle_gltf.cpp is an example to build glTF from a scratch in C++.

syoyo avatar Jul 07 '21 06:07 syoyo

Actually the file is for serving online so I must use Draco compression to keep loading speed reasonable. Really looking forward to the implementation of Draco encoder in tinygltf. If so, tinygltf will be the first cpp lib can compress glTF Draco, performance-oriented, which is clearly missing on the market.

Ben-Mack avatar Jul 07 '21 08:07 Ben-Mack

@Ben-Mack There is a Draco compression code with TinyGLTF(I have updated the link since previous link URL was broken) https://github.com/syoyo/tinygltf/issues/207#issuecomment-533770321

https://github.com/lighttransport/glTF-Maya-Exporter/blob/61116bc6950d270b716969a4236e3c74ea77b751/src/kml/SaveToDraco.cpp#L1

You can implement Draco compression based on this and send PR. Contribution is always welcome!

syoyo avatar Jul 07 '21 08:07 syoyo

still open I guess? Any progress on this? Or should i also check it myself ? :)

sariug avatar Sep 24 '22 10:09 sariug

@sariug No progress. You can contribute Draco encoding support to TinyGLTF!

syoyo avatar Sep 24 '22 10:09 syoyo