worked on OpenGL ES
This commit is contained in:
16
res/gl/fragment1.glsl
Normal file
16
res/gl/fragment1.glsl
Normal 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
22
res/gl/vertex1.glsl
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user