Documentation / scene / ChannelSDFMaskNode
Class: ChannelSDFMaskNode
Defined in: libs/scene/src/utility/blueprint/material/texture.ts:1399
Channel SDF mask evaluation node
Remarks
Samples a channel-packed SDF texture and reconstructs a feathered mask by decoding the stored value back into signed distance space.
Inputs:
texture: source SDF texturecoord: UV coordinates, defaults to vertex UV when disconnectedsizeOffset: positive expands, negative shrinks, in SDF distance unitsfeather: transition width around the boundary, in SDF distance unitsspread: encode range used when baking the SDF textureedgeCurve: edge response curve,1keeps linear behavior,>1softens,<1hardenschannelMask: channel selector mask, defaults to R
Output:
Result: scalar mask in[0, 1]
Extends
Constructors
Constructor
new ChannelSDFMaskNode():
ChannelSDFMaskNode
Defined in: libs/scene/src/utility/blueprint/material/texture.ts:1409
Returns
ChannelSDFMaskNode
Overrides
Properties
textureId
textureId:
string
Defined in: libs/scene/src/utility/blueprint/material/texture.ts:1402
sRGB
sRGB:
boolean
Defined in: libs/scene/src/utility/blueprint/material/texture.ts:1403
addressU
addressU:
TextureAddressMode
Defined in: libs/scene/src/utility/blueprint/material/texture.ts:1404
addressV
addressV:
TextureAddressMode
Defined in: libs/scene/src/utility/blueprint/material/texture.ts:1405
filterMin
filterMin:
TextureFilterMode
Defined in: libs/scene/src/utility/blueprint/material/texture.ts:1406
filterMag
filterMag:
TextureFilterMode
Defined in: libs/scene/src/utility/blueprint/material/texture.ts:1407
filterMip
filterMip:
TextureFilterMode
Defined in: libs/scene/src/utility/blueprint/material/texture.ts:1408
_inputs
protected_inputs:GraphNodeInput[]
Defined in: libs/scene/src/utility/blueprint/node.ts:336
Internal storage for input slot definitions
Inherited from
_outputs
protected_outputs:GraphNodeOutput[]
Defined in: libs/scene/src/utility/blueprint/node.ts:338
Internal storage for output slot definitions
Inherited from
_error
protected_error:string
Defined in: libs/scene/src/utility/blueprint/node.ts:340
Internal storage for error message
Inherited from
Accessors
isUniform
Get Signature
get isUniform():
boolean
Defined in: libs/scene/src/utility/blueprint/material/texture.ts:1476
Whether this node contains uniform value/texture
Returns
boolean
Whether this node has uniform value
Overrides
paramName
Get Signature
get paramName():
string
Defined in: libs/scene/src/utility/blueprint/material/texture.ts:1479
Uniform parameter name
Returns
string
Set Signature
set paramName(
val):void
Defined in: libs/scene/src/utility/blueprint/material/texture.ts:1482
Uniform parameter name
Parameters
val
string
Returns
void
Uniform parameter name
Overrides
expose
Get Signature
get expose():
boolean
Defined in: libs/scene/src/utility/blueprint/material/texture.ts:1488
Returns
boolean
Set Signature
set expose(
val):void
Defined in: libs/scene/src/utility/blueprint/material/texture.ts:1491
Parameters
val
boolean
Returns
void
sizeOffset
Get Signature
get sizeOffset():
number
Defined in: libs/scene/src/utility/blueprint/material/texture.ts:1497
Returns
number
Set Signature
set sizeOffset(
val):void
Defined in: libs/scene/src/utility/blueprint/material/texture.ts:1500
Parameters
val
number
Returns
void
feather
Get Signature
get feather():
number
Defined in: libs/scene/src/utility/blueprint/material/texture.ts:1506
Returns
number
Set Signature
set feather(
val):void
Defined in: libs/scene/src/utility/blueprint/material/texture.ts:1509
Parameters
val
number
Returns
void
spread
Get Signature
get spread():
number
Defined in: libs/scene/src/utility/blueprint/material/texture.ts:1515
Returns
number
Set Signature
set spread(
val):void
Defined in: libs/scene/src/utility/blueprint/material/texture.ts:1518
Parameters
val
number
Returns
void
edgeCurve
Get Signature
get edgeCurve():
number
Defined in: libs/scene/src/utility/blueprint/material/texture.ts:1524
Returns
number
Set Signature
set edgeCurve(
val):void
Defined in: libs/scene/src/utility/blueprint/material/texture.ts:1527
Parameters
val
number
Returns
void
channelMask
Get Signature
get channelMask():
number[]
Defined in: libs/scene/src/utility/blueprint/material/texture.ts:1533
Returns
number[]
Set Signature
set channelMask(
val):void
Defined in: libs/scene/src/utility/blueprint/material/texture.ts:1536
Parameters
val
number[]
Returns
void
inputs
Get Signature
get inputs():
GraphNodeInput[]
Defined in: libs/scene/src/utility/blueprint/node.ts:380
Gets the input slot definitions array
Returns
Array of input slot definitions
Inherited from
outputs
Get Signature
get outputs():
GraphNodeOutput[]
Defined in: libs/scene/src/utility/blueprint/node.ts:384
Gets the output slot definitions array
Returns
Array of output slot definitions
Inherited from
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
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
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
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
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
getSerializationCls()
staticgetSerializationCls():SerializableClass
Defined in: libs/scene/src/utility/blueprint/material/texture.ts:1544
Returns
toString()
toString():
string
Defined in: libs/scene/src/utility/blueprint/material/texture.ts:1676
Generates a string representation of the node
Returns
string
Empty string by default
Remarks
Subclasses should override this to return valid shader code or a meaningful description of the node's operation.
Overrides
validate()
protectedvalidate():string
Defined in: libs/scene/src/utility/blueprint/material/texture.ts:1679
Validates the node's current state
Returns
string
Error message string, or empty string if valid
Remarks
Default implementation checks if all required inputs are connected. Subclasses can override to add custom validation logic like:
- Type compatibility checking
- Value range validation
- Configuration validation
Example
protected validate(): string {
const baseError = super.validate();
if (baseError) return baseError;
// Custom validation
const type1 = this._inputs[0].inputNode?.getOutputType(0);
const type2 = this._inputs[1].inputNode?.getOutputType(0);
if (type1 !== type2) {
return 'Input types must match';
}
return '';
}Overrides
getType()
protectedgetType():string
Defined in: libs/scene/src/utility/blueprint/material/texture.ts:1724
Gets the type name for a specific output slot
Returns
string
The type name (e.g., 'float', 'vec3', 'mat4')
Remarks
Must be implemented by subclasses to define type resolution logic. The type may depend on connected input types.
Example
protected getType(_id?: number): string {
// Return type based on first input
const inputType = this._inputs[0]?.inputNode?.getOutputType(this._inputs[0].inputId ?? 0);
return inputType ?? 'float';
}Overrides
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
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
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
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
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
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);