Skip to content

Texture

new Texture(image?)

THREE equivalent: THREE.Texture

Image-backed texture clamped to a 128x128 maximum. Set needsUpdate = true after assigning an image to trigger nearest-neighbor downsampling and pixel caching.

Differs from THREE.js

Hard 128x128 cap - larger images are nearest-neighbor downsampled on needsUpdate. No GPU upload; pixel data lives in a plain ImageData.

Name Type Description
id number Auto-incrementing unique identifier.
name string Optional display name.
image HTMLImageElement|HTMLCanvasElement|ImageBitmap|undefined Source image.
needsUpdate boolean Setting to true triggers clamp-and-cache. Required before the texture is usable.
data ImageData|undefined Cached pixel data, clamped to ≤128x128 (read-only).
width number Width of cached pixel data.
height number Height of cached pixel data.
Method Description
clone(): Texture Returns a new Texture sharing the same image reference.
dispose(): void Clears the image and cached pixel data.