https://www.youtube.com/watch?v=TBlYk-_VlOA--- Copy & Paste ---
Turbo Voxel Heightmap Raycaster: This is my highly optimized voxel terrain raycaster engine for PPC Amigas running on a sam460ex with RadeonHD SI.
I'm still not 100% sure what type of game to use it for, so if you got any ideas, go on.
The "content" here in this tech-demo-video, namely the cockpit overlay and the terrain's height- and color-map, weren't drawn by me but were found on the web.
The tech-demo swallows any kind of maps / cockpits as long as the dimensions match and the bitmaps are provided as PNGs (with alpha-channel in case of the cockpit).
How comes I wrote this thing? Well, it somewhat fell into my lap
A week ago some guy came to me with some ten-liner and asked me to optimize it so that it ran faster than less than 10 fps even on a X5000 (5 fps on my sam460). As it turned out he had found that code on some tutorial on the web.
It was a simple heightmap raycaster prototype. A very simple prototype actually. It lacked perspective stripe distortion compensation and also contained a bug that made you look somewhat to the left all the time, as if you moved forward with your head turned left a bit. And well, it was for a tutorial, so it was of course slow as hell but as trivial and short as it can be.
Alright, so I spent some hours to speed it up by about factor 2 to 3 so that it ultimately ran at about 15 fps or so on my sam460. I did so by replacing float by fixpoints, compacting and merging the height- and color-maps, optimizing the fog's color-mixer and some other things. For additional performance I also made a HiColor 16 bit variant because as we all know, uploading a fresh frame of pixels can become a bottleneck on Amigas.
So the guy was happy and since he planned to use a rather small visible area and only wanted to target higher end Amigas it was more than good enough for him. And I was happy to be credited for coding the heart of yet another game
However, I thought that it should be possible to make it even faster by doing some not so trivial optimizations. Some hours later the first turbo was working: from 15 fps to up to around 35. Some more hours later I was where I'm now, at up to 60 fps with visible area almost covering the whole window at 1280 x 960. Without any quality loss. Actually the contrary, because the persptive correction is correct now too
And all the engine's parameters can be modified during runtime instead of using hard-coded constants.
Anyway, those really manly optimizations and the final result I'll keep for myself
Btw.: on an X5000 SI it runs at 110 to 130 fps.
And it has been reported to run smoothly on a Peg with a Radeon 9250
Fun fact: a raycaster was pretty much my very first C(++) program. Back in 1996, right before studies, during a practicum in the robotics lab at the GMD (now Fraunhofer), I was told to write a small simulator for one of those robots. And it had to be C(++) which I didn't know at that time, so it was a crash course in that language resulting also in a raycaster (Wolfenstein-style without texturing though) to simulate and visualize the sonar sensors' input.
Loop closed
--- End ---