From 8fc69c2b21dc101c04495c4689587e99a70cf875 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Tue, 14 Feb 2017 00:24:32 -0800 Subject: ray: add highlight exponent to ray_surface_t Was a constant at 20, this allows it to be specified per-object. --- src/modules/ray/ray_scene.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/modules/ray/ray_scene.c') diff --git a/src/modules/ray/ray_scene.c b/src/modules/ray/ray_scene.c index 496c447..b4cddad 100644 --- a/src/modules/ray/ray_scene.c +++ b/src/modules/ray/ray_scene.c @@ -83,10 +83,8 @@ static inline ray_color_t shade_ray(ray_scene_t *scene, ray_ray_t *ray, ray_obje diffuse = ray_3f_mult_scalar(&diffuse, surface.diffuse); color = ray_3f_add(&color, &diffuse); - /* FIXME: assumes light is a point for its color, and 20 is a constant "Phong exponent", - * which should really be object/surface-specific - */ - specular = ray_3f_mult_scalar(&scene->lights[i].light.emitter.point.surface.color, powf(rvec_lvec_dot, 20)); + /* FIXME: assumes light is a point for its color */ + specular = ray_3f_mult_scalar(&scene->lights[i].light.emitter.point.surface.color, powf(rvec_lvec_dot, surface.highlight_exponent)); specular = ray_3f_mult_scalar(&specular, surface.specular); color = ray_3f_add(&color, &specular); #else -- cgit v1.2.3