Skip to content

Documentation / scene / ConstantTexture2DArrayNode

Class: ConstantTexture2DArrayNode

Defined in: libs/scene/src/utility/blueprint/material/texture.ts:537

2D texture array constant node

Remarks

Represents a 2D texture array resource in the material node graph. A texture array is a collection of 2D textures with the same size and format, accessed using a 3D coordinate (u, v, layer).

Used for:

  • Terrain texture splatting (multiple terrain textures in one array)
  • Animation frames (sprite sheets)
  • Texture atlases with uniform tile sizes
  • Reducing texture bindings (multiple textures in one resource)

Note: Only DDS format supports texture arrays.

Output:

  • Output 1: Texture array sampler (tex2DArray type)

Example

typescript
const terrainTexArray = new ConstantTexture2DArrayNode();
terrainTexArray.paramName = 'terrainTextures';

// Sample from layer 2
const uv = new VertexUVNode();
const layer = new ConstantScalarNode();
layer.x = 2.0;

const uvLayer = new MakeVectorNode();
uvLayer.connectInput(1, uv, 1);     // UV (vec2)
uvLayer.connectInput(2, layer, 1);  // Layer (float)

const sample = new TextureSampleNode();
sample.connectInput(1, terrainTexArray, 1);
sample.connectInput(2, uvLayer, 1); // vec3 (u, v, layer)

Extends

Constructors

Constructor

new ConstantTexture2DArrayNode(): ConstantTexture2DArrayNode

Defined in: libs/scene/src/utility/blueprint/material/texture.ts:546

Creates a new 2D texture array node

Returns

ConstantTexture2DArrayNode

Remarks

Initializes with:

  • One output slot for the texture array sampler
  • Default 1x1x1 white texture array

Overrides

BaseTextureNode.constructor

Properties

sRGB

sRGB: boolean

Defined in: libs/scene/src/utility/blueprint/material/texture.ts:282

Whether this texture should be loaded in sRGB color space

Inherited from

BaseTextureNode.sRGB


addressU

addressU: TextureAddressMode

Defined in: libs/scene/src/utility/blueprint/material/texture.ts:284

Horizontal texture coordinate wrapping mode

Inherited from

BaseTextureNode.addressU


addressV

addressV: TextureAddressMode

Defined in: libs/scene/src/utility/blueprint/material/texture.ts:286

Vertical texture coordinate wrapping mode

Inherited from

BaseTextureNode.addressV


filterMin

filterMin: TextureFilterMode

Defined in: libs/scene/src/utility/blueprint/material/texture.ts:288

Minification filter mode

Inherited from

BaseTextureNode.filterMin


filterMag

filterMag: TextureFilterMode

Defined in: libs/scene/src/utility/blueprint/material/texture.ts:290

Magnification filter mode

Inherited from

BaseTextureNode.filterMag


filterMip

filterMip: TextureFilterMode

Defined in: libs/scene/src/utility/blueprint/material/texture.ts:292

Mipmap filter mode

Inherited from

BaseTextureNode.filterMip


textureId

textureId: string

Defined in: libs/scene/src/utility/blueprint/material/texture.ts:294

Asset ID for the texture (for serialization)

Inherited from

BaseTextureNode.textureId


_inputs

protected _inputs: GraphNodeInput[]

Defined in: libs/scene/src/utility/blueprint/node.ts:336

Internal storage for input slot definitions

Inherited from

BaseTextureNode._inputs


_outputs

protected _outputs: GraphNodeOutput[]

Defined in: libs/scene/src/utility/blueprint/node.ts:338

Internal storage for output slot definitions

Inherited from

BaseTextureNode._outputs


_error

protected _error: string

Defined in: libs/scene/src/utility/blueprint/node.ts:340

Internal storage for error message

Inherited from

BaseTextureNode._error

Accessors

paramName

Get Signature

get paramName(): string

Defined in: libs/scene/src/utility/blueprint/material/texture.ts:322

Gets the shader parameter name

Returns

string

The uniform name used in generated shader code

Set Signature

set paramName(val): void

Defined in: libs/scene/src/utility/blueprint/material/texture.ts:325

Uniform parameter name

Parameters
val

string

Returns

void

Uniform parameter name

Inherited from

BaseTextureNode.paramName


isUniform

Get Signature

get isUniform(): boolean

Defined in: libs/scene/src/utility/blueprint/material/texture.ts:340

Indicates this node represents a shader uniform

Remarks

Texture nodes create uniform declarations in the generated shader code.

Returns

boolean

Always true for texture nodes

Whether this node has uniform value

Inherited from

BaseTextureNode.isUniform


inputs

Get Signature

get inputs(): GraphNodeInput[]

