ProtectedconstructorProtected constructor. Use static factory methods to create instances.
Optionalimage: ImageBitmap | HTMLImageElement | HTMLCanvasElement
Optional initial image data.
Optional configuration options.
The wrapping mode for the U coordinate.
The wrapping mode for the V coordinate.
Desired anisotropic filtering level for this texture.
Optional block-compressed payload. When present, image is undefined and
renderers upload compressedImage directly via compressedTexImage2D
(WebGL2) / compressed texture formats (WebGPU) instead of sampling image.
Whether mipmaps should be generated for this texture.
The underlying image, bitmap, or canvas data.
Whether the texture is fully loaded and ready for use.
The magnification filter.
The minification filter.
Set to true after mutating image in place (e.g. redrawing a canvas) to force a GPU re-upload.
The UV offset.
The UV repeat factors.
Flips the texture horizontally by modifying the UV offset and repeat.
This texture instance for chaining.
Flips the texture vertically by modifying the UV offset and repeat.
This texture instance for chaining.
StaticemptyCreates an empty texture placeholder.
Optionaloptions: TextureOptions
Optional configuration options.
A new empty Texture instance.
StaticfromCreates a texture backed directly by a canvas. Redraw the canvas and set needsUpdate = true
to push the new pixels to the GPU on the next frame.
The canvas to use as the texture's pixel source.
Optionaloptions: TextureOptions
Optional configuration options.
A new Texture instance.
StaticfromCreates a texture backed by an explicit block-compressed mip chain
(e.g. decoded from a KTX2 KHR_texture_basisu payload). The renderer uploads
the bytes as-is, keeping the data GPU-compressed.
The compressed payload (format + mip chain).
Optionaloptions: TextureOptions
Optional configuration options -- generateMipmaps must be
false, since every level is supplied explicitly.
A new Texture instance.
StaticfromCreates a texture from an existing image or bitmap.
The image or bitmap data.
Optionaloptions: TextureOptions
Optional configuration options.
A new Texture instance.
StaticfromLoads a texture from a URL.
The URL of the image.
Optionaloptions: TextureOptions
Optional configuration options.
A promise that resolves to a new Texture instance.
Represents a 2D texture.