optimized faces

This commit is contained in:
maxwes08
2025-12-15 10:14:16 +01:00
parent 0641d22c9b
commit f532eddfbb
11 changed files with 107 additions and 141 deletions

View File

@@ -40,7 +40,7 @@ namespace Voxel
Y = y;
_blockData = new Dictionary<ushort, BlockData>();
_blocks = new Blocks[Size * Size * Height];
_blocks = new Blocks[TotalBlocks];
_chunkMesh = new ChunkMesh(X, Y);
Initialize();
@@ -219,14 +219,16 @@ namespace Voxel
private void AddFace(int x, int y, int z, int face, Textures texture, List<FaceData> faces)
{
faces.Add(new FaceData
{
Facing = (Orientation)face,
Texture = texture,
X = (byte)x,
Y = (byte)y,
Z = (byte)z
});
byte lightLevel = 15;
faces.Add(new FaceData(
(byte)x,
(byte)y,
(byte)z,
(Orientation)face,
texture,
lightLevel
));
}
public ChunkMesh GetChunkMesh()