From 23d88e5f1c8f0c8652a07050fcfa8ff126e85d4a Mon Sep 17 00:00:00 2001 From: Mel Date: Fri, 21 Jul 2023 02:17:03 +0200 Subject: Extremely simple chunk-limited lighting --- assets/shaders/vertex.glsl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'assets/shaders/vertex.glsl') diff --git a/assets/shaders/vertex.glsl b/assets/shaders/vertex.glsl index 1e56809..6902ad4 100644 --- a/assets/shaders/vertex.glsl +++ b/assets/shaders/vertex.glsl @@ -7,9 +7,11 @@ uniform mat4 projection_matrix; layout (location = 0) in vec3 position; layout (location = 1) in vec3 normal; layout (location = 2) in vec2 tex_coord; -layout (location = 3) in float ambient_occlusion; +layout (location = 3) in float light; +layout (location = 4) in float ambient_occlusion; out vec2 frag_tex_coord; +out float frag_light; out float frag_ambient_occlusion; out vec3 surface_normal; out float depth; @@ -21,6 +23,7 @@ void main() { gl_Position = clip_position; frag_tex_coord = tex_coord; + frag_light = light; frag_ambient_occlusion = ambient_occlusion; surface_normal = (model_matrix * vec4(normal, 0.0)).xyz; depth = clamp((length(view_position) - 75) / 125, 0.0, 1.0); -- cgit 1.4.1