Contents

setParameter(name:value:)

Sets the value of a parameter by name.

Declaration

mutating func setParameter(name: String, value newValue: MaterialParameters.Value) throws

Parameters

  • name:

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

Discussion

Call this method to drive a shader-graph input from Swift — for example, to animate a portal’s opacity each frame, or to swap in a different texture in response to user input.

See Also

Accessing shader parameters