androidShaderExample failed creating GL_VERTEX_SHADER shader


#1

Dear,

I need run glsl shader on android.But the example of Of can’t work.

the version of opengl es had set to 2 like below:
ofGLESWindowSettings settings;
settings.setGLESVersion(2);
ofCreateWindow(settings); // <-------- setup the GL context

My android studio is 2.3.3, Of is :of_v0.10.0_android_release, and use the gradle-experimental:0.9.3 .
The sdk version :
compileSdkVersion = 25
buildToolsVersion = “25.0.3”

    defaultConfig.with {
        minSdkVersion.apiLevel    = 19
        targetSdkVersion.apiLevel = 19
        versionCode     =  1
        versionName     = "1.0"
    }

I have set the GLES version to 1, but also some shader can’t create.
I have check all error info in google ,forum,github. But all method I have tried can’t not helped me resolved this problem.

this line is glerror get:
06-29 17:16:58.213 5305-5338/cc.openframeworks.androidShaderExample V/ofShader: setupShaderFromSource(): OpenGL error after checkAndCreateProgram() (probably harmless): error 1282

The all log is below.

06-29 17:16:58.061 5305-5338/cc.openframeworks.androidShaderExample E/ofShader: setupShaderFromSource(): failed creating GL_VERTEX_SHADER shader
06-29 17:16:58.061 5305-5338/cc.openframeworks.androidShaderExample E/ofShader: setupShaderFromSource(): failed creating
precision highp float;
#define IN attribute
#define OUT varying
#define TEXTURE texture2D
#define TARGET_OPENGLES
uniform mat4 projectionMatrix; uniform mat4 modelViewMatrix; uniform mat4 textureMatrix; uniform mat4 modelViewProjectionMatrix; IN vec4 position; IN vec2 texcoord; IN vec4 color; IN vec3 normal; OUT vec4 colorVarying; OUT vec2 texCoordVarying; OUT vec4 normalVarying; void main() { colorVarying = color; texCoordVarying = (textureMatrix*vec4(texcoord.x,texcoord.y,0,1)).xy; gl_Position = modelViewProjectionMatrix * position; } shader
06-29 17:16:58.061 5305-5338/cc.openframeworks.androidShaderExample E/ofShader: setupShaderFromSource(): failed creating GL_VERTEX_SHADER shader
06-29 17:16:58.061 5305-5338/cc.openframeworks.androidShaderExample E/ofShader: setupShaderFromSource(): failed creating
precision highp float;
#define IN attribute
#define OUT varying
#define TEXTURE texture2D
#define TARGET_OPENGLES

06-29 17:16:58.062 5305-5338/cc.openframeworks.androidShaderExample E/ofShader: bindDefaults(): trying to link GLSL program, but no shaders created yet
06-29 17:16:58.062 5305-5338/cc.openframeworks.androidShaderExample E/ofShader: bindDefaults(): trying to link GLSL program, but no shaders created yet
06-29 17:16:58.062 5305-5338/cc.openframeworks.androidShaderExample E/ofShader: linkProgram(): trying to link GLSL program, but no shaders created yet
06-29 17:16:58.062 5305-5338/cc.openframeworks.androidShaderExample E/ofShader: linkProgram(): trying to link GLSL program, but no shaders created yet
06-29 17:16:58.062 5305-5338/cc.openframeworks.androidShaderExample E/ofShader: bindDefaults(): trying to link GLSL program, but no shaders created yet
06-29 17:16:58.062 5305-5338/cc.openframeworks.androidShaderExample E/ofShader: linkProgram(): trying to link GLSL program, but no shaders created yet
06-29 17:16:58.062 5305-5338/cc.openframeworks.androidShaderExample E/ofShader: setupShaderFromSource(): failed creating GL_VERTEX_SHADER shader