fix: complete Task 1 by updating shaders for normals and Lambertian lighting

This commit is contained in:
2025-10-02 13:09:35 +02:00
parent 014121b606
commit e6dcc428d4
2 changed files with 6 additions and 7 deletions

View File

@@ -1,7 +1,6 @@
#version 460 core
out layout(location=0) vec4 color;
in vec4 gl_FragCoord;
layout(location = 0) out vec4 color;
in vec4 vColor;
in vec3 vNormal;

View File

@@ -1,15 +1,15 @@
#version 460 core
in layout(location=0) vec3 position;
in layout(location=1) vec4 aColor;
in layout(location=2) vec3 aNormal;
layout(location = 0) in vec3 position;
layout(location = 1) in vec4 aColor;
layout(location = 2) in vec3 aNormal;
out vec4 vColor;
out vec3 vNormal;
uniform mat3 normalMatrix;
layout(location = 0) uniform mat4 transform;
layout(location = 1) uniform mat3 normalMatrix;
void main() {
gl_Position = transform * vec4(position, 1.0f);
gl_Position = transform * vec4(position, 1.0);
vColor = aColor;
vNormal = normalize(normalMatrix * aNormal);
}