calc normal mat on cpu. use blinn-phong lighting. adjust lighting intensities

This commit is contained in:
2023-11-02 04:00:14 +02:00
parent 12ace9cb13
commit 72992c2e3c
5 changed files with 62 additions and 23 deletions
+2 -1
View File
@@ -9,11 +9,12 @@ out vec2 texCoords;
uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;
uniform mat3 normalMatrix;
void main()
{
gl_Position = projection * view * model * vec4(aPos, 1.0f);
fragNormals = mat3(transpose(inverse(model))) * aNormal;
fragNormals = normalMatrix * aNormal;
fragPos = vec3(model * vec4(aPos, 1.0));
texCoords = aTexCoords;
}