By default, when you add a vertex and fragment shader to your project, Xcode mistakenly thinks of them as source files that need to be compiled, and not to resources that need to be linked. This causes the above errors that you see.
Delete the Shader.fsh and Shader.vsh files from the target build phase of the Compile Sources component and make sure that they are present at your stage of copying Bundle Resources.
It's a little strange that your shaders will compile (at runtime, I guess) successfully on the iPad 2, but not on the original iPad. While iPad 2 has significantly greater shader power than iPad 1, there shouldnโt be much that can cause the shader to not work on one when it works on the other. You can try to execute any shader compilation failures using the following code (during the shader compilation process):
glGetShaderiv(*shader, GL_COMPILE_STATUS, &status); if (status != GL_TRUE) { GLint logLength; glGetShaderiv(*shader, GL_INFO_LOG_LENGTH, &logLength); if (logLength > 0) { GLchar *log = (GLchar *)malloc(logLength); glGetShaderInfoLog(*shader, logLength, &logLength, log); NSLog(@"Shader compile log:\n%s", log); free(log); } }
source share