Texture
new Texture(image?)
Image-backed texture clamped to a 128×128 maximum. Set needsUpdate = true after assigning an image to trigger nearest-neighbor downsampling and pixel caching.
Differs from THREE.js
Hard 128×128 cap - larger images are nearest-neighbor downsampled on needsUpdate. No GPU upload; pixel data lives in a plain ImageData.
Properties
| 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 ≤128×128 (read-only). |
width | number | Width of cached pixel data. |
height | number | Height of cached pixel data. |
Methods
| Method | Description |
|---|---|
clone(): Texture | Returns a new Texture sharing the same image reference. |
dispose(): void | Clears the image and cached pixel data. |