Releases texture resources from GPU memory and unregisters entries from the VRAM tracker.
Active context.
Registers a callback routine invoked when the asynchronous texture load successfully completes. Returns an unsubscribe function to safely detach the callback and prevent memory leaks.
The update callback function.
A function to unsubscribe this callback.
StaticgetStaticgetResolves a global, cached 1x1 neutral normal map texture. Returns a straight-up vector (128, 128, 255, 255) representing (0, 0, 1) tangent coordinates. Reuses the same instance across the entire context lifetime.
Active context.
The flat normal map fallback Texture.
StaticgetStaticloadSpawns a Texture loading sequence in the background, immediately returning a container holding a 1x1 solid white pixel. Replaces the placeholder texture in-place once loading finishes, triggering all update listeners. Revokes Blob URLs automatically to prevent memory leaks.
Active context.
Source address of the texture image.
Custom format configurations.
The newly allocated Texture instance.
Texture is a high-level wrapper around the native WebGPU
GPUTexture. Handles asynchronous background texture fetching and allocation while immediately supplying lightweight fallback pixel placeholders (solid white or flat normal vectors) to avoid blocking rendering pipelines during network transfers.