[Radiance-general] Mesh Rendering Performance
Gregory J. Ward
gregoryjward at gmail.com
Sat Feb 25 22:42:36 CET 2006
I spent a little time looking at the Moeller-Trumbore ray-triangle
intersection routine. I could in principal apply their technique
rather than the Segura-Feito method I'm using. In comparison, the M-
T algorithm requires one less cross-product, but two more divides
than S-F. Furthermore, M-T computes the Barycentric coordinates and
intersection distance simultaneously, which I end up having to
compute following a successful test. However, I wouldn't be able to
cache edges like I am with S-F, which probably saves 40% of the
computation time. Since I reject between 5 and 10 triangles for
every intersection I end up computing, and only calculate Barycentric
coordinates on at most one ray per mesh, my gut feeling is that the M-
T algorithm would actually be slower if I were to replace the S-F
algorithm I have in there. Of course, you are welcome to try it.
There is also a fair amount of room for optimizing the code in there
using assembler, but I never bother with that....
-Greg
More information about the Radiance-general
mailing list