From c1c1559007f5557ebfc2a19899224ee9df2f9447 Mon Sep 17 00:00:00 2001 From: Morten Hustveit Date: Tue, 2 Dec 2014 17:21:23 -0500 Subject: ray.c: Calculate reflection only once per hit This saves 10ms on yelena. --- ray.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ray.c') diff --git a/ray.c b/ray.c index 5e8243e..8a236bd 100644 --- a/ray.c +++ b/ray.c @@ -78,9 +78,9 @@ trace(const float s[3], const float d[3], float pixel[3], int n, unsigned int ma for(k = 0; k < 3; ++k) pixel[k] += lights[m].diffuse[k] * objects[j].diffuse[k] * scale; } - - trace(y, r, pixel, n + 1, (1 << j)); } + + trace(y, r, pixel, n + 1, (1 << j)); } } } -- cgit v1.2.3