Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draco compression #81

Open
ebeaufay opened this issue Nov 9, 2022 · 4 comments
Open

Draco compression #81

ebeaufay opened this issue Nov 9, 2022 · 4 comments

Comments

@ebeaufay
Copy link

ebeaufay commented Nov 9, 2022

Hi,

I'm using your library to produce gltf files followed by a javascript library to draco compress them.
It works but it's a bit slow.

Do you have any plan to add draco compression and perhaps even some modern texture compression support in the decoder and encoder?

Emeric

@javagl
Copy link
Owner

javagl commented Nov 12, 2022

That would be nice.

But Draco, KTX, and most other (more sophisticated) compression libraries are usually not available in Java.

I could just try to compile the C/C++ versions of these libraries and see whether they can be intergrated with java-cpp (and in doubt, I do have some experience with JNI). I once even considered to just "port" Draco to Java. But "it would be nice" is not a strong enough reason for me to tackle that right now.

"Pull requests welcome", as they say...

@ebeaufay
Copy link
Author

😅 I see, I was thinking of doing the jni bridge too but it's also kind of a nice to have. My workaround could be blocking in the future so I'll consider the PR here.

@javagl
Copy link
Owner

javagl commented Nov 12, 2022

More broadly speaking: There are many extensions that are not really "supported" by JglTF. There are some experiments in jgltf-impl-v2-ext-... projects, but these are only drafts and not part of a release. And by "supported" I mean that you can obtain the extensions["FOO"] objects and operate on them. But there are no "convenience layers" (in form of ...Model classes) on top of that.

Some extensions could be relatively easy to support. But it's a certain burden to design a sensible abstraction layer on some of them, and for others (like Draco) the abstraction layer could be thin (nearly non-existent), but the the implementation of the actual functionality can be non-trivial.

I mentioned some options (1. using JNI in some form, and 2. porting the existing Draco code to Java). But the most desirable would actually be option 3: To look at the actual Draco bistream spec, and implement it from scratch, only based on the specification. This is the most effort, but I think that it would be "good" in many ways: Having multiple independent implementations is crucial for having a standard that does not turn into a "one-vendor-monoculture"...

@ebeaufay
Copy link
Author

The Draco spec isn't small and I think a deep understanding of the spec would be needed to implement this from scratch.

Porting the code to java however seems fairly straightforward and it could be the first step towards a good understanding of the library and a re-implementation.

I would love to have a java draco compression lib but I'm still going to wait until my workaround becomes blocking before I really consider this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants