summaryrefslogtreecommitdiffstats
path: root/libdimension/lambertian.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2011-12-14 19:27:22 -0500
committerTavian Barnes <tavianator@gmail.com>2011-12-14 19:52:36 -0500
commitbfbe9e43e108f6816c17b9b7764b75284ac78313 (patch)
tree189f85eeec18a76ccb626e45455fa7e45406db7c /libdimension/lambertian.c
parent7db5342a36341b061a8785a3b349cf0fcad69ebf (diff)
downloaddimension-bfbe9e43e108f6816c17b9b7764b75284ac78313.tar.xz
Re-think colors.
Color is a property of light, and thus doesn't include information about transparency. But canvas pixels and object pigments represent a color and a degree of transparency. The new type dmnsn_tcolor/ TColor encapsulates that information. Also, fix the transparent shadow implementation.
Diffstat (limited to 'libdimension/lambertian.c')
-rw-r--r--libdimension/lambertian.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/libdimension/lambertian.c b/libdimension/lambertian.c
index 8227cc5..16dc910 100644
--- a/libdimension/lambertian.c
+++ b/libdimension/lambertian.c
@@ -35,11 +35,7 @@ dmnsn_lambertian_diffuse_fn(const dmnsn_diffuse *diffuse,
{
double *coeff = diffuse->ptr;
double diffuse_factor = fabs((*coeff)*dmnsn_vector_dot(ray, normal));
- dmnsn_color ret
- = dmnsn_color_mul(diffuse_factor, dmnsn_color_illuminate(light, color));
- ret.filter = 0.0;
- ret.trans = 0.0;
- return ret;
+ return dmnsn_color_mul(diffuse_factor, dmnsn_color_illuminate(light, color));
}
dmnsn_diffuse *