Skip to content

Fix/2418 : allow useKTX2 to accept an external KTX2Loader instance #2419

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

davcri
Copy link
Contributor

@davcri davcri commented Apr 9, 2025

Why

See #2418

What

Allow useKTX2() to accept an external KTX2Loader instance via this api:

// assume ktx2LoaderInstance is defined
const texture = useKTX2('sample_uastc_zstd.ktx2', ktx2LoaderInstance)

I don't really like passing the 2nd argument as "undefined", probably the function signature could be written better, I'm open to feedback. When we settle on this I would gladly update the documentation as well. Fixed with 34b2476

Checklist

  • Documentation updated
  • Storybook entry added
  • Ready to be merged

davcri added 2 commits April 9, 2025 15:22
box-textured-ktx2.glb is generated from this command:

npx @gltf-transform/cli optimize BoxTextured.glb --texture-compress ktx2 BoxTextured-ktx2.glb

The original GLB is taken from https://github.com/KhronosGroup/glTF-Sample-Assets/tree/main/Models/BoxTextured
Copy link

vercel bot commented Apr 9, 2025

@davcri is attempting to deploy a commit to the Poimandres Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

codesandbox-ci bot commented Apr 9, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

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.

1 participant