added ObjectGlTexColor, tweaked shaders

This commit is contained in:
Antoine
2021-05-19 05:37:45 +02:00
parent 58e94314cc
commit 7f491ad597
10 changed files with 51 additions and 33 deletions

View File

@ -1,10 +1,13 @@
#version 330 core
in vec3 Color;
out vec4 FragColor;
in vec2 TexCoord;
uniform sampler2D texture1;
uniform sampler2D texture2;
void main()
{
FragColor = vec4(Color, 1.0f);
FragColor = mix(texture(texture1, TexCoord), texture(texture2, vec2(TexCoord)), 0.5);
}

View File

@ -1,12 +1,14 @@
#version 330 core
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec3 aColor;
layout (location = 2) in vec3 aTexCoord;
out vec3 Color;
out vec3 texCoord;
uniform mat4 transform;
void main()
{
gl_Position = vec4(aPos, 1.0);
Color = aColor;
gl_Position = transform * vec4(aPos, 1.0);
texCoord = aTexCoord;
}