Vercidium / voxel-ray-marching

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

Home Page:https://sectorsedge.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

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

https://sectorsedge.com

License:Apache License 2.0


Languages

Language:C# 100.0%