Class InputBlock
Hierarchy
- NodeMaterialBlock
- InputBlock
Index
Constructors
Properties
Accessors
Methods
- _deserialize
- animate
- auto
Configure - bind
- build
- clone
- connect
To - dispose
- get
Class Name - get
First Available Input - get
First Available Output - get
Input By Name - get
Output By Name - get
Sibling Output - initialize
- initialize
Defines - is
An Ancestor Of - is
Ready - prepare
Defines - provide
Fallbacks - register
Input - register
Output - replace
Repeatable Content - serialize
- set
As Attribute - set
As System Value - set
Default Value - update
Uniforms And Samples - validate
Block Name
Constructors
constructor
Creates a new InputBlock
Parameters
name: string
defines the block name
Optional target: NodeMaterialBlockTargets
defines the target of that block (Vertex by default)
Optional type: NodeMaterialBlockConnectionPointTypes
defines the type of the input (can be set to NodeMaterialBlockConnectionPointTypes.AutoDetect)
Returns InputBlock
Properties
commentsSearch playground for comments
Gets or sets the comments associated with this block
convert To Gamma SpaceSearch playground for convertToGammaSpace
Gets or sets a boolean indicating if content needs to be converted to gamma space (for color3/4 only)
convert To Linear SpaceSearch playground for convertToLinearSpace
Gets or sets a boolean indicating if content needs to be converted to linear space (for color3/4 only)
group In InspectorSearch playground for groupInInspector
Gets or sets the group to use to display this block in the Inspector
inputs Are ExclusiveSearch playground for inputsAreExclusive
Gets or sets a boolean indicating that only one input can be connected at a time
is BooleanSearch playground for isBoolean
Gets or set a value indicating that this input can only get 0 and 1 values
is ConstantSearch playground for isConstant
Gets or sets a boolean indicating that the value of this input will not change after a build
matrix ModeSearch playground for matrixMode
Gets or sets a value used by the Node Material editor to determine how to configure the current value if it is a matrix
maxSearch playground for max
Gets or set a value used to limit the range of float values
minSearch playground for min
Gets or set a value used to limit the range of float values
on Value Changed ObservableSearch playground for onValueChangedObservable
Gets an observable raised when the value is changed
unique IdSearch playground for uniqueId
Gets or sets the unique id of the node
visible In InspectorSearch playground for visibleInInspector
Gets or sets a boolean indicating that this input can be edited in the Inspector (false by default)
visible On FrameSearch playground for visibleOnFrame
Gets or sets a boolean indicating that this input can be edited from a collapsed frame
Accessors
animation Type
Gets or sets the type of animation applied to the input
Returns AnimatedInputBlockTypes
Gets or sets the type of animation applied to the input
Parameters
value: AnimatedInputBlockTypes
Returns void
associated Variable Name
Gets or sets the associated variable name in the shader
Returns string
Gets or sets the associated variable name in the shader
Parameters
value: string
Returns void
build Id
Gets or sets the build Id
Returns number
Gets or sets the build Id
Parameters
value: number
Returns void
inputs
Gets the list of input points
Returns NodeMaterialConnectionPoint[]
is Attribute
Gets or sets a boolean indicating that this connection point is coming from an attribute. In this case the connection point name must be the name of the attribute to use Can only be set on inputs
Returns boolean
Gets or sets a boolean indicating that this connection point is coming from an attribute. In this case the connection point name must be the name of the attribute to use Can only be set on inputs
Parameters
value: boolean
Returns void
is Final Merger
Gets a boolean indicating that this block is an end block (e.g. it is generating a system value)
Returns boolean
is Input
Gets a boolean indicating that this block is an input (e.g. it sends data to the shader)
Returns boolean
is System Value
Gets a boolean indicating that the current connection point is a system value
Returns boolean
is Undefined
Gets a boolean indicating that this connection point not defined yet
Returns boolean
is Uniform
Gets or sets a boolean indicating that this connection point is coming from an uniform. In this case the connection point name must be the name of the uniform to use. Can only be set on inputs
Returns boolean
Gets or sets a boolean indicating that this connection point is coming from an uniform. In this case the connection point name must be the name of the uniform to use. Can only be set on inputs
Parameters
value: boolean
Returns void
is Unique
Gets a boolean indicating that this block can only be used once per NodeMaterial
Returns boolean
is Varying
Gets or sets a boolean indicating that this connection point is generating a varying variable. Can only be set on exit points
Returns boolean
Gets or sets a boolean indicating that this connection point is generating a varying variable. Can only be set on exit points
Parameters
value: boolean
Returns void
name
Gets the name of the block
Returns string
Sets the name of the block. Will check if the name is valid.
Parameters
newName: string
Returns void
output
Gets the output component
Returns NodeMaterialConnectionPoint
outputs
Gets the list of output points
Returns NodeMaterialConnectionPoint[]
system Value
Gets or sets the current well known value or null if not defined as a system value
Returns Nullable<NodeMaterialSystemValues>
Gets or sets the current well known value or null if not defined as a system value
Parameters
value: Nullable<NodeMaterialSystemValues>
Returns void
target
Gets or sets the target of the block
Returns NodeMaterialBlockTargets
Gets or sets the target of the block
Parameters
value: NodeMaterialBlockTargets
Returns void
type
Gets or sets the connection point type (default is float)
Returns NodeMaterialBlockConnectionPointTypes
value
Gets or sets the value of that point. Please note that this value will be ignored if valueCallback is defined
Returns any
Gets or sets the value of that point. Please note that this value will be ignored if valueCallback is defined
Parameters
value: any
Returns void
value Callback
Gets or sets a callback used to get the value of that point. Please note that setting this value will force the connection point to ignore the value property
Returns (() => any)
Gets or sets a callback used to get the value of that point. Please note that setting this value will force the connection point to ignore the value property
Returns any
Gets or sets a callback used to get the value of that point. Please note that setting this value will force the connection point to ignore the value property
Parameters
value: (() => any)
Returns any
Returns void
will Be Generated Into Vertex Shader From Fragment Shader
Gets a boolean indicating that the code of this block will be promoted to vertex shader even if connected to fragment output
Returns boolean
Methods
_deserializeSearch playground for _deserialize
Parameters
serializationObject: any
scene: Scene
rootUrl: string
Returns void
animateSearch playground for animate
Animate the input if animationType !== None
Parameters
scene: Scene
defines the rendering scene
Returns void
auto ConfigureSearch playground for autoConfigure
Lets the block try to connect some inputs automatically
Parameters
material: NodeMaterial
defines the hosting NodeMaterial
Returns void
bindSearch playground for bind
Bind data to effect. Will only be called for blocks with isBindable === true
Parameters
effect: Effect
defines the effect to bind data to
nodeMaterial: NodeMaterial
defines the hosting NodeMaterial
Optional mesh: Mesh
defines the mesh that will be rendered
Optional subMesh: SubMesh
defines the submesh that will be rendered
Returns void
buildSearch playground for build
Compile the current node and generate the shader code
Parameters
state: NodeMaterialBuildState
defines the current compilation state (uniforms, samplers, current string)
activeBlocks: NodeMaterialBlock[]
defines the list of active blocks (i.e. blocks to compile)
Returns boolean
true if already built
cloneSearch playground for clone
Clone the current block to a new identical block
Parameters
scene: Scene
defines the hosting scene
Optional rootUrl: string
defines the root URL to use to load textures and relative dependencies
Returns null | NodeMaterialBlock
a copy of the current block
connect ToSearch playground for connectTo
Connect current block with another block
Parameters
other: NodeMaterialBlock
defines the block to connect with
Optional options: { input?: string; output?: string; outputSwizzle?: string }
define the various options to help pick the right connections
Optional input?: string
Optional output?: string
Optional output
Swizzle?: string
Returns undefined | InputBlock
the current block
disposeSearch playground for dispose
Release resources
Returns void
get Class NameSearch playground for getClassName
Gets the current class name
Returns string
the class name
get First Available InputSearch playground for getFirstAvailableInput
Will return the first available input e.g. the first one which is not an uniform or an attribute
Parameters
Optional forOutput: Nullable<NodeMaterialConnectionPoint>
defines an optional connection point to check compatibility with
Returns null | NodeMaterialConnectionPoint
the first available input or null
get First Available OutputSearch playground for getFirstAvailableOutput
Will return the first available output e.g. the first one which is not yet connected and not a varying
Parameters
Optional forBlock: Nullable<NodeMaterialBlock>
defines an optional block to check compatibility with
Returns null | NodeMaterialConnectionPoint
the first available input or null
get Input By NameSearch playground for getInputByName
Find an input by its name
Parameters
name: string
defines the name of the input to look for
Returns null | NodeMaterialConnectionPoint
the input or null if not found
get Output By NameSearch playground for getOutputByName
Find an output by its name
Parameters
name: string
defines the name of the output to look for
Returns null | NodeMaterialConnectionPoint
the output or null if not found
get Sibling OutputSearch playground for getSiblingOutput
Gets the sibling of the given output
Parameters
current: NodeMaterialConnectionPoint
defines the current output
Returns null | NodeMaterialConnectionPoint
the next output in the list or null
initializeSearch playground for initialize
Initialize the block and prepare the context for build
Returns void
initialize DefinesSearch playground for initializeDefines
Initialize defines for shader compilation
Parameters
mesh: AbstractMesh
defines the mesh to be rendered
nodeMaterial: NodeMaterial
defines the node material requesting the update
defines: NodeMaterialDefines
defines the material defines to update
Optional useInstances: boolean
specifies that instances should be used
Returns void
is An Ancestor OfSearch playground for isAnAncestorOf
Checks if the current block is an ancestor of a given block
Parameters
block: NodeMaterialBlock
defines the potential descendant block to check
Returns boolean
true if block is a descendant
is ReadySearch playground for isReady
Checks if the block is ready
Parameters
mesh: AbstractMesh
defines the mesh to be rendered
nodeMaterial: NodeMaterial
defines the node material requesting the update
defines: NodeMaterialDefines
defines the material defines to update
Optional useInstances: boolean
specifies that instances should be used
Returns boolean
true if the block is ready
prepare DefinesSearch playground for prepareDefines
Update defines for shader compilation
Parameters
mesh: AbstractMesh
defines the mesh to be rendered
nodeMaterial: NodeMaterial
defines the node material requesting the update
defines: NodeMaterialDefines
defines the material defines to update
Optional useInstances: boolean
specifies that instances should be used
Optional subMesh: SubMesh
defines which submesh to render
Returns void
provide FallbacksSearch playground for provideFallbacks
Add potential fallbacks if shader compilation fails
Parameters
mesh: AbstractMesh
defines the mesh to be rendered
fallbacks: EffectFallbacks
defines the current prioritized list of fallbacks
Returns void
register InputSearch playground for registerInput
Register a new input. Must be called inside a block constructor
Parameters
name: string
defines the connection point name
type: NodeMaterialBlockConnectionPointTypes
defines the connection point type
Optional isOptional: boolean
defines a boolean indicating that this input can be omitted
Optional target: NodeMaterialBlockTargets
defines the target to use to limit the connection point (will be VertexAndFragment by default)
Optional point: NodeMaterialConnectionPoint
an already created connection point. If not provided, create a new one
Returns InputBlock
the current block
register OutputSearch playground for registerOutput
Register a new output. Must be called inside a block constructor
Parameters
name: string
defines the connection point name
type: NodeMaterialBlockConnectionPointTypes
defines the connection point type
Optional target: NodeMaterialBlockTargets
defines the target to use to limit the connection point (will be VertexAndFragment by default)
Optional point: NodeMaterialConnectionPoint
an already created connection point. If not provided, create a new one
Returns InputBlock
the current block
replace Repeatable ContentSearch playground for replaceRepeatableContent
Function called when a block is declared as repeatable content generator
Parameters
vertexShaderState: NodeMaterialBuildState
defines the current compilation state for the vertex shader
fragmentShaderState: NodeMaterialBuildState
defines the current compilation state for the fragment shader
mesh: AbstractMesh
defines the mesh to be rendered
defines: NodeMaterialDefines
defines the material defines to update
Returns void
serializeSearch playground for serialize
Serializes this block in a JSON representation
Returns any
set As AttributeSearch playground for setAsAttribute
Set the source of this connection point to a vertex attribute
Parameters
Optional attributeName: string
defines the attribute name (position, uv, normal, etc...). If not specified it will take the connection point name
Returns InputBlock
the current connection point
set As System ValueSearch playground for setAsSystemValue
Set the source of this connection point to a system value
Parameters
value: Nullable<NodeMaterialSystemValues>
define the system value to use (world, view, etc...) or null to switch to manual value
Returns InputBlock
the current connection point
set Default ValueSearch playground for setDefaultValue
Set the input block to its default value (based on its type)
Returns void
update Uniforms And SamplesSearch playground for updateUniformsAndSamples
Add uniforms, samplers and uniform buffers at compilation time
Parameters
state: NodeMaterialBuildState
defines the state to update
nodeMaterial: NodeMaterial
defines the node material requesting the update
defines: NodeMaterialDefines
defines the material defines to update
uniformBuffers: string[]
defines the list of uniform buffer names
Returns void
validate Block NameSearch playground for validateBlockName
Validates if a name is a reserve word.
Parameters
newName: string
the new name to be given to the node.
Returns boolean
false if the name is a reserve word, else true.
Block used to expose an input value