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

Is loading a ktx2 file from a .glb supported? #29

Closed
DerrickBarra opened this issue Nov 11, 2020 · 4 comments
Closed

Is loading a ktx2 file from a .glb supported? #29

DerrickBarra opened this issue Nov 11, 2020 · 4 comments

Comments

@DerrickBarra
Copy link

DerrickBarra commented Nov 11, 2020

@atteneder Hey bud, our team just added KtxUnity plugin integration to the GLTFUtility plugin (we would use GLTFast, but we need animation support).

However in my testing this morning, KtxUnity has been returning a null reference to the texture on the success delegate. If I load a .ktx2 or .basis texture outside of a .glb there aren't any issues.

The weird thing is that the mimeType is confirmed to be image/ktx2 beforehand.

Now the issue could also be with the optimizer we're passing our models through (Rapid Compact from DGG) and the creation of the ktx2. But can you confirm you've seen this test work? And if so, can you share the test model you used so I can try it out here?

Here's the file I'm testing if you're curious.

Horse
GLB
GLB - KTX2
GLB - Draco
GLB - Draco & KTX2

GLTFImage

@atteneder
Copy link
Owner

Hi @DerrickBarra ,

Transcoding likely failed.

Last time I checked RapidCompact (4.0.x), they seem to still use an outdated KTX 2.0 draft specification. Not sure, but could be the reason.

I successfully tested with gltfpack 0.15 and suggest you try it as well to compare. If this works, it's likely RapidCompact's fault.

Let me know how it goes.

@DerrickBarra
Copy link
Author

DerrickBarra commented Nov 11, 2020 via email

@DerrickBarra
Copy link
Author

DerrickBarra commented Nov 12, 2020

@atteneder So I pinpointed the bug in KtxUnity that is causing the issue.

If I use TextureBase.LoadBytesRoutine(), that causes the texture to be returned null. This is a nice convenience function to have around since we're not always working within a monobehaviour, hopefully, the bug in it can get squashed.

Instead, if I use LoadFromBytes() and pass in a Singleton monobehaviour I created as a dummy, then that works just fine.

In talking to another developer (@daverin over at the GLTFUtility plugin git repo). He mentions that he actually squashed this bug with two different solutions. Check out his reply.

@atteneder
Copy link
Owner

Fyi: Once I was mentioned in the other PR I got notifications, so no need to double-notify in here.

No bug, but rather wrong use of co-routines.

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