summaryrefslogtreecommitdiffstats
path: root/libdimension/diffuse.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdimension/diffuse.c')
-rw-r--r--libdimension/diffuse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libdimension/diffuse.c b/libdimension/diffuse.c
index 75d4c52..910e23f 100644
--- a/libdimension/diffuse.c
+++ b/libdimension/diffuse.c
@@ -32,7 +32,7 @@ dmnsn_diffuse_finish_fn(const dmnsn_finish *finish,
dmnsn_vector ray, dmnsn_vector normal)
{
double *diffuse = finish->ptr;
- double diffuse_factor = (*diffuse)*dmnsn_vector_dot(ray, normal);
+ double diffuse_factor = fabs((*diffuse)*dmnsn_vector_dot(ray, normal));
dmnsn_color ret
= dmnsn_color_mul(diffuse_factor, dmnsn_color_illuminate(light, color));
ret.filter = 0.0;