Skip to content

Documentation / scene / PBRBlockNode

Class: PBRBlockNode ​

Defined in: libs/scene/src/utility/blueprint/material/pbr.ts:84

PBR (Physically Based Rendering) material output node

Remarks ​

This is the final output node for PBR materials in the material blueprint graph. It defines the complete surface properties using the metallic-roughness workflow, which is the industry-standard approach for physically-based materials.

The node accepts all essential PBR material properties:

  • BaseColor: The diffuse/albedo color of the surface (what color the surface is)
  • Metallic: Whether the surface is metallic (0 = dielectric/non-metal, 1 = metal)
  • Roughness: How rough/smooth the surface is (0 = mirror smooth, 1 = completely rough)
  • Specular: Controls specular reflectance for dielectrics (non-metals)
  • Emissive: Light emitted by the surface (for glowing effects)
  • Normal: Surface normal in tangent/world space (for bump/normal mapping)
  • Tangent: Surface tangent vector (for anisotropic effects)
  • Opacity: Surface transparency (0 = fully transparent, 1 = fully opaque)
  • SpecularWeight: Scalar weight for the specular lobe
  • AO: Ambient occlusion multiplier

All inputs are optional and have sensible defaults. Only the inputs you connect will override the default values.

Material workflow:

  1. Connect texture samples and math nodes to the various inputs
  2. The shader compiler will generate appropriate PBR lighting code
  3. The material will respond correctly to scene lighting

Examples ​

typescript
const output = new PBRBlockNode();

// Basic textured material
const albedoTex = new TextureSampleNode();
output.connectInput(1, albedoTex, 1); // BaseColor from texture

// Metal/rough workflow
const metallicTex = new TextureSampleNode();
const roughnessTex = new TextureSampleNode();
output.connectInput(2, metallicTex, 2); // Metallic from R channel
output.connectInput(3, roughnessTex, 2); // Roughness from R channel

// Normal mapping
const normalMap = new TextureSampleNode();
output.connectInput(6, normalMap, 1); // Normal from RGB

// Emissive glow
const emissiveColor = new ConstantVec3Node();
emissiveColor.x = 1.0; // Red glow
output.connectInput(5, emissiveColor, 1);
typescript
// Advanced material with procedural roughness variation
const output = new PBRBlockNode();

const baseColor = new ConstantVec3Node();
baseColor.x = 0.8; baseColor.y = 0.2; baseColor.z = 0.1; // Orange
output.connectInput(1, baseColor, 1);

// Procedural roughness pattern
const uv = new VertexUVNode();
const noise = new NoiseNode();
noise.connectInput(1, uv, 1);

const roughness = new MixNode();
roughness.connectInput(1, constant0_3, 1); // Min roughness 0.3
roughness.connectInput(2, constant0_8, 1); // Max roughness 0.8
roughness.connectInput(3, noise, 1);       // Blend factor
output.connectInput(3, roughness, 1);

// Non-metallic
const metallic = new ConstantScalarNode();
metallic.x = 0.0;
output.connectInput(2, metallic, 1);

Extends ​

Constructors ​

Constructor ​

new PBRBlockNode(): PBRBlockNode

Defined in: libs/scene/src/utility/blueprint/material/pbr.ts:109

Creates a new PBR material output node

Returns ​

PBRBlockNode

Remarks ​

Initializes with the full surface input set consumed by the PBR metallic-roughness backend. Existing slot ids are preserved for backward compatibility with saved .zbpt graphs, and new inputs are appended at the end. Each input has:

  • Flexible type acceptance (float can expand to vec3/vec4, etc.)
  • Default values for when no connection is made
  • Origin type that defines the expected canonical type

Default values provide a reasonable starting material:

  • White base color (1, 1, 1)
  • Fully metallic (1.0)
  • Fully rough (1.0)
  • White specular (1, 1, 1)
  • No emission (0, 0, 0)
  • Default surface normal (from vertex data)
  • Default tangent (from vertex data)
  • Fully opaque (1.0)
  • Full specular weight (1)
  • Full AO (1)

Overrides ​

BaseGraphNode.constructor

Properties ​

_inputs ​

protected _inputs: GraphNodeInput[]

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

Internal storage for input slot definitions

Inherited from ​

BaseGraphNode._inputs


_outputs ​

protected _outputs: GraphNodeOutput[]

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

Internal storage for output slot definitions

Inherited from ​

BaseGraphNode._outputs


_error ​

protected _error: string

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

Internal storage for error message

Inherited from ​

BaseGraphNode._error

Accessors ​

isUniform ​

Get Signature ​

get isUniform(): boolean

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

Whether this node contains uniform value/texture

Returns ​

boolean

Whether this node has uniform value

Inherited from ​

BaseGraphNode.isUniform


paramName ​

Get Signature ​

get paramName(): string

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

Uniform parameter name

Returns ​

string

Uniform parameter name

Inherited from ​

BaseGraphNode.paramName


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 ​

BaseGraphNode.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 ​

BaseGraphNode.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 ​

BaseGraphNode.error

Methods ​

on() ​

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

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

IEventTarget.on

Type Parameters ​

K ​

K extends "changed"

Parameters ​

type ​

K

listener ​

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

context? ​

unknown

Returns ​

void

Inherited from ​

BaseGraphNode.on


once() ​

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

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

IEventTarget.once

Type Parameters ​

K ​

K extends "changed"

Parameters ​

type ​

K

listener ​

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

context? ​

unknown

Returns ​

void

Inherited from ​

BaseGraphNode.once


off() ​

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

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

IEventTarget.off

Type Parameters ​

K ​

K extends "changed"

Parameters ​

type ​

K

listener? ​

EventListener<{ changed: []; }>

context? ​

unknown

Returns ​

void

Inherited from ​

BaseGraphNode.off


dispatchEvent() ​

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

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

IEventTarget.dispatchEvent

Type Parameters ​

K ​

K extends "changed"

Parameters ​

type ​

K

args ​

...object[K]

Returns ​

void

Inherited from ​

BaseGraphNode.dispatchEvent


getSerializationCls() ​

static getSerializationCls(): SerializableClass

Defined in: libs/scene/src/utility/blueprint/material/pbr.ts:191

Gets the serialization descriptor for this node type

Returns ​

SerializableClass

Serialization class descriptor

Remarks ​

No additional properties need to be serialized beyond the base node data and input connections.


toString() ​

toString(): string

Defined in: libs/scene/src/utility/blueprint/material/pbr.ts:209

Generates a string representation of this node

Returns ​

string

'Output'

Remarks ​

This node is typically labeled "Output" in the material editor UI as it represents the final material output.

Overrides ​

BaseGraphNode.toString


validate() ​

protected validate(): string

Defined in: libs/scene/src/utility/blueprint/material/pbr.ts:223

Validates the node state

Returns ​

string

Empty string (always valid)

Remarks ​

The PBR output node is always valid because:

  • All inputs are optional (have default values)
  • Type conversions are handled automatically (float → vec3, etc.)
  • It's the terminal node with no type inference requirements

Overrides ​

BaseGraphNode.validate


getType() ​

protected getType(): string

Defined in: libs/scene/src/utility/blueprint/material/pbr.ts:235

Gets the output type

Returns ​

string

Empty string (no outputs)

Remarks ​

As a terminal output node, PBRBlockNode has no outputs. It consumes the material graph data and provides it to the renderer.

Overrides ​

BaseGraphNode.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 ​

BaseGraphNode.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 ​

BaseGraphNode.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 ​

BaseGraphNode.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 ​

BaseGraphNode.setInput

Released under the MIT License.