ObjectGlTex & ObjectGlTexColor now working :o)

This commit is contained in:
Antoine
2021-05-19 15:00:12 +02:00
parent 7f491ad597
commit 57b6be084d
8 changed files with 26 additions and 82 deletions

View File

@ -2,12 +2,11 @@
out vec4 FragColor;
in vec2 TexCoord;
in vec2 texCoord;
uniform sampler2D texture1;
uniform sampler2D texture2;
void main()
{
FragColor = mix(texture(texture1, TexCoord), texture(texture2, vec2(TexCoord)), 0.5);
FragColor = texture(texture1, vec2(texCoord.y, -texCoord.x));
}

View File

@ -1,9 +1,9 @@
#version 330 core
layout (location = 0) in vec3 aPos;
layout (location = 2) in vec3 aTexCoord;
layout (location = 2) in vec2 aTexCoord;
out vec3 texCoord;
out vec2 texCoord;
uniform mat4 transform;

View File

@ -1,13 +1,13 @@
#version 330 core
out vec4 FragColor;
in vec3 ourColor;
in vec2 TexCoord;
in vec4 color;
in vec2 texCoord;
uniform sampler2D texture1;
uniform sampler2D texture2;
void main()
{
FragColor = Color * mix(texture(texture1, TexCoord), texture(texture2, TexCoord), 0.5);
FragColor = texture(texture1, vec2(texCoord.y, -texCoord.x)) * color;
}

View File

@ -2,15 +2,16 @@
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec3 aColor;
layout (location = 2) in vec3 aTexCoord;
layout (location = 2) in vec2 aTexCoord;
out vec3 texCoord;
out vec2 texCoord;
out vec4 color;
uniform mat4 transform;
void main()
{
gl_Position = transform * vec4(aPos, 1.0);
Color = aColor;
color = vec4(aColor, 1.0f);
texCoord = aTexCoord;
}