summaryrefslogtreecommitdiff
path: root/engine/fragment.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'engine/fragment.glsl')
-rw-r--r--engine/fragment.glsl5
1 files changed, 5 insertions, 0 deletions
diff --git a/engine/fragment.glsl b/engine/fragment.glsl
index 428e87f..a9d192b 100644
--- a/engine/fragment.glsl
+++ b/engine/fragment.glsl
@@ -30,5 +30,10 @@ void main()
in_texture_coords
);
+ float attenuation = calc_attenuation(light, in_frag_pos);
+
+ diffuse_light *= attenuation;
+ specular_light *= attenuation;
+
FragColor = vec4((ambient_light + diffuse_light + specular_light), 1.0);
}