Add support for EXT_texture_webp
v2
#425
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was recently working in
three_d
which uses gltf in it's asset parser. I realized that neitherthree_d
norgltf
actually had support for WebP.I noticed some unmerged PR's and decided to update them in hopes of getting this in (and a dependent PR in
three_d
merged as well).Going down the rabbit hole, I noticed some gremlin interaction with the
allow_empty_textures
feature.gltf_json::Texture
as it is the source of truth (ie make source private and provide a helpersource()
)I took the approach of making the
source()
function in texture use aprimary_source()
function, which prefers thewebp
and falls back to whatever was there originally.However, I believe the most accurate solution is to permanently enable
allow_empty_textures
, and remove that flag, and make applications handlewebp
images (if they have theEXT_texture_webp
feature enabled).Perhaps
allow_empty_texture
in its off-state is not gltf compliant anyways?Original PR: #365
Related: #413