fix: complete Task 1 by updating shaders for normals and Lambertian lighting
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user