everything works when you palce the light in the right spot

This commit is contained in:
JISAUAY committed 2024-09-26 12:21:54 -05:00
1 parent 83feee2706
commit 60457309ae
5 files changed
+48 -28

No files matched your search

+2 -1
View File
@@ -29,7 +29,8 @@ void main()
vec3 ambient = ambientStrength * lightColor;
fragColor = vec4((ambient + diffuse) * objectColor, 1.0);
vec3 result = (ambient + diffuse) * objectColor;
fragColor = vec4(result, 1.0);
// vec3 lightDir = LightPos - FragPos;
// float distance = length(lightDir);
+2 -1
View File
@@ -16,7 +16,8 @@ void main()
// * view * model
gl_Position = projection * model * vec4(position, 1.0);
FragPos = vec3(model * vec4(position, 1.0));
Normal = normal;
Normal = transpose(inverse(mat3(model))) * normal;
LightPos = lightPos;
// Normal = normal;
}