API

Function NodeMaterialParseFromSnippetAsync

  • Creates a node material from a snippet saved by the node material editor

    Parameters

    • this: void | typeof NodeMaterial
    • snippetId: string

      defines the snippet to load

    • scene: Scene = ...

      defines the hosting scene

    • rootUrl: string = ""

      defines the root URL to use to load textures and relative dependencies

    • OptionalnodeMaterial: NodeMaterial

      defines a node material to update (instead of creating a new one)

    • skipBuild: boolean = false

      defines whether to build the node material

    • waitForTextureReadyness: boolean = false

      defines whether to wait for texture readiness resolving the promise (default: false)

    • OptionalurlRewriter: (url: string) => string

      defines a function used to rewrite urls

    • Optionaloptions: Partial<INodeMaterialOptions>

      defines options to be used with the node material

    Returns Promise<NodeMaterial>

    a promise that will resolve to the new node material