1

I'm learning OpenGL ES 2.0 in Android, do you know of a library providing already existing shaders?

I'm on a project with a friend who's developing on iOS, he told me that he can use GLKBaseEffect to avoid devolping custom shaders, as long as we don't need complex features. Is there an equivalent of that BaseEffect in Android?

I'm asking this because the two of us have been assigned this project by a professor, who told us that it's not important for this project to develop custom shaders, so I'm guessing there is a compilation of basical shaders that I can browse. Is that correct?

Thank you for your help!

Alessandro
  • 51
  • 5

1 Answers1

0

Android doesn't support something like the GLKBaseEffect class but I want you to know that shader is just supported for being programable so shader is not hard at all if you use simple shader codes.

If you don't want to do any post imageprocessing don't change fragment shader that is only what you should do.

Vertex shader

attribute vec4 position;
attribute vec4 inputTextureCoordinate;
varying vec2 textureCoordinate;
void main(void)
{ 
gl_Position =  position;
textureCoordinate = inputTextureCoordinate.xy;
}

Fragment shader

uniform sampler2D texture0;
varying vec2 textureCoordinate;
void main()
gl_FragColor = texture2D(texture0, textureCoordinate);
}

Now you need to put only three values position, texture cordinate and texture :) as you need to do anywhere

Sung
  • 1,036
  • 1
  • 8
  • 22