Options
All
  • Public
  • Public/Protected
  • All
Menu

Class InputBlock

Block used to expose an input value

Hierarchy

Index

Constructors

constructor

Properties

commentsSearch playground for comments

comments: string

Gets or sets the comments associated with this block

convertToGammaSpaceSearch playground for convertToGammaSpace

convertToGammaSpace: boolean

Gets or sets a boolean indicating if content needs to be converted to gamma space (for color3/4 only)

convertToLinearSpaceSearch playground for convertToLinearSpace

convertToLinearSpace: boolean

Gets or sets a boolean indicating if content needs to be converted to linear space (for color3/4 only)

groupInInspectorSearch playground for groupInInspector

groupInInspector: string

Gets or sets the group to use to display this block in the Inspector

inputsAreExclusiveSearch playground for inputsAreExclusive

inputsAreExclusive: boolean

Gets or sets a boolean indicating that only one input can be connected at a time

isBooleanSearch playground for isBoolean

isBoolean: boolean

Gets or set a value indicating that this input can only get 0 and 1 values

isConstantSearch playground for isConstant

isConstant: boolean

Gets or sets a boolean indicating that the value of this input will not change after a build

matrixModeSearch playground for matrixMode

matrixMode: number

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

max: number

Gets or set a value used to limit the range of float values

minSearch playground for min

min: number

Gets or set a value used to limit the range of float values

onValueChangedObservableSearch playground for onValueChangedObservable

onValueChangedObservable: Observable<InputBlock>

Gets an observable raised when the value is changed

uniqueIdSearch playground for uniqueId

uniqueId: number

Gets or sets the unique id of the node

visibleInInspectorSearch playground for visibleInInspector

visibleInInspector: boolean

Gets or sets a boolean indicating that this input can be edited in the Inspector (false by default)

visibleOnFrameSearch playground for visibleOnFrame

visibleOnFrame: boolean

Gets or sets a boolean indicating that this input can be edited from a collapsed frame

Accessors

animationType

  • 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

    Returns any

associatedVariableName

  • get associatedVariableName(): string
  • set associatedVariableName(value: string): any
  • 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 any

buildId

  • get buildId(): number
  • set buildId(value: number): any
  • Gets or sets the build Id

    Returns number

  • Gets or sets the build Id

    Parameters

    • value: number

    Returns any

inputs

isAttribute

  • get isAttribute(): boolean
  • set isAttribute(value: boolean): any
  • 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 any

isFinalMerger

  • get isFinalMerger(): boolean
  • Gets a boolean indicating that this block is an end block (e.g. it is generating a system value)

    Returns boolean

isInput

  • get isInput(): boolean
  • Gets a boolean indicating that this block is an input (e.g. it sends data to the shader)

    Returns boolean

isSystemValue

  • get isSystemValue(): boolean
  • Gets a boolean indicating that the current connection point is a system value

    Returns boolean

isUndefined

  • get isUndefined(): boolean
  • Gets a boolean indicating that this connection point not defined yet

    Returns boolean

isUniform

  • get isUniform(): boolean
  • set isUniform(value: boolean): any
  • 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 any

isUnique

  • get isUnique(): boolean
  • Gets a boolean indicating that this block can only be used once per NodeMaterial

    Returns boolean

isVarying

  • get isVarying(): boolean
  • set isVarying(value: boolean): any
  • 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 any

name

  • get name(): string
  • set name(newName: string): any
  • 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 any

output

outputs

systemValue

  • 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

    Returns any

target

type

value

  • get value(): any
  • set value(value: any): any
  • 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 any

valueCallback

  • get valueCallback(): () => any
  • set valueCallback(value: () => any): 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

      • (): any
      • 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
        • (): any
        • Returns any

    Returns any

willBeGeneratedIntoVertexShaderFromFragmentShader

  • get willBeGeneratedIntoVertexShaderFromFragmentShader(): boolean

Methods

_deserializeSearch playground for _deserialize

  • _deserialize(serializationObject: any, scene: Scene, rootUrl: string): void
  • Parameters

    • serializationObject: any
    • scene: Scene
    • rootUrl: string

    Returns void

animateSearch playground for animate

  • animate(scene: Scene): void
  • Animate the input if animationType !== None

    Parameters

    • scene: Scene

      defines the rendering scene

    Returns void

autoConfigureSearch playground for autoConfigure

  • Lets the block try to connect some inputs automatically

    Parameters

    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 NodeMaterialBlock | null

    a copy of the current block

connectToSearch playground for connectTo

  • connectTo(other: NodeMaterialBlock, options?: { input?: string; output?: string; outputSwizzle?: string }): this | undefined
  • 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 outputSwizzle?: string

    Returns this | undefined

    the current block

disposeSearch playground for dispose

  • dispose(): void
  • Returns void

getClassNameSearch playground for getClassName

  • getClassName(): string
  • Gets the current class name

    Returns string

    the class name

getFirstAvailableInputSearch playground for getFirstAvailableInput

getFirstAvailableOutputSearch playground for getFirstAvailableOutput

getInputByNameSearch playground for getInputByName

  • Find an input by its name

    Parameters

    • name: string

      defines the name of the input to look for

    Returns NodeMaterialConnectionPoint | null

    the input or null if not found

getOutputByNameSearch playground for getOutputByName

  • Find an output by its name

    Parameters

    • name: string

      defines the name of the output to look for

    Returns NodeMaterialConnectionPoint | null

    the output or null if not found

getSiblingOutputSearch playground for getSiblingOutput

initializeSearch playground for initialize

  • initialize(): void

initializeDefinesSearch playground for initializeDefines

  • initializeDefines(mesh: AbstractMesh, nodeMaterial: NodeMaterial, defines: NodeMaterialDefines, useInstances?: boolean): void
  • 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

isAnAncestorOfSearch playground for isAnAncestorOf

  • Checks if the current block is an ancestor of a given block

    Parameters

    Returns boolean

    true if block is a descendant

isReadySearch playground for isReady

  • isReady(mesh: AbstractMesh, nodeMaterial: NodeMaterial, defines: NodeMaterialDefines, useInstances?: boolean): boolean
  • 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

prepareDefinesSearch 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

provideFallbacksSearch playground for provideFallbacks

  • Add potential fallbacks if shader compilation fails

    Parameters

    Returns void

registerInputSearch 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 this

    the current block

registerOutputSearch playground for registerOutput

  • Register a new output. Must be called inside a block constructor

    Parameters

    Returns this

    the current block

replaceRepeatableContentSearch 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

  • serialize(): any
  • Returns any

setAsAttributeSearch playground for setAsAttribute

  • setAsAttribute(attributeName?: string): InputBlock
  • 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

setAsSystemValueSearch playground for setAsSystemValue

  • Set the source of this connection point to a system value

    Parameters

    Returns InputBlock

    the current connection point

setDefaultValueSearch playground for setDefaultValue

  • setDefaultValue(): void
  • Set the input block to its default value (based on its type)

    Returns void

updateUniformsAndSamplesSearch 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

validateBlockNameSearch playground for validateBlockName

  • validateBlockName(newName: string): boolean
  • 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.

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Property
  • Method
  • Static property
  • Static method