/voxel-ray-marching

Optimised ray marching for voxel worlds, written in C# and open sourced from the Vercidium Engine.

Primary LanguageC#Apache License 2.0Apache-2.0

voxel-ray-marching

Optimised ray marching for voxel worlds, written in C# and open sourced from the Vercidium Engine.

The explanation of the source code can be found in this blog post.

References

This voxel ray marching algorithm is based on A Fast Voxel Traversal Algorithm for Ray Tracing by John Amanatides and Andrew Woo and has been optimised by keeping block lookups within the current working chunk.

Benchmarks

Benchmarks were run with a Ryzen 5 1600 CPU.

Ray length (blocks) Ray march time (nanoseconds) Rays per 16ms frame
1-10 250 64000
200-400 3400 4700

In Practice

In Sector's Edge, ray marching is used to calculate particle and projectile collision with the map.

Particles screenshot