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

Added support for basisu extension to GLTF2 importer #5308

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Promit
Copy link
Contributor

@Promit Promit commented Nov 3, 2023

A GLTF2 file contains a textures array, which references items from the images array and the samplers array:
{"sampler":0,"source":0}
Assimp follows these references to lazy load the corresponding image and sampler. Simple enough. But when you're dealing with a GLTF2 that uses Basisu textures, the texture item comes out like this instead:

{
            "sampler": 0,
            "extensions": {
                "KHR_texture_basisu": {
                    "source": 0
                }
            }
        }

So the regular code flow doesn't work and the extension needs to be checked. I've put in a relatively straightforward addition here that recognizes the alternate source and causes Assimp to follow the references correctly.

Fixes issue #4648 .

@Promit
Copy link
Contributor Author

Promit commented Nov 4, 2023

There is a similar change needed to support the Microsoft extension for DDS textures in GLTF2 (MSFT_texture_dds) but that extension hasn't been recognized in Assimp at all and I thought it better to start with this relatively simple fix. I think it would be worth adding the MSFT extension as well.

Copy link
Member

@kimkulling kimkulling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine.

@kimkulling
Copy link
Member

You need to update your branch.

@alexrp
Copy link
Contributor

alexrp commented Apr 15, 2024

@kimkulling I don't know if you're aware of this, but FWIW, GitHub introduced a feature somewhat recently that allows you to easily update a PR that's out of date with respect to the base branch. You just need to go to the repo Settings tab and enable this:

image

Then PRs will show this:

image

(That said, if that doesn't work for some reason, I can rebase and resubmit this PR.)

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.

None yet

3 participants