|
![](/i/fill.gif) |
Warp wrote:
>>If D is actually a unit vector like it is supposed to be
>
>
> It isn't. The macro does not assume that the direction vector of the
> ray (D) is a unit vector, and it usually isn't.
>
I guess you are right.
Trace(-z*3, <CoordX, CoordY, 3>, 1);
With that 3 in there in what eventually gets thrown into D it clearly
won't be normalized. Since the code actually does the ray intersection
test in this code with every sphere in the scene it might run faster if
this line did normalize it.
Trace(-z*3, vnormalize(<CoordX, CoordY, 3>), 1);
But that has a sqrt funtion in it so I'm not sure if the three
optimizations that run with every ray test will be worth it for the
number of spheres.
I might get around to testing it later.
Post a reply to this message
|
![](/i/fill.gif) |