Simplify shaders, enable coloring of primitives

This commit is contained in:
2016-11-12 01:17:30 +11:00
parent 981d87a2d7
commit 339ae38b38
16 changed files with 96 additions and 82 deletions
-12
View File
@@ -1,12 +0,0 @@
#version 330 core
in vec3 OurColor;
in vec2 TexCoord;
out vec4 color;
uniform sampler2D ourTexture1;
void main()
{
color = texture(ourTexture1, TexCoord);
}
+2 -12
View File
@@ -1,19 +1,9 @@
#version 330 core
layout(location = 0) in vec4 data; // (vec2)pos, (vec2)texCoord
layout (location = 0) in vec3 position;
layout (location = 1) in vec3 color;
layout (location = 2) in vec2 texCoord;
out vec3 OurColor;
out vec2 TexCoord;
uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;
void main()
{
gl_Position = projection * view * model * vec4(position, 1.0f);
OurColor = color;
TexCoord = texCoord;
gl_Position = projection * vec4(data.xy, 0.0f, 1.0f);
}
+8
View File
@@ -0,0 +1,8 @@
#version 330 core
out vec4 color;
uniform vec4 spriteColor;
void main()
{
color = spriteColor;
}
+9
View File
@@ -0,0 +1,9 @@
#version 330 core
layout(location = 0) in vec4 data; // (vec2)pos, (vec2)texCoord
uniform mat4 projection;
void main()
{
gl_Position = projection * vec4(data.xy, 0.0f, 1.0f);
}