File: CanvasTexture.md | Updated: 11/15/2025
Creates a texture from a canvas element.
This is almost the same as the base texture class, except that it sets Texture#needsUpdate to true immediately since a canvas can directly be used for rendering.
Constructs a new texture.
canvas | The HTML canvas element.
---|---
mapping | The texture mapping. Default is Texture.DEFAULT_MAPPING.
wrapS | The wrapS value. Default is ClampToEdgeWrapping.
wrapT | The wrapT value. Default is ClampToEdgeWrapping.
magFilter | The mag filter value. Default is LinearFilter.
minFilter | The min filter value. Default is LinearMipmapLinearFilter.
format | The texture format. Default is RGBAFormat.
type | The texture type. Default is UnsignedByteType.
anisotropy | The anisotropy value. Default is Texture.DEFAULT_ANISOTROPY.
This flag can be used for type testing.
Default is true.