Started working on lighting

This commit is contained in:
Robert 2020-09-07 10:44:51 +02:00
parent 5e086c884f
commit 9007d33028
12 changed files with 156 additions and 57 deletions

View file

@ -1,20 +0,0 @@
#version 460 core
in vec3 VertexColor;
in vec2 TexCoord;
out vec4 fragColor;
uniform sampler2D texture1;
uniform sampler2D texture2;
uniform float t;
void main()
{
fragColor = mix(
texture(texture1, TexCoord + vec2(t, 0)),
texture(texture2, TexCoord + vec2(0, t)), 0.5) * vec4(VertexColor,
1.0
);
}

View file

@ -1,13 +0,0 @@
#version 460 core
out vec4 fragmentColor;
in vec2 textureCoords;
in vec3 vertexCoords;
uniform sampler2D lauch;
void main()
{
fragmentColor = texture(lauch, textureCoords);
}

View file

@ -0,0 +1,10 @@
#version 460 core
out vec4 fragColor;
uniform vec3 color;
void main()
{
fragColor = vec4(color, 1.0f);
}

View file

@ -1,19 +1,12 @@
#version 460 core
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec3 aCol;
layout (location = 2) in vec2 aTex;
uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;
out vec3 VertexColor;
out vec2 TexCoord;
void main()
{
gl_Position = projection * view * model * vec4(aPos, 1.0f);
VertexColor = aCol;
TexCoord = aTex;
}

View file

@ -0,0 +1,12 @@
#version 460 core
in vec2 vertexUV;
out vec4 fragmentColor;
uniform sampler2D modelTexture;
void main()
{
fragmentColor = texture(modelTexture, vertexUV);
}

View file

@ -3,16 +3,15 @@
layout (location = 0) in vec3 aPos;
layout (location = 1) in vec2 aTex;
out vec2 vertexUV;
uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;
out vec3 vertexCoords;
out vec2 textureCoords;
void main()
{
gl_Position = projection * view * model * vec4(aPos, 1.0f);
textureCoords = aTex;
vertexCoords = aPos;
vertexUV = aTex;
}