This is my attempt at making a voxel engine using C# and Godot game engine.
Libraries used:
- https://github.com/paulohyy/linerenderer
- For bullet line tracers
- https://www.nuget.org/packages/Snappy.NET/
- For voxel chunk compression and decompression
- https://github.com/Zylann/godot_terrain_plugin
- I have this as an addon, but haven't gotten around to using it
VoxelVolume basicVoxel = new VoxelVolume(new NoisePopulator(),128,1024,1024,64,0.25f);
VoxelVolume
takes in an implementation of IVoxelDataPopulate
, volume height, volume length, volume width, chunk size, and voxel size.
- The main voxel code can be found under
src/goxlap
voxelworld.cs
the entry point to the voxel engine, contains theVoxelVolume
,IVoxelDataPopulate
along with the implementations of the interfacechunkmanager.cs
contains theChunkManager
classChunkManager
basic loading of populated voxel chunksChunkStruct
voxel chunk data structure that contains a volume offset, voxel data, compressed voxel data
blockMesher.cs
contains the block meshing codechunk.cs
depricatedvoxelUtils.cs
contains the enum for the voxel types (I need to refactor to use this throughout the code)
- Threaded voxel chunk generation
- Some way to batch the voxel chunks using
MeshInstance
- Camera location based chunk loading
- Greedy meshing for block mesher
- Preliminary implementation done, need to speed up mesh generation
- Other voxel mesher algorithm (marching cubes, dual contouring)
- Voxel chunk collision based on the type of mesher used
- i.e. block mesher would use box colliders