feat: 4x4 atlas with TileCoord-based UVs and grass faces
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 9.3 KiB |
@@ -9,8 +9,8 @@ public sealed class GrassBlock : IBlock
|
||||
|
||||
public TileCoord GetTextureTile(BlockFace face) => face switch
|
||||
{
|
||||
BlockFace.Top => new(0, 1), // grass top
|
||||
BlockFace.Bottom => new(0, 0), // dirt
|
||||
_ => new(1, 1) // grass side
|
||||
BlockFace.Top => new TileCoord(0, 1), // grass top
|
||||
BlockFace.Bottom => new TileCoord(0, 0), // dirt
|
||||
_ => new TileCoord(1, 1) // grass side
|
||||
};
|
||||
}
|
||||
|
||||
5
World/Blocks/TileCoord.cs
Normal file
5
World/Blocks/TileCoord.cs
Normal 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);
|
||||
Reference in New Issue
Block a user