feat: 4x4 atlas with TileCoord-based UVs and grass faces

This commit is contained in:
MDietermann
2026-05-31 21:39:42 +02:00
parent 6eb17b6c5d
commit af7a83300f
3 changed files with 8 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

View File

@@ -9,8 +9,8 @@ public sealed class GrassBlock : IBlock
public TileCoord GetTextureTile(BlockFace face) => face switch public TileCoord GetTextureTile(BlockFace face) => face switch
{ {
BlockFace.Top => new(0, 1), // grass top BlockFace.Top => new TileCoord(0, 1), // grass top
BlockFace.Bottom => new(0, 0), // dirt BlockFace.Bottom => new TileCoord(0, 0), // dirt
_ => new(1, 1) // grass side _ => new TileCoord(1, 1) // grass side
}; };
} }

View File

@@ -0,0 +1,5 @@
namespace VoxelEngine.World.Blocks;
// Position of a tile within the texture atlas, in tile units.
// Origin (0,0) is the top-left tile; X increases right, Y increases down.
public readonly record struct TileCoord(int X, int Y);