Jonas Sourlier
Jonas Sourlier

Reputation: 14475

Source code of GLKBaseEffect's standard shaders

My understanding of GLKBaseEffect is that it comes with some kind of general-purpose vertex and fragment shaders, and when [baseEffect prepareToDraw] is called, the effect passes its property values like transform and fog to OpenGL uniforms and attributes, so that the default shaders receive the uniforms they expect.

Does anybody know how those uniforms and attributes are named? Better, does anybody have the source code of the standard shaders of GLKBaseEffect?

Upvotes: 0

Views: 397

Answers (1)

Frogblast
Frogblast

Reputation: 1681

You can use the Frame Debugger in Xcode 4 to take a look at the generated GLSL. If you want to modify your usage of these shaders, you are better off copying the shader source into your own app, rather than relying on GLKit to generate them at runtime.

The uniform names in particular are a private implementation detail of GLKit, and can and will change at any time, which will break any app that tries to set these fields directly. If you snapshot the shader text yourself, then there are no such concerns.

Upvotes: 1

Related Questions