Skip to content Skip to sidebar Skip to footer

Not Working Opengl Es Shader, Call Gllinkprogram Every Frame?

I'm trying to make transparent object in OpenGL ES 2.0. It's a live wallpaper, I'm using GLWallpaperService as a base class for this. I'm setting up OpenGL in this way: GLES20.glEn

Solution 1:

You don't need to link your program each frame, link it once and store its id somewhere. Then call GLES20.glUseProgram(_programId); before you issue drawing calls that correspond to that program.

Check this for an already implemented approach: https://github.com/TraxNet/ShadingZen/blob/master/library/src/main/java/org/traxnet/shadingzen/core/ShadersProgram.java (The bindProgram method is what you are after).

Solution 2:

The cause of this misbehavior was not related to glLinkProgram(). I've modified some other GL init parameters (can't recall which at the moment) and now it works just fine.

Post a Comment for "Not Working Opengl Es Shader, Call Gllinkprogram Every Frame?"