Skip to content

ImageRenderable ​

A textured plane that draws one 2D slice of scalar image data.

Image renderable maps a scalar texture through a single channel's color, contrast limits, and opacity. ImageLayer constructs and pools one instance per visible chunk, so most applications never create these directly.

Extends RenderableObject and inherits all public properties and methods.

Constructor ​

Creates an image renderable drawing the given texture. The texture's data type selects the matching scalar image shader.

ts
new ImageRenderable(props): ImageRenderable;
ParameterDescription
props: ImageRenderablePropsInitialization properties.

Types ​

ImageRenderableProps ​

Initialization properties for constructing an image renderable.

PropertyDescription
width: numberWidth of the image in texels.
height: numberHeight of the image in texels.
texture: TextureThe scalar image texture to draw.
channelProps?: ChannelProps[]Channel appearance settings. Defaults to [].

Properties ​

worldToTexCoord ​

A matrix mapping world space to the texture's normalized coordinate space. Layers derive it from the chunk's offset, scale, and shape.

ts
worldToTexCoord: mat4;

Accessors ​

type string overrides ​

Identifies the renderable type as ImageRenderable.

ts
get type(): string;

Methods ​

setChannelProps() void ​

Replaces the channel appearance settings and revalidates them against the current texture. Only the first entry affects rendering.

ts
setChannelProps(channels): void;
ParameterDescription
channels: ChannelProps[]The new channel settings.

setChannelProperty() void ​

Updates one property of the channel at the given index and revalidates the channel against the current texture.

ts
setChannelProperty<K>(channelIndex, property, value): void;

Type Parameters ​

Type Parameter
K extends keyof ChannelProps
ParameterDescription
channelIndex: numberThe channel to update.
property: KThe property name to set.
value: Required<ChannelProps>[K]The new value.

getUniforms() UniformValues overrides ​

Returns the sampler, contrast, color, opacity, and world-to-texture uniforms for the scalar image shaders.

ts
getUniforms(): UniformValues;

Released under the MIT License