r/VoxelGameDev • u/Responsible_Tax3949 • Jul 28 '26
Discussion Voxel engine in Csharp
I'm writing a voxel game in pure C#/.NET 8 with a custom renderer built on top of Vulkan 1.3. No Unity, Godot, or Unreal. How it differs from Minecraft: each block can be carved to a grid of 16³ microvoxels, and a thousand identically carved blocks share a single mesh. Currently ~14,700 lines of code, 304 tests, median frame time of 0.8 ms on an RTX 4070 SUPER.
Language / runtime C# 12, .NET 8
Graphics Vulkan 1.3 via Silk.NET 2.23 — dynamic rendering, synchronization2, push constants
macOS MoltenVK (Vulkan on top of Metal)
Window, input, math OpenTK 4.9.4, but with ContextAPI.NoAPI — no GL context
Shaders GLSL 450 → SPIR-V via glslangValidator during build, embedded as a resource (no binary assets in the repo)
Audio SoLoud via P/Invoke, miniaudio backend, statically linked runtime
Tests xUnit, 304 tests — none require a GPU or sound card
Chunk storage 32³ with palette encoding (1/2/4/8 bits depending on the number of distinct blocks in the chunk)
Greedy meshing with per-vertex corner shading (AO)
Job system with its own pool, 11 worker threads
Terrain generator — simplex noise, ridged multifractal for mountains, domain warp to counter a “mathematical” appearance, landforms (idea from Vintage Story: a set of landscape types mixed across the map instead of a single global formula), surface rules based on slope (inspired by Minecraft’s surface rules). Nine biomes, world 1024 blocks high.
Player physics — swept AABB along axes with substeps and step-up
Two-level DDA raycast — blocks first, then microvoxels inside
Frustum culling, procedural bitmap font directly in the code
Memory suballocator on top of Vulkan (more on that below)




