Add texture shaders

This commit is contained in:
jgk
2021-06-11 19:41:39 +02:00
parent 7b6521587d
commit afece392f7
2 changed files with 22 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
#version 430 core
in vec2 vTexPos;
out vec4 fColor;
uniform sampler2D theTexture;
void main()
{
fColor = texture(theTexture, vTexPos);
}
+12
View File
@@ -0,0 +1,12 @@
#version 430 core
layout (location = 0) in vec3 pos;
layout (location = 1) in vec2 texPos;
out vec2 vTexPos;
uniform mat4 worldMat;
void main()
{
gl_Position = worldMat * vec4(pos,1);
vTexPos = texPos;
}