Rendering now works! Added shaders for reference.

This commit is contained in:
Marvin Blum
2016-05-06 16:53:27 +02:00
parent b0d1f24e3d
commit 3a5b66a20c
13 changed files with 508 additions and 40 deletions

12
shader/basic2D.fs Normal file
View File

@@ -0,0 +1,12 @@
#version 130
precision highp float;
uniform sampler2D tex;
in vec2 tc;
out vec4 color;
void main(){
color = texture(tex, tc);
}

13
shader/basic2D.vs Normal file
View File

@@ -0,0 +1,13 @@
#version 130
uniform mat3 o, m;
in vec2 vertex;
in vec2 texCoord;
out vec2 tc;
void main(){
tc = texCoord;
gl_Position = vec4(o*m*vec3(vertex, 1.0), 1.0);
}

12
shader/basic3D.fs Normal file
View File

@@ -0,0 +1,12 @@
#version 130
precision highp float;
uniform sampler2D tex;
in vec2 tc;
out vec4 color;
void main(){
color = texture(tex, tc);
}

13
shader/basic3D.vs Normal file
View File

@@ -0,0 +1,13 @@
#version 130
uniform mat4 pv, m;
in vec3 vertex;
in vec2 texCoord;
out vec2 tc;
void main(){
tc = texCoord;
gl_Position = pv*m*vec4(vertex, 1.0);
}

13
shader/text.fs Normal file
View File

@@ -0,0 +1,13 @@
#version 130
precision highp float;
uniform sampler2D tex;
uniform vec4 color;
in vec2 tc;
out vec4 c;
void main(){
c = texture(tex, tc)*color;
}

13
shader/text.vs Normal file
View File

@@ -0,0 +1,13 @@
#version 130
uniform mat3 o, m;
in vec2 vertex;
in vec2 texCoord;
out vec2 tc;
void main(){
tc = texCoord;
gl_Position = vec4(o*m*vec3(vertex, 1.0), 1.0);
}