Use this entry point to deform a geometry’s surface or alter its vertex attributes.
- iOS 8.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Shader modifiers for this entry point execute in the vertex processing stage.
The geometry entry point declares the following structure:
Your shader modifier reads from this structure and writes new values to the same structure to alter the geometric properties of each vertex in a geometry.
tangent fields are expressed in model space. You can use SceneKit’s uniforms (such as
u) to operate in a different coordinate space, but you must convert back to model space before writing results.
k variable is a constant integer corresponding to the geometry’s number of texture coordinate sources. Each set of coordinates in the
texcoords field contains raw values from the geometry—SceneKit applies the
contents transformation (if any) after the geometry shader modifier completes.
The below shader modifier produces an animated sinusoidal deformation: