summaryrefslogtreecommitdiff
path: root/src/modules/ray/ray_scene.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@gnugeneration.com>2017-02-14 00:24:32 -0800
committerVito Caputo <vcaputo@gnugeneration.com>2017-02-14 00:46:17 -0800
commit8fc69c2b21dc101c04495c4689587e99a70cf875 (patch)
treeeb05dae0e2a145d6cbb97ad5c66f0d9e441184b5 /src/modules/ray/ray_scene.c
parent2e300062591398269e27fe2b359ed28030bc788e (diff)
ray: add highlight exponent to ray_surface_t
Was a constant at 20, this allows it to be specified per-object.
Diffstat (limited to 'src/modules/ray/ray_scene.c')
-rw-r--r--src/modules/ray/ray_scene.c6
1 files changed, 2 insertions, 4 deletions
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
© All Rights Reserved