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

KTX2Loader: Improve parsing and transcoding process. #21137

Merged
merged 1 commit into from
Jan 25, 2021

Conversation

donmccurdy
Copy link
Collaborator

Followup to #21094 and #21131.

Simplifies and improves KTX2Loader in several ways:

  1. Internally uses a BasisTextureLoader instance for transcoding, reducing duplicate code.
  2. Moves transcoding process into Web Workers (managed by BasisTextureLoader).
  3. Imports parsing code from ktx-parse, simplifying the loader further.

The last item is not required, but is small (~1.5kb / 3kb, with and without tree-shaking) and should make it easier to add support for more features of the KTX format — which are not needed for glTF, and therefore not implemented yet — in the future.

After this change, the msc_basis_transcoder dependency is removed, and a warning is printed if the dependency's global variable is found. Users should update to use setTranscoderPath( ... ), the same as with BasisTextureLoader. This may need to be noted in the changelog.

@mrdoob mrdoob added this to the r125 milestone Jan 25, 2021
@mrdoob mrdoob merged commit 1d4bc6d into mrdoob:dev Jan 25, 2021
@mrdoob
Copy link
Owner

mrdoob commented Jan 25, 2021

Thanks!

@donmccurdy donmccurdy deleted the feat-ktx2-transcoder-update branch January 25, 2021 16:59
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

Successfully merging this pull request may close these issues.

2 participants