From 75a9c87b50cef2f1d749bd9042a9348bc28b4c09 Mon Sep 17 00:00:00 2001 From: Mel Date: Sun, 23 Oct 2022 02:48:51 +0200 Subject: Sun lighting --- assets/shaders/vertex.glsl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'assets/shaders/vertex.glsl') diff --git a/assets/shaders/vertex.glsl b/assets/shaders/vertex.glsl index 1ad43f4..c59d6cd 100644 --- a/assets/shaders/vertex.glsl +++ b/assets/shaders/vertex.glsl @@ -5,11 +5,15 @@ uniform mat4 view_matrix; uniform mat4 projection_matrix; layout (location = 0) in vec3 position; -layout (location = 1) in vec2 tex_coord; +layout (location = 1) in vec3 normal; +layout (location = 2) in vec2 tex_coord; out vec2 frag_tex_coord; +out vec3 surface_normal; void main() { gl_Position = projection_matrix * view_matrix * model_matrix * vec4(position, 1.0); frag_tex_coord = tex_coord; + + surface_normal = (model_matrix * vec4(normal, 0.0)).xyz; } \ No newline at end of file -- cgit 1.4.1