Specifies a block to be called before rendering with programs with the specified GLSL uniform variable or attribute name.
- iOS 8.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
A GLSL uniform variable or attribute name.
A block to be called by SceneKit.
Use this method to associate a block with a SceneKit object (geometry or material) to handle setup of an attribute or uniform variable in a custom
SCNProgram shader associated with that object. SceneKit calls your block before rendering the object. In the block, you can execute any OpenGL commands or other code necessary for preparing your custom shader. For example, the following block updates the
time uniform variable in a custom fragment shader for producing animated effects:
This method is for OpenGL shader programs only. To bind custom variable data for Metal shader programs, use the