filament icon indicating copy to clipboard operation
filament copied to clipboard

GLTFIO Webp Texture Support

Open benn-herrera opened this issue 2 months ago • 1 comments

Webp Texture Support

  • Addresses Issue 7962 (Webp Texture Support)
  • This PR broken out as 3 of 3 from #9363 per request by @pixelflinger
  • Preceding PRs: #9369 #9371

Changes

  • cmake option FILAMENT_SUPPORTS_WEBP_TEXTURES now actually does all of the thing. defaults to OFF
  • libs/gltfio
    • added WebpProvider and createOptionalWebpProvider
      • adapted from StbProvider with minimal changes (substituted webp equivalents for stbi info and decoding operations)
      • createOptionalWebpProvider() is always available regardless of FILAMENT_SUPPORTS_WEBP_TEXTURES
        • returns new texture provider when ON
        • returns nullptr when OFF
    • added handling for cgltf webp_image in places where image and basisu_image were being referenced
    • added test case for loading webp version of damaged helmet (see below)
  • propagated use of createOptionalWebpProvider and registration as image/webp handler to samples
  • updated jvm and javascript bindings to include optional webp texture provider
  • added third_party/models/DamagedHelmet/DamagedHelmetWebp.glb
    • images converted to webp, textures updated to use EXT_texture_webp extension
    • geometry draco compressed
    • modifications done via gltf-transform CLI utility
    • used in updated gltfio_test

benn-herrera avatar Nov 04 '25 22:11 benn-herrera

Can you also add to third_party/models/DamagedHelmet/README.md to indicate how the Webp version came about?

Fixed.

benn-herrera avatar Nov 06 '25 01:11 benn-herrera

@benn-herrera we're almost there! Looks like the iOS build is failing and the PR needs a rebase.

pixelflinger avatar Dec 18 '25 17:12 pixelflinger

@benn-herrera we're almost there! Looks like the iOS build is failing and the PR needs a rebase.

on it.

EDIT: should be fixed with last commit. iOS builds for me locally.

benn-herrera avatar Dec 18 '25 22:12 benn-herrera

Fixed a couple issues that only showed up when WebP is enabled.

benn-herrera avatar Dec 18 '25 22:12 benn-herrera