Skip to content

feat: Add WebP texture support as an Addon - #58

Closed
mostafa1310 wants to merge 39 commits into
Unity-Technologies:mainfrom
mostafa1310:feature/webp-support
Closed

feat: Add WebP texture support as an Addon#58
mostafa1310 wants to merge 39 commits into
Unity-Technologies:mainfrom
mostafa1310:feature/webp-support

Conversation

@mostafa1310

@mostafa1310 mostafa1310 commented Aug 10, 2026

Copy link
Copy Markdown

This PR adds support for WebP textures using the EXT_texture_webp extension.

Based on previous feedback, this implementation ensures a clean separation between the add-on logic and the core glTFast logic by completely inverting the dependency chain:

  • No Core Modifications: GltfImport.cs and Extensions.cs remain completely decoupled from WebP loading. The core simply delegates to ImportAddonRegistry dynamically.
  • Standalone Addon: The WebP integration is fully encapsulated in Runtime/Scripts/ImportAddons/WebP/ under its own glTFast.WebP.asmdef assembly. It registers itself automatically using [RuntimeInitializeOnLoadMethod].
  • Missing Package Logs: Added #if !WEBP_IS_INSTALLED checks in GltfImport.cs and ImageImport.cs to cleanly notify the user to install unity.webp if they attempt to load a WebP texture without the package installed.

Note: The EXT_texture_webp property is added to TextureExtensions in Texture.cs to prevent Unity's JsonUtility from silently discarding the image index during initial schema deserialization.

atteneder and others added 30 commits October 18, 2023 11:25
…eases.

KtxUnity soft dependency has been changed back to OpenUPM version (for now)
- Re-named *Unity glTFast* to *glTFast* in prominent places
- Re-added OpenUPM badge
- Added recommendation for *Unity glTFast* and link
- Synchronized Unity glTFast 6.9.0 subfolder `Packages/com.unity.cloud.gltfast` from monorepo.
- Ported over missing switch to *KTX for Unity*
- Added docs about OpenUPM branch not being a monorepo.
@cla-assistant-unity

cla-assistant-unity Bot commented Aug 10, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@mostafa1310
mostafa1310 force-pushed the feature/webp-support branch 2 times, most recently from 26e0334 to 61d3879 Compare August 11, 2026 09:25
@mostafa1310 mostafa1310 changed the title Add optional WebP support and GLB loader feat: Add WebP texture support as an Addon Aug 11, 2026
Adds EXT_texture_webp to the glTF schema parser to enable WebP texture detection. Moves the WebP loading implementation (WebpImageLoader.cs and WebpTextureImportAddon.cs) out of the core package and into DocExamples/ to demonstrate how to implement a native addon without coupling the core package to unity.webp. Also updates DocExamples/LoadGltfWithWebp.cs to show how to manually register the addon before loading.
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