InputBlock

Block used to expose an input value

Hierarchy

Index

Constructors

constructor

Find examples in Playground

Properties

comments

Find examples in Playground
comments: string

Gets or sets the comments associated with this block

groupInInspector

Find examples in Playground
groupInInspector: string

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

inputsAreExclusive

Find examples in Playground
inputsAreExclusive: boolean

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

isBoolean

Find examples in Playground
isBoolean: boolean

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

isConstant

Find examples in Playground
isConstant: boolean

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

matrixMode

Find examples in Playground
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

max

Find examples in Playground
max: number

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

min

Find examples in Playground
min: number

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

name

Find examples in Playground
name: string

Gets or sets the name of the block

onValueChangedObservable

Find examples in Playground
onValueChangedObservable: Observable<InputBlock>

Gets an observable raised when the value is changed

uniqueId

Find examples in Playground
uniqueId: number

Gets or sets the unique id of the node

visibleInInspector

Find examples in Playground
visibleInInspector: boolean

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

Accessors

animationType

Find examples in Playground

associatedVariableName

Find examples in Playground
  • 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

Find examples in Playground
  • get buildId(): number
  • set buildId(value: number): any

inputs

Find examples in Playground

isAttribute

Find examples in Playground
  • 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

Find examples in Playground
  • 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

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

    Returns boolean

isSystemValue

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

    Returns boolean

isUndefined

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

    Returns boolean

isUniform

Find examples in Playground
  • 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

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

    Returns boolean

isVarying

Find examples in Playground
  • 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

output

Find examples in Playground

outputs

Find examples in Playground

systemValue

Find examples in Playground

target

Find examples in Playground

type

Find examples in Playground

value

Find examples in Playground
  • 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

Find examples in Playground
  • get valueCallback(): function
  • set valueCallback(value: function): 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 function

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

    Returns any

Methods

_deserialize

Find examples in Playground
  • _deserialize(serializationObject: any, scene: Scene, rootUrl: string): void
  • Parameters

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

    Returns void

animate

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

    Parameters

    • scene: Scene

      defines the rendering scene

    Returns void

autoConfigure

Find examples in Playground

bind

Find examples in Playground
  • 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

    Returns void

build

Find examples in Playground
  • 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

clone

Find examples in Playground
  • 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 Nullable<NodeMaterialBlock>

    a copy of the current block

connectTo

Find examples in Playground
  • Connect current block with another block

    Parameters

    • other: NodeMaterialBlock

      defines the block to connect with

    • Optional options: object

      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

dispose

Find examples in Playground
  • dispose(): void

getClassName

Find examples in Playground
  • getClassName(): string

getFirstAvailableInput

Find examples in Playground

getFirstAvailableOutput

Find examples in Playground

getInputByName

Find examples in Playground

getOutputByName

Find examples in Playground

getSiblingOutput

Find examples in Playground

initialize

Find examples in Playground

initializeDefines

Find examples in Playground
  • 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

isReady

Find examples in Playground
  • 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

prepareDefines

Find examples in Playground
  • prepareDefines(mesh: AbstractMesh, nodeMaterial: NodeMaterial, defines: NodeMaterialDefines, useInstances?: boolean): void
  • 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

    Returns void

provideFallbacks

Find examples in Playground

registerInput

Find examples in Playground
  • 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)

    Returns this

    the current block

registerOutput

Find examples in Playground

replaceRepeatableContent

Find examples in Playground

serialize

Find examples in Playground
  • serialize(): any

setAsAttribute

Find examples in Playground
  • 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

setAsSystemValue

Find examples in Playground
  • Set the source of this connection point to a system value

    Parameters

    Returns InputBlock

    the current connection point

setDefaultValue

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

    Returns void

updateUniformsAndSamples

Find examples in Playground
  • 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

Generated using TypeDoc