Browse Source

got a textured cube spinning!

master
Gabriel Pariat 3 years ago
parent
commit
949f423732
  1. 15
      shaders/shader.frag
  2. 14
      shaders/shader.vert

15
shaders/shader.frag

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
#version 330 core
out vec4 FragColor;
in vec3 ourColor;
in vec2 TexCoord;
uniform sampler2D texture1;
uniform sampler2D texture2;
void main()
{
FragColor = mix(texture(texture1, TexCoord),
texture(texture2, TexCoord),
0.2);
}

14
shaders/shader.vert

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
#version 330 core
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec2 aTexCoord;
out vec2 TexCoord;
uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;
void main()
{
gl_Position = projection * view * model * vec4(aPos, 1.0);
TexCoord = vec2(aTexCoord.x, aTexCoord.y);
}
Loading…
Cancel
Save