1. Often we can either go stack or heap, e.g.
float *co = new float[4]; // 4 rays in this particular packet
vs
float co[32]; // 32 is max packet size
I am inclined to change the former to the latter in the current code
but perhaps my insincts are wrong?
2. A lot of the direct lighting code is:
if shadow directions are normalized
for each shadow ray
20-30 lines of code
else
for each shadow ray
normalize
20-30 lines of code
I am inclined to bite the bullet and change this to
if shadow directions are not normalized
for each shadow ray
normalize
for each shadow ray
20-30 lines of code
My guess is that extra loop is just not that expensive, and the code
is cleaner/smaller.
Opinions on either appreciated. I know profiling is a good answer,
but we don't yet have a full working system with complex models so
I am leery of that now.
Archive powered by MHonArc 2.6.16.