A simple implementation of the voxel engine used in the comanche video games, also called VoxelSpace.
This was heavily inspired by s-make's github project VoxelSpace.
The difference is that the target is a small arm9 portable game console called the pocketGo, seriously underpowered. And the language is rust.
See the docker image with the arm9 toolchain and a modern version of rust that i use to build the sources.
Benchmark for the version as of this commit (1024x1024 texture and height map, 320x240 screen):
- i7 laptop: 45.2ms / draw debug, 3.2ms / draw release
- pocketGo: 50ms / draw release
The texture is way to large for the pocketGo, but the goal is to push it to its limits. I tried to reduce the memory footprint by using the a colormap (8bit palette) but in the end it was a little bit slower, probably because the full texture is already small enough to fit in caches.
Todo:
- improve performance:
- remove
/and*from the inner loop - Use a smaller scale image for the heightmap/texture at a distance
- remove
- add texture interpolation for the ground
- fix bugs
I use SDL1 since SDL2 is not supported by the PocketGo. I made a fork of the brson/rust-sdl crate to add ARM support.