diff options
Diffstat (limited to '')
-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; |