Instance Method

setSemantic:forSymbol:options:

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

Declaration

- (void)setSemantic:(NSString *)semantic forSymbol:(NSString *)symbol options:(NSDictionary<NSString *,id> *)options;

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

SCNProgramMappingChannelKey

The mapping channel to be used for a texture coordinate semantic.

- semanticForSymbol:

Returns the SceneKit semantic identifiers associated with the specified GLSL vertex attribute or uniform variable.

SCNModelTransform

A 4 x 4 matrix for transforming coordinates from model space to scene (or world) space.

SCNModelViewProjectionTransform

A 4 x 4 matrix containing the concatenation of the Model, View, and Projection transformations.

SCNModelViewTransform

A 4 x 4 matrix containing the concatenation of the Model and View transformations.

SCNNormalTransform

A 4 x 4 matrix for transforming surface normal vectors from model space to view (or eye) space.

SCNProjectionTransform

A 4 x 4 matrix for transforming coordinates from view (or eye) space to clip space.

SCNViewTransform

A 4 x 4 matrix for transforming coordinates from scene (or world) space to view (or eye) space.