Defined in: libs/scene/src/utility/blueprint/node.ts:380

Gets the input slot definitions array

Returns

GraphNodeInput[]

Array of input slot definitions

Inherited from

BaseTextureNode.inputs


outputs

Get Signature

get outputs(): GraphNodeOutput[]

Defined in: libs/scene/src/utility/blueprint/node.ts:384

Gets the output slot definitions array

Returns

GraphNodeOutput[]

Array of output slot definitions

Inherited from

BaseTextureNode.outputs


error

Get Signature

get error(): string

Defined in: libs/scene/src/utility/blueprint/node.ts:388

Gets the current error message

Returns

string

Set Signature

set error(str): void

Defined in: libs/scene/src/utility/blueprint/node.ts:391

Current error message, empty string if no error

Parameters
str

string

Returns

void

Current error message, empty string if no error

Inherited from

BaseTextureNode.error

Methods

on()

on<K>(type, listener, context?): void

Defined in: libs/base/dist/index.d.ts:594

IEventTarget.on

Type Parameters

K

K extends "changed"

Parameters

type

K

listener

EventListener<{ changed: []; }, K>

context?

unknown

Returns

void

Inherited from

BaseTextureNode.on


once()

once<K>(type, listener, context?): void

Defined in: libs/base/dist/index.d.ts:598

IEventTarget.once

Type Parameters

K

K extends "changed"

Parameters

type

K

listener

EventListener<{ changed: []; }, K>

context?

unknown

Returns

void

Inherited from

BaseTextureNode.once


off()

off<K>(type, listener?, context?): void

Defined in: libs/base/dist/index.d.ts:602

IEventTarget.off

Type Parameters

K

K extends "changed"

Parameters

type

K

listener?

EventListener<{ changed: []; }>

context?

unknown

Returns

void

Inherited from

BaseTextureNode.off


dispatchEvent()

dispatchEvent<K>(type, ...args): void

Defined in: libs/base/dist/index.d.ts:606

IEventTarget.dispatchEvent

Type Parameters

K

K extends "changed"

Parameters

type

K

args

...object[K]

Returns

void

Inherited from

BaseTextureNode.dispatchEvent


toString()

toString(): string

Defined in: libs/scene/src/utility/blueprint/material/texture.ts:348

Generates a string representation of this node

Returns

string

The parameter name

Inherited from

BaseTextureNode.toString


validate()

protected validate(): string

Defined in: libs/scene/src/utility/blueprint/material/texture.ts:360

Validates the node state

Returns

string

Empty string (always valid)

Remarks

Texture nodes are always valid as they have no required inputs and always have a valid texture (default if none assigned).

Inherited from

BaseTextureNode.validate


getSerializationCls()

static getSerializationCls(): SerializableClass

Defined in: libs/scene/src/utility/blueprint/material/texture.ts:565

Gets the serialization descriptor for this node type

Returns

SerializableClass

Serialization class descriptor

Remarks

Only accepts DDS format, which is the standard format for texture arrays. Includes validation to ensure the loaded texture is actually a 2D array.


getType()

protected getType(): string

Defined in: libs/scene/src/utility/blueprint/material/texture.ts:600

Gets the output type

Returns

string

'tex2DArray'

Overrides

BaseTextureNode.getType


getOutputType()

getOutputType(id): string

Defined in: libs/scene/src/utility/blueprint/node.ts:376

Gets the output type for a specific output slot

Parameters

id

number

The output slot ID

Returns

string

The type name of the output

Remarks

Default implementation delegates to the abstract getType() method. Can be overridden for more complex type logic.

Inherited from

BaseTextureNode.getOutputType


check()

check(): void

Defined in: libs/scene/src/utility/blueprint/node.ts:413

Validates the node and updates error state

Returns

void

Remarks

Calls the validate() method and stores the result in _error. Emits a 'changed' event if the error state changes.

Inherited from

BaseTextureNode.check


reset()

reset(): void

Defined in: libs/scene/src/utility/blueprint/node.ts:422

Clears the error state

Returns

void

Remarks

Sets _error to an empty string.

Inherited from

BaseTextureNode.reset


setInput()

setInput(id, node, inputId): void

Defined in: libs/scene/src/utility/blueprint/node.ts:443

Connects an input slot to another node's output

Parameters

id

number

The input slot ID to connect

node

BaseGraphNode

The source node to connect from

inputId

number

The output slot ID of the source node

Returns

void

Throws

Error if the input slot with the given ID doesn't exist

Example

typescript
const addNode = new AddNode();
const constantNode = new ConstantNode(5.0);

// Connect constantNode's output 0 to addNode's input 0
addNode.setInput(0, constantNode, 0);

Inherited from

BaseTextureNode.setInput

Released under the MIT License.