Skip to content
Snippets Groups Projects
Commit 22d8faad authored by Silas Della Contrada's avatar Silas Della Contrada
Browse files

Fixed shaders for OpenGL ES

parent 7e6f484e
No related branches found
No related tags found
No related merge requests found
// fragment shader
#ifdef GL_ES
// Set default precision to medium
precision mediump int;
precision mediump float;
#endif
in vec4 fragColor;// input: interpolated color as rgba-value
in vec2 texCoord;// input: texture coordinate (xy-coordinates)
out vec4 finalColor;// output: final color value as rgba-value
......
// vertex shader
layout(location = 0) in vec3 position; // input: attribute with index '0' with 3 elements per vertex
#ifdef GL_ES
// Set default precision to medium
precision mediump int;
precision mediump float;
#endif
layout(location = 0) in vec3 position;// input: attribute with index '0' with 3 elements per vertex
//layout(location = 1) in vec3 color; // input: attribute with index '1' with 3 elements (=rgb) per vertex
layout(location = 1) in vec2 texcoords; // input: attribute with index '2' with 2 elements per vertex
layout(location = 1) in vec2 texcoords;// input: attribute with index '2' with 2 elements per vertex
//layout(location = 2) in float texnr; // input: attribute with index '3' with 1 float per vertex
out vec4 fragColor; // output: computed fragmentation color
out vec2 texCoord; // output: computed texture coordinates
out vec4 fragColor;// output: computed fragmentation color
out vec2 texCoord;// output: computed texture coordinates
//flat out float texID; // output: texture ID - mind the 'flat' attribute!
void main() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment