- 
                Notifications
    
You must be signed in to change notification settings  - Fork 95
 
Description
KTX2 (Khronos Texture 2.0) is a modern GPU texture container format designed specifically for efficient usage with graphics APIs like Vulkan, OpenGL, and DirectX. Unlike general-purpose image formats such as PNG or JPEG, KTX2 files pack texture data in GPU-ready compressed formats, such as Basis Universal, that offer several performance and memory advantages:
GPU Compression: Textures remain compressed on the GPU, saving VRAM by 4-8x compared to uncompressed PNG/JPEG textures.
Fast GPU Upload: KTX2 data can often be directly uploaded to the GPU without costly decompression or transcoding steps on the CPU.
Mipmaps and Metadata: KTX2 efficiently stores complete mipmap chains and metadata about texture properties, enabling better rendering quality and performance.
Cross-platform Compatibility: The Basis Universal supercompression and KTX2 format allow transcoding to optimal GPU formats at runtime, supporting many platforms and devices.
Benefits for Expo Users
Reduced GPU Memory Use: Lower VRAM usage means more complex scenes can be loaded smoothly on mobile devices with limited resources.
Faster Texture Loading: Direct GPU upload reduces loading times, improving app startup and runtime responsiveness.
Better Mobile Experience: Compressed GPU textures help maintain smooth frame rates and battery efficiency on phones and tablets.
Industry Standard: KTX2 is supported widely in modern 3D asset pipelines and will become increasingly important for future-ready apps.
Current Workarounds and Limitations
Expo-three currently does not natively support KTX2 textures or integrate the KTX2Loader from three.js directly.
As a workaround, developers manually add three.js KTX2Loader and set the transcoder path, but this requires additional manual setup and is not seamless.
Without native support, integration is more complex, and features like Basis transcoding in Expo environment remain experimental or missing.
Alternative is to use PNG or JPEG textures with ExpoTHREE.TextureLoader, but at the cost of higher GPU memory use and slower loading.