Voxel Raytracer Engine
I've been playing with the engine for a couple weeks since my initial post. Kernel performance was a main focus in order to get it up to 60 FPS on my old video card. I thought the chunk hasher may have been a dead end, but it turns out that it's very useful to dynamically load/unload chunks by their coordinates - it's just a matter of keeping the hash array size reasonable. It's very fast (1-2 ms GPU data transfer) with loading 8 chunks (which is also the render distance) and unloading at 12+ chunks distance. Those can be tweaked in the CheckViewChunks() function. Using robin hood hashing, the probe length on collisions averages 2 or less, and is minimized. I finally fixed 'box tests' for tracing through chunks properly, as negative coordinate numbers had caused me problems until I figured it out. My chunk size is 8, it could become 16 and that might speed up rays crossing through the air. Skipping empty chunks massively boosted overall performance of the rendering kernel. It should perform ridiculously fast on a modern GPU. I left in some diagnostic stuff. I think it can be helpful for those trying to build their own engines.