Great moogie, I am interested to see where you get this.Its better doing something slow and getting it done than producing broken code in a few hours.
True, however with doing it slow and steady means that I do not have yet have a result to show for my effort... and that makes it hard to keep motivated
The RTRT implemented in java will not be able to ray trace all pixels + secondary rays and achieve decent frame rate on average hardware. This is due to the fact that we cannot use SIMD instructions and can not optimise for a particular platform (not should we want to, we want as many people as possible to play
However all is not lost as i have a couple of "cheats" to get better frame rate with little sacrifice to the image.
1. As a first pass, only render the corner pixels of 4x4 blocks. If the ray of each corner hits the same primitive then we assume that the rest of the pixels of the block hit the same object. using this assumption we can interpolate the point of intersections saving much computation! If the corner pixels do not hit the same object then ray trace the remaining pixels of the block as per normal. This will effectively reduce the number of pixels to ray trace by 16 times. Other attributes, such as texture co ordinates, whether in shadow, surface normal, etc can also be interpolated.
2. using a Bounding Volume Heirachy will accelerate ray object intersections by only testing against a subset of the objects. This will also give us the ability to start "looking" for the intersecting object given the current pixel's ray's last intersected object which will again reduce the number of objects to test against.
3. (to be tested) in the case that the 4 corner pixels of a 4x4 do not match then for the remaining pixels only test for intersection with the objects that the corner pixels intersect with.
With all these optimisers I am hopeful decent frame rates can be achieved.