Shader File Warning for iPad (1st Gene)

I am currently creating an OpenGL ES 2.0 drawing application for the iPad, and I continue to receive the following warnings regarding shaders:

Check Dependencies

Warning [WARN]: there is no rule for processing the file '$ (PROJECT_DIR) / IdeaStorm / Drawing Engine / Shaders / Shader.fsh' such as sourcecode.glsl for the i386 architecture

Warning [WARN]: there is no rule for processing the file '$ (PROJECT_DIR) / IdeaStorm / Drawing Engine / Shaders / Shader.vsh' of type sourcecode.glsl for the i386 architecture

Currently, my drawing application works fine on my second generation iPad with iOS 5, with the exception of this error, and works fine in the simulator as well.

However, the other day I tried to run it on my friends of the 1st generation iPad with iOS 4.3, and the shaders could not compile.

Can someone point me in the right direction regarding this warning and the refusal of shaders to compile for the first generation iPad?

+4
source share
1 answer

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); } } 
+10
source

Source: https://habr.com/ru/post/1379748/


All Articles