btipling / blockens

blockens with zig
MIT License
15 stars 0 forks source link

lighting ideas #13

Closed btipling closed 4 months ago

btipling commented 6 months ago

Given the packed voxels struct idea in https://github.com/btipling/zig-tests/blob/main/packed_to_u32_to_u8.zig empty voxels can have lighting! Fill empty voxels with lighting and then use the adjacent blocks light level to light the surface of non empty voxels.

Add opacity level instead of selected

const Voxel = packed struct {
    block_id: u8, // 256 different block types,
    andorment_id: u7, // 128 different adornments 
    up_x: i2,
    up_y: i2,
    up_z: i2,
    health: u4,
    lighting: u4,
    opacity: u3,
};

low opacity blocks can get lighting from adjacent lit bocks to emit themselves

btipling commented 4 months ago

This is done