Code re-work and content update: lighting.

This commit is contained in:
Joey de Vries
2017-05-30 22:17:40 +02:00
parent 320db41e89
commit e2e36d6ff8
33 changed files with 182 additions and 38 deletions

View File

@@ -0,0 +1,7 @@
#version 330 core
out vec4 FragColor;
void main()
{
FragColor = vec4(1.0); // set alle 4 vector values to 1.0
}

View File

@@ -0,0 +1,11 @@
#version 330 core
layout (location = 0) in vec3 aPos;
uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;
void main()
{
gl_Position = projection * view * model * vec4(aPos, 1.0);
}

View File

@@ -1,5 +1,5 @@
#version 330 core
out vec4 fragColor;
out vec4 FragColor;
struct Material {
sampler2D diffuse;
@@ -43,5 +43,5 @@ void main()
vec3 specular = light.specular * spec * texture(material.specular, TexCoords).rgb;
vec3 result = ambient + diffuse + specular;
fragColor = vec4(result, 1.0f);
FragColor = vec4(result, 1.0);
}

View File

@@ -13,9 +13,9 @@ uniform mat4 projection;
void main()
{
FragPos = vec3(model * vec4(aPos, 1.0f));
FragPos = vec3(model * vec4(aPos, 1.0));
Normal = mat3(transpose(inverse(model))) * aNormal;
TexCoords = aTexCoords;
gl_Position = projection * view * vec4(FragPos, 1.0f);
gl_Position = projection * view * vec4(FragPos, 1.0);
}