the buffer/URL holding the compressed texture data
The data of this resource.
Readonly
destroyedIf resource has been destroyed.
false
The compression format
true
if resource is created by BaseTexture
useful for doing cleanup with BaseTexture destroy
and not cleaning up resources that were created
externally.
The number of mipmap levels stored in the resource buffer.
1
The url of the resource
The alignment of the rows in the data.
The height of the resource.
Has been validated
The width of the resource.
Bind to a parent BaseTexture
Parent texture
Loads the blob
Set the style, optional to override
yeah, renderer!
the texture
texture instance for this webgl context
true
is successUnbind to a parent BaseTexture
Parent texture
A reference to the current renderer
the texture
texture instance for this webgl context
Static
testUsed to auto-detect the type of resource.
The source object
true
if buffer source
Generated using TypeDoc
Resource for compressed texture formats, as follows: S3TC/DXTn (& their sRGB formats), ATC, ASTC, ETC 1/2, PVRTC, BPTC (BC6H, BC7).
Compressed textures improve performance when rendering is texture-bound. The texture data stays compressed in graphics memory, increasing memory locality and speeding up texture fetches. These formats can also be used to store more detail in the same amount of memory.
For most developers, container file formats are a better abstraction instead of directly handling raw texture data. PixiJS provides native support for the following texture file formats (via PIXI.loadBasis, PIXI.loadKTX, and PIXI.loadDDS):
.dds - the DirectDraw Surface file format stores DXTn (DXT-1,3,5) data. See PIXI.parseDDS .ktx - the Khronos Texture Container file format supports storing all the supported WebGL compression formats. See PIXI.parseKTX. .basis - the BASIS supercompressed file format stores texture data in an internal format that is transcoded to the compression format supported on the device at runtime. It also supports transcoding into a uncompressed format as a fallback; you must install the
@pixi/basis-loader
,@pixi/basis-transcoder
packages separately to use these files. See PIXI.BasisParser.The loaders for the aforementioned formats use
CompressedTextureResource
internally. It is strongly suggested that they be used instead.Working directly with CompressedTextureResource
Since
CompressedTextureResource
inheritsBlobResource
, you can provide it a URL pointing to a file containing the raw texture data (with no file headers!):Example
Memberof
PIXI