diff options
author | iurii plugatarov <[email protected]> | 2024-09-07 16:28:02 +0200 |
---|---|---|
committer | iurii plugatarov <[email protected]> | 2024-09-07 16:28:02 +0200 |
commit | 5382908378a2e4f4f56eed3fb587a056e01190f9 (patch) | |
tree | 06f7e5ec962cc534a141fe04194d7f5d1b92b077 /res | |
parent | e4e90e53f02f6a431422c7790a7df34d396a3c6a (diff) | |
download | funhalla-5382908378a2e4f4f56eed3fb587a056e01190f9.tar.gz |
update
Diffstat (limited to 'res')
-rw-r--r-- | res/shaders/colors.fs | 6 |
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; |