worked on OpenGL ES

This commit is contained in:
2016-07-15 16:39:38 +02:00
parent 719a66937e
commit 69dfbe6693
10 changed files with 319 additions and 53 deletions

16
res/gl/fragment1.glsl Normal file
View File

@@ -0,0 +1,16 @@
#ifdef GL_ES
// Set default precision to medium
precision mediump int;
precision mediump float;
#endif
uniform sampler2D texture;
varying vec2 v_texcoord;
void main()
{
// Set fragment color from texture
gl_FragColor = texture2D(texture, v_texcoord);
gl_FragColor = vec4(1,1,1,1);
}

22
res/gl/vertex1.glsl Normal file
View File

@@ -0,0 +1,22 @@
#ifdef GL_ES
// Set default precision to medium
precision mediump int;
precision mediump float;
#endif
uniform mat4 mvp_matrix;
attribute vec4 a_position;
attribute vec2 a_texcoord;
varying vec2 v_texcoord;
void main()
{
// Calculate vertex position in screen space
gl_Position = mvp_matrix * a_position;
// Pass texture coordinate to fragment shader
// Value will be automatically interpolated to fragments inside polygon faces
v_texcoord = a_texcoord;
}