syoyo / tinygltf

Header only C++11 tiny glTF 2.0 library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Draco encoding

greenbrettmichael opened this issue · 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?

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!

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

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

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 There is a Draco compression code with TinyGLTF(I have updated the link since previous link URL was broken) #207 (comment)

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!

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

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