Contents

parameterHandle(name:)

Returns a handle for the parameter with the given name.

Declaration

static func parameterHandle(name: String) -> MaterialParameters.Handle

Parameters

  • name:

    The name of the parameter as declared in the shader graph.

Return Value

A handle that identifies the parameter on any PortalMaterial whose program declares an input with the given name.

Discussion

Handles bypass the per-call string lookup that setParameter(name:value:) and getParameter(name:) perform. In performance-sensitive code that updates the same parameter every frame, obtain a handle once during setup and reuse it.

See Also

Accessing shader parameters