contest fix
Henry Cejtin
henry@sourcelight.com
Thu, 5 Oct 2000 05:09:00 -0500
I looked at the chess board with my fix in, and it is much much better, but
the cones on the tops of knights still have bad reflections. As one example,
the base of the cone (which forms the back of the knight head) seems to be
flat matt in our version, while in the winner version it is some kind
interesting pattern. It is placed on there by the figureSurface function.
As to the scratch marks and my gross fix, I now remembered my notion of how
this should work, and it still should be fine. The point is that you never,
in the end, see a ray leaving a surface unless it started on the surface.
The reason is that they told us that they would not start with the eye inside
an object, so the first intersection is entering, and you never go inside
anything: you always bounce or stop.
Thus the only correction to the basic objects is to make sure that the
startInside is set correctly: If a ray never intersects an object (either
forwards or backwards) then you can just do some measure of if it starts
inside. If you are wrong (because it starts very close) that is ok. If
going forward ever intersects, then if it is going in you started out and if
it is going out you started in. (Note the case where it is tangent (i.e.,
the dot product of the direction and the normal is 0) does not count as a hit
at all.) If the forward never intersects but the backwards does then you do
the same with the notion reversed.
Now, while you are following a ray, if the first intersection exists and is
leaving, ignore it. You must have started on that very object.
Viola. I remember when I figured this out during the contest, but I got
confused at some point, probably when I switched to the basic objects and
described what should be done to you Stephen. Definitely too bad.
Any way, I'm pretty sure that at least part of the remaining cone problem is
your not passing on the texture map for the plane at the base of the cone. I
don't know if that is everything though.