summary refs log tree commit diff
path: root/res
diff options
context:
space:
mode:
authoriurii plugatarov <[email protected]>2024-09-07 16:28:02 +0200
committeriurii plugatarov <[email protected]>2024-09-07 16:28:02 +0200
commit5382908378a2e4f4f56eed3fb587a056e01190f9 (patch)
tree06f7e5ec962cc534a141fe04194d7f5d1b92b077 /res
parente4e90e53f02f6a431422c7790a7df34d396a3c6a (diff)
downloadfunhalla-5382908378a2e4f4f56eed3fb587a056e01190f9.tar.gz
update
Diffstat (limited to 'res')
-rw-r--r--res/shaders/colors.fs6
1 files changed, 2 insertions, 4 deletions
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;