API

Class NodeMaterialBlock

Defines a block that can be used inside a node based material

Hierarchy (View Summary)

Index
  • Creates a new NodeMaterialBlock

    Parameters

    • name: string

      defines the block name

    • target: NodeMaterialBlockTargets = NodeMaterialBlockTargets.Vertex

      defines the target of that block (Vertex by default)

    • isFinalMerger: boolean = false

      defines a boolean indicating that this block is an end block (e.g. it is generating a system value). Default is false

    • isFinalOutput: boolean = false

      defines a boolean indicating that this block is generating a final output and no other block should be generated after

    Returns NodeMaterialBlock

comments: string = ""

Gets or sets the comments associated with this block

inputsAreExclusive: boolean = false

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

onCodeIsReadyObservable: any = ...

Observable raised when the block code is ready (if the code loading is async)

uniqueId: number

Gets or sets the unique id of the node

visibleInInspector: boolean = false

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

visibleOnFrame: boolean = false

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

  • 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

    • useInstances: boolean = false

      specifies that instances should be used

    Returns boolean

    true if the block is ready

  • Update defines for shader compilation

    Parameters

    • defines: NodeMaterialDefines

      defines the material defines to update

    • nodeMaterial: NodeMaterial

      defines the node material requesting the update

    • Optionalmesh: AbstractMesh

      defines the mesh to be rendered

    • useInstances: boolean = false

      specifies that instances should be used

    • OptionalsubMesh: SubMesh

      defines which submesh to render

    Returns void

  • Function called when a block is declared as repeatable content generator

    Parameters

    • vertexShaderState: NodeMaterialBuildState

      defines the current compilation state for the vertex shader

    • defines: NodeMaterialDefines

      defines the material defines to update

    • Optionalmesh: AbstractMesh

      defines the mesh to be rendered

    Returns void

  • 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