Contents

setSemantic(_:forSymbol:options:)

Associates a SceneKit semantic identifier with the specified GLSL vertex attribute or uniform variable.

Declaration

func setSemantic(_ semantic: String?, forSymbol symbol: String, options: [String : Any]? = nil)

Parameters

  • semantic:

    A SceneKit semantic identifier. See Geometry Semantic Identifiers and Rendering Transform Keys for possible values.

  • symbol:

    The name declared in the program’s GLSL source code for the vertex attribute or uniform variable to be associated with the semantic.

  • options:

    A dictionary of options affecting the semantic. See Program Semantic Options for applicable keys and values.

Discussion

Use this method to provide inputs managed by SceneKit to your GLSL program.

To use vertex attributes provided by SCNGeometry objects, use the constants listed in Geometry Semantic Identifiers.

To use the coordinate transformations defined by the scene’s node hierarchy and point-of-view camera, use the constants listed in Rendering Transform Keys.

See Also

Mapping GLSL Symbols to SceneKit Semantics