AdvancedOptionaltextureOptions: TextureSourceOptions
options that will be passed to BaseRenderTexture constructor
options for creating a new TextureSource
depth, which makes a 3D texture, is on TextureShapeOptions; the constructor takes both.
Optional_resourceId?: numberOptionaladdressMode?: WRAP_MODEsetting this will set wrapModeU,wrapModeV and wrapModeW all at once!
OptionaladdressModeU?: WRAP_MODEspecifies the {{GPUAddressMode|address modes}} for the texture width, height, and depth coordinates, respectively.
OptionaladdressModeV?: WRAP_MODEspecifies the {{GPUAddressMode|address modes}} for the texture width, height, and depth coordinates, respectively.
OptionaladdressModeW?: WRAP_MODESpecifies the {{GPUAddressMode|address modes}} for the texture width, height, and depth coordinates, respectively.
OptionalalphaMode?: ALPHA_MODESthe alpha mode of the texture
Optionalantialias?: booleanOnly really affects RenderTextures. Should we use antialiasing for this texture. It will look better, but may impact performance as a Blit operation will be required to resolve the texture.
Optional AdvancedarrayLayerCount?: numberThe number of array layers for this texture source. Setting it above 1 makes a '2d-array' texture.
This maps to WebGPU's GPUTextureDescriptor.size.depthOrArrayLayers and is used for array-backed textures
such as cube maps (6 layers). Can't be combined with depth.
OptionalautoGarbageCollect?: booleanIf true, the Garbage Collector will unload this texture if it is not used after a period of time
OptionalautoGenerateMipmaps?: booleanShould we auto generate mipmaps for this texture? This will automatically generate mipmaps for this texture when uploading to the GPU. Mipmapped textures take up more memory, but can look better when scaled down.
For performance reasons, it is recommended to NOT use this with RenderTextures, as they are often updated every frame.
If you do, make sure to call updateMipmaps after you update the texture.
A 3D texture on WebGPU needs TextureSourceOptions.storage and rgba8unorm or rgba16float,
because a compute shader writes the mips. WebGL fills the chain with gl.generateMipmap.
Optionalcompare?: COMPARE_FUNCTIONWhen provided the sampler will be a comparison sampler with the specified COMPARE_FUNCTION. Note: Comparison samplers may use filtering, but the sampling results will be implementation-dependent and may differ from the normal filtering rules.
Optional Readonlydestroyed?: booleanHas the style been destroyed?
Optionaldimensions?: TEXTURE_DIMENSIONSHow the texture is stored. Derived from TextureSourceOptions.viewDimension: '3d' and '1d' views
are stored as themselves, every other view as '2d'.
Optionaldynamic?: booleanUsed by RenderTexture.create to allow resizing. Not used by TextureSource itself.
Optionalformat?: TEXTURE_FORMATSthe format that the texture data has
Optionalheight?: numberthe pixel height of this texture source. This is the REAL pure number, not accounting resolution
Optionallabel?: stringoptional label, can be used for debugging
OptionallodMaxClamp?: numberSpecifies the minimum and maximum levels of detail, respectively, used internally when sampling a texture.
OptionallodMinClamp?: numberspecifies the minimum and maximum levels of detail, respectively, used internally when sampling a texture.
OptionalmagFilter?: SCALE_MODEspecifies the sampling behavior when the sample footprint is smaller than or equal to one texel.
OptionalmaxAnisotropy?: numberSpecifies the maximum anisotropy value clamp used by the sampler. Note: Most implementations support TextureStyle#maxAnisotropy values in range between 1 and 16, inclusive. The used value of TextureStyle#maxAnisotropy will be clamped to the maximum value that the platform supports.
setting this to anything higher than 1 will set scale modes to 'linear'
OptionalminFilter?: SCALE_MODEspecifies the sampling behavior when the sample footprint is larger than one texel.
OptionalmipLevelCount?: numberThe number of mip levels to generate for this texture. this is overridden if autoGenerateMipmaps is true
OptionalmipmapFilter?: SCALE_MODEspecifies behavior for sampling between mipmap levels.
Optionalresolution?: numberthe resolution of the texture.
Optionalresource?: Tthe resource that will be uploaded to the GPU. This is where we get our pixels from eg an ImageBimt / Canvas / Video etc
OptionalscaleMode?: SCALE_MODEsetting this will set magFilter,minFilter and mipmapFilter all at once!
Optionalstorage?: booleanWebGPU only. Lets compute shaders write to this texture as a storage texture (a texture_storage_2d or
texture_storage_3d binding in WGSL). PixiJS still samples it as a normal texture. WebGL has no storage
textures and ignores this.
Only some formats can be storage textures: every device supports rgba8unorm, rgba16float,
r32float, rg32float, rgba32float and the matching rgba8, rgba16, r32, rg32 and rgba32
integer formats. bgra8unorm needs the bgra8unorm-storage feature and formats such as r8unorm
or r16float need texture-formats-tier1; PixiJS enables both when the GPU has them. WebGPU rejects any
other format when the texture is created.
const volume = new TextureSource({ width: 64, height: 64, depth: 64, format: 'rgba8unorm', storage: true });
// write it from your own compute pass (renderer is a WebGPURenderer)
const view = renderer.texture.getGpuSource(volume).createView();
// ... bind `view` to a `texture_storage_3d<rgba8unorm, write>`, dispatch, submit
// then sample it in any PixiJS shader as a texture_3d
Optionaltransient?: booleanWebGPU only. Marks an antialiased render target as single-pass: it is never rendered into again
with clear: false, never has a filter or mask pop back onto it, and its depth/stencil is never
needed after the pass. PixiJS then discards its multisample buffers at the end of the pass instead
of writing them to memory: depth/stencil, and on GPUs that aren't tile-based also colour (tile-based
GPUs already discard colour; see GpuExtensions.tileBased). If the target is reopened anyway,
the colour is restored from the resolved texture but the depth/stencil is lost.
OptionalviewDimension?: TEXTURE_VIEW_DIMENSIONSHow this texture is viewed/sampled by shaders.
This aligns with WebGPU's GPUTextureViewDescriptor.dimension. It defaults from the size:
depth gives '3d', arrayLayerCount > 1 gives '2d-array', anything else '2d'.
Pass it only when the size doesn't decide it, e.g. 'cube' for 6 layers viewed as a cube map.
Optionalwidth?: numberthe pixel width of this texture source. This is the REAL pure number, not accounting resolution
OptionalwrapMode?: WRAP_MODEDestroys the style
Has no effect. The pool sizes textures to the screens registered with setScreenSize.
A style built from the pool options. The pool no longer applies it to anything.
Clears the pool.
OptionaldestroyTextures: boolean
Destroy all stored textures.
Creates a texture from a request, using the pool constructor options for anything unset.
Width and height are in physical pixels. Format and scale mode fall back to the pool's own.
Optionalantialias: booleanOptionalautoGenerateMipmaps: booleanThe backing size, in physical pixels, that getOptimalTexture would allocate for a request, without taking a texture from the pool.
Each axis is the next power of two, or the smallest registered screen the request fits inside (see setScreenSize). Use it when a consumer needs to know where a request's content will sit inside its pooled texture before it has one, such as a uniform that maps content space onto texture space.
The minimum width of the texture.
The minimum height of the texture.
The resolution of the texture.
The width and height the pooled texture would have, in physical pixels.
Gets a Power-of-Two render texture or screen sized texture.
Width and height are the minimum frame size. Resolution, antialias, mipmaps, format and scale mode fall back to 1 / false / the pool's own options. Each format and scale mode keeps its own buckets.
The request, using the same fields as TextureSourceOptions.
The new render texture.
Optionalresolution: numberOptionalantialias: booleanOptionalautoGenerateMipmaps: booleanGets a pooled texture matching the dimensions and resolution of the given texture.
This is a convenience wrapper around getOptimalTexture that copies width, height, and resolution from an existing texture. Useful when a filter needs a temporary texture the same size as its input (e.g., for multi-pass blur).
The texture whose dimensions to match.
Whether to use antialias on the pooled texture. Defaults to false.
A pooled texture with power-of-two or screen sized backing dimensions at the source resolution.
Removes a screen previously registered with setScreenSize, destroying any idle textures that were only being kept for it.
The uid the screen was registered with.
Returns a texture to the pool so it can be reused by future getOptimalTexture or getSameSizeTexture calls.
If you gave the texture a style of your own after obtaining it (a different address mode, anisotropy
or similar), pass resetStyle = true so the pool puts its own style back. Otherwise your style stays
on the texture and the next consumer inherits it.
The texture to return to the pool.
When true, restores the style the pool created for this texture. Defaults to false.
Registers the screen size of a renderer with the pool, in physical pixels.
While a screen is registered, a request that fits inside it on an axis is given that screen's size on that axis instead of the next power of two, which stops a full screen filter from allocating a texture far larger than the screen. Requests larger than every registered screen on an axis keep the power of two size - the pool never rounds a request up to a screen it does not fit in.
The uid of the renderer, used to update or remove this screen later.
The width of the screen in physical pixels.
The height of the screen in physical pixels.
Texture pool, used by FilterSystem and plugins.
Stores collection of temporary pow2 or screen-sized renderTextures. Textures are bucketed by size, flags, format and scale mode, so one pool can serve colour, float and depth targets side by side.