OptionalbuffersTranscoded / compressed texture data.
True if the texture is compressed.
True if this SceneTexture has been destroyed.
SceneTexture encoding format.
Supported values are LinearEncoding and sRGBEncoding.
Flips this SceneTexture's source data along its vertical axis when true.
Pixel height of the texture.
ID for the texture.
OptionalimageAlready-decoded image source the renderer can hand straight to
texSubImage2D — HTMLImageElement, HTMLCanvasElement,
ImageBitmap, or OffscreenCanvas.
How the texture is sampled when a texel covers more than one pixel.
Supported values are LinearFilter and NearestFilter.
OptionalmediaMedia type of this SceneTexture.
Supported values are GIFMediaType, PNGMediaType and JPEGMediaType.
Ignored for compressed textures.
How the texture is sampled when a texel covers less than one pixel. Supported values are LinearMipmapLinearFilter, LinearMipMapNearestFilter, NearestMipMapNearestFilter, NearestMipMapLinearFilter and LinearMipMapLinearFilter.
Ignored for compressed textures.
ReadonlymipmapMipmap opt-in. true routes meshes whose materials reference
this SceneTexture into a mipmap-bearing batch; the per-batch
atlas is allocated with a full mip pyramid and sampled
trilinearly. Default false.
The SceneModel that this texture belongs to.
The count of SceneMaterials that
reference this SceneTexture (in any of the colour, normals,
metallic-roughness, occlusion, or emissive slots). Maintained by
SceneModel.createMaterial / SceneModel._destroyMaterial. Used
by destroy to refuse destruction while at least one
material still references the texture (the same guard
SceneGeometry.destroy and SceneMaterial.destroy
carry).
RGBA color to preload the texture with.
OptionalsrcURL to fetch the image from. Any URL form (http(s):, blob:,
data:). toParams writes serialised images here as data URLs.
Pixel width of the texture.
R wrapping mode.
Supported values are ClampToEdgeWrapping, MirroredRepeatWrapping and RepeatWrapping.
Ignored for compressed textures.
S wrapping mode.
Supported values are ClampToEdgeWrapping, MirroredRepeatWrapping and RepeatWrapping.
Ignored for compressed textures.
T wrapping mode.
Supported values are ClampToEdgeWrapping, MirroredRepeatWrapping and RepeatWrapping.
Ignored for compressed textures.
The raw pixel buffer backing this SceneTexture, or undefined for
image-element / encoded-buffer textures.
Replace this SceneTexture's pixel buffer.
Accepts either a DOM ImageData or the JSON-friendly
{data, width, height} form (normalised to ImageData here).
Every assignment fires Scene.events.onSceneTextureImageDataChanged
so the renderer can re-upload the pixels into its atlas sub-rect
via texSubImage2D — no batch / mesh / material rebuild.
The setter fires unconditionally on every assignment (no identity
skip), so callers that mutate the bytes of an existing ImageData
in place can re-trigger the upload by reassigning the same buffer:
texture.imageData = texture.imageData.
Destroy this SceneTexture.
Refuses to destroy while at least one !scene.SceneMaterial | SceneMaterial in the SceneModel still references this texture (in any slot — colour, normals, metallic-roughness, occlusion, or emissive). Destroy or replace those materials first. Mirrors SceneGeometry.destroy and SceneMaterial.destroy.
Returns a JSON-serializable object containing this SceneTexture's parameters.
image (canvas / HTMLImage / ImageBitmap / OffscreenCanvas) isn't
JSON-serialisable, so it gets rendered through a 2D canvas and
folded into src as a PNG data URL — src is the one canonical
field for "encoded image, please decode it." imageData (raw
pixels) is emitted as a { data, width, height } plain object so
the typed array survives JSON.stringify. buffers and the rest
of the sampler state pass straight through.
A texture in a SceneModel.
See @xeokit/sdk/model/scene for usage.