API

Class AddBlock

Block used to add 2 vectors

Hierarchy

  • BaseMathBlock
    • AddBlock
Index
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

  • get willBeGeneratedIntoVertexShaderFromFragmentShader(): boolean

    Gets a boolean indicating that the code of this block will be promoted to vertex shader even if connected to fragment output

    Returns boolean

  • 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

  • Initialize the block and prepare the context for build

    Parameters

    • state: NodeMaterialBuildState

      defines the state that will be used for the build

    Returns void

  • Initialize defines for shader compilation

    Parameters

    • defines: NodeMaterialDefines

      defines the material defines to update

    Returns void

  • 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

  • Validates the new name for the block node.

    Parameters

    • newName: string

      the new name to be given to the node.

    Returns boolean

    false if the name is a reserve word, else true.