the buffer/URL holding the compressed texture data
the compression format
the image width in pixels.
the image height in pixels.
the mipmap levels stored in the compressed texture, including level 0.
the buffers for each mipmap level. CompressedTextureResource
can allows you
to pass null
for source
, for cases where each level is stored in non-contiguous memory.
Protected
_Internal height of the resource.
Protected
_Internal width of the resource.
Protected
bufferThe viewable buffer on the data.
The data of this resource.
Readonly
destroyedIf resource has been destroyed.
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.
Protected
loadedProtected
originThe URL of the texture file.
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.
Call when destroying resource, unbind any BaseTexture object before calling this method, as reference counts are maintained internally.
Destroy and don't use after this.
Loads the blob
Protected
onProtected
Trigger a resize event
X dimension
Y dimension
Set the style, optional to override
yeah, renderer!
the texture
texture instance for this webgl context
true
is successHas been updated trigger event.
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
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 or BCn (BC6H, BC7). 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