summaryrefslogtreecommitdiff
path: root/ray.c
diff options
context:
space:
mode:
authorMorten Hustveit <morten.hustveit@gmail.com>2014-12-02 17:21:23 -0500
committerMorten Hustveit <morten.hustveit@gmail.com>2014-12-02 17:21:23 -0500
commitc1c1559007f5557ebfc2a19899224ee9df2f9447 (patch)
tree09d39f9acd268edb5a211d297e9d9aa6ebb14805 /ray.c
parentb95d4c408a9f4161d29cbd9058b62a0b5079dea8 (diff)
ray.c: Calculate reflection only once per hit
This saves 10ms on yelena.
Diffstat (limited to 'ray.c')
-rw-r--r--ray.c4
1 files changed, 2 insertions, 2 deletions
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));
}
}
}