From 5382908378a2e4f4f56eed3fb587a056e01190f9 Mon Sep 17 00:00:00 2001 From: iurii plugatarov Date: Sat, 7 Sep 2024 17:28:02 +0300 Subject: update --- res/shaders/colors.fs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'res/shaders') diff --git a/res/shaders/colors.fs b/res/shaders/colors.fs index 6a42cbd..56762e1 100644 --- a/res/shaders/colors.fs +++ b/res/shaders/colors.fs @@ -9,7 +9,7 @@ struct Material { }; struct Light { - vec3 position; + vec3 direction; vec3 ambient; vec3 diffuse; vec3 specular; @@ -19,9 +19,7 @@ in vec3 Normal; in vec3 FragPos; in vec2 TexCoords; -uniform vec3 light_position; uniform vec3 view_position; - uniform Material material; uniform Light light; @@ -31,7 +29,7 @@ void main() { // diffuse vec3 norm = normalize(Normal); - vec3 light_dir = normalize(light_position - FragPos); + vec3 light_dir = normalize(-light.direction); float diff = max(dot(norm, light_dir), 0.0); vec3 diffuse = light.diffuse * diff * texture(material.diffuse, TexCoords).rgb; -- cgit 1.4.1-2-gfad0