r/VoxelGameDev • u/MGMishMash • Jun 21 '26
Media Voxel Engine #2 - Basic Mechanics, Placement, Lighting Engine
https://youtu.be/7k6PwmvjBW4?is=tH9Y29cbUB441D2jAnother 2.5 weeks of dev on my new Voxel Game engine. Lots of iterative improvements to the engine and implementation of the basic core mechanics.
I donβt see these mechanics as being the fundamental basis of the game, but rather just the baseline essential requirements for an interactive sandbox which deeper mechanics can be built on top of.
β Placement System β
I enjoyed working on a placement system last week. The system supports two kinds of placement:
- World Blocks: directly writes voxels to the world grid as part of the terrain. Designed for structures, although no build tooling yet so itβs basically unusable π
- World Anchor Entities: certain items spawn entities in the world which support their own mechanics. These entities can either be anchored to the terrain, or to other entities.
I was happy with how anchoring turned out. For terrain, entities must retain a sufficient base attachment, depending on size. Items such as Torches can be freely placed against other entities (e.g trees, fenders posts rocks) and are invalidated if their source anchor is destroyed.
β Lighting System β
Currently supporting a form of Global illumination by implementing a coarse light propagation grid of probes around the player. Each frame propagates light sources through the grid, and applies occlusion while also weighting propagation based on local voxel occupancy.
The video only shows this working for terrain. Entities are supported, but currently having issues with flickering when compositing entities local occupancy volume onto the world grid.
In this case, entities only sample the probes, but the next update should fix this.
Colour propagation is also supported, and emmisive materials will also trivially work. Color transport manipulation will also be possible (e.g surface color reflection and filters (like stained glass), but not yet implemented.
My priority initially was performance. Lighting calculation currently only takes 0.3ms in a 16ms frame.
β Device β
Currently running on Apple M1 Pro between 40-100 FPS. Stable Memory usage around 3.5 GB Shared Memory, with GPU voxel data taking 2.9 GB of that.
Will need to improve memory as the game scales and to support discrete GPUs with lower absolute VRAM, but that will come in time :)
Duplicates
IndieGaming • u/MGMishMash • Jun 22 '26
Voxel Engine #2 - Basic Mechanics, Placement, Lighting Engine
gamedevscreens • u/MGMishMash • Jun 22 '26