Saturday, July 15, 2006

Voxel Traversal hard work again!!!

Oh man, what a crazy day of programming and sortof successful, not as great as previous days this week, but not too bad I guess!! :) In the style of last night when I programmed Fresnel reflection which isn't an objective for my Raytracer but I thought it would be cool, I tried to do sub-mesh Voxels today!

This meant that I needed to completely reorganize my structure again, so that Primitives know their parents and a bunch of other crazy stuff. In the end I mostly managed to get this working, and to get Triangles actually associated with Voxels. This seems easy at first, but I have a lot of crazy issues like now needing to do all the hierarchical raytracing change of coordinate system stuff in the Primitive intersection code now, instead of in the Scene where I have done it up till now. I also want to continue to support my older code, so that I can continue to render without spatial subdivisions on. So this was a ton of code and after hours of writing new copy constructors and a bunch of crazyness, hehe it *totally* didn't work. :) Hehe ohhh Voxels, you jerks. I figured it was going to be easy to do this but there were about 50 more issues I didn't initially expect... oh well.

Anyway after yet more reorganization and after taking a decent break for dinner, I got back to it and fixed some issues with the organization. I think my polys are not totally returning the closest intersection. Or something is weird. Anyway this is pretty close but there is some issue I can't figure out at the moment.

Well after all this crazyness... I rendered the Venus De Milo mesh, and compared it to running it with Grid Subdivisions and without this extra triangle feature... this is crazy and awesome. So if I can get the normals or the intersection stuff or whatnot figured out, then this will be great.

It went from 2752 seconds (approx 46 minutes) of render time to 143 seconds (approx 2 minutes)?!?!? Whhhoooaa!! Hehe so I guess this ridiculously insane effort IS worth it in terms of render time... sweet.


Hehe totally not working


Haha you can see the Voxel grid boundary?!?!


Still super wrong


Hehe well at least some of the image still works??!!


Hierarchical with mesh problems... some shadow issue or visibility error...


Venus De Milo with Grid Traversal, pre-triangle/voxel code


Venus De Milo runtime with Grid Traversal, pre-triangle/voxel code, 46 minutes


Venus De Milo with Grid Traversal, with triangle/voxel code... incorrect at the moment, but fast!


Venus De Milo with Grid Traversal, with triangle/voxel code... super fast, 2 minutes!

No comments: