API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
interfaceCompressedTexturePayload
A texture payload already in a hardware block-compressed format, as carried by Texture.compressed. The saving is real in both directions: a BC7 or ASTC 4x4 image occupies a quarter of the VRAM of the same image as RGBA8 and a BC1 or ETC2 image an eighth, and it never has to be decoded on the CPU first. # Upload state does not apply `premultiplyAlpha` and `generateMipMap` are ignored for a compressed payload, and that is not a simplification: both operate on decoded texels, which is precisely what compressed blocks never become. Premultiplication has to happen in the authoring tool before compression, and a mip chain has to be compressed level by level and shipped inside the container. A payload with a single level therefore samples without mips however the sampler is configured. # Availability is per device No GPU implements every format. Binding a texture whose format the live backend does not support throws a `RenderError` with code `'unsupported-format'` rather than uploading something the driver would misread. Check RenderBackend.supportedTextureFormats, or - better - declare the alternatives as asset variants and let the loader choose.
import { CompressedTexturePayload } from '@codexo/exojs'A texture payload already in a hardware block-compressed format, as carried by Texture.compressed.
The saving is real in both directions: a BC7 or ASTC 4x4 image occupies a quarter of the VRAM of the same image as RGBA8 and a BC1 or ETC2 image an eighth, and it never has to be decoded on the CPU first.
# Upload state does not apply
`premultiplyAlpha` and `generateMipMap` are ignored for a compressed payload, and that is not a simplification: both operate on decoded texels, which is precisely what compressed blocks never become. Premultiplication has to happen in the authoring tool before compression, and a mip chain has to be compressed level by level and shipped inside the container. A payload with a single level therefore samples without mips however the sampler is configured.
# Availability is per device
No GPU implements every format. Binding a texture whose format the live backend does not support throws a `RenderError` with code `'unsupported-format'` rather than uploading something the driver would misread. Check RenderBackend.supportedTextureFormats, or - better - declare the alternatives as asset variants and let the loader choose.