Fixed negative chunks invisible

This commit is contained in:
max
2025-12-14 23:54:22 +01:00
parent a1cdd6b5de
commit 35ecc36bdb
7 changed files with 118 additions and 40 deletions

View File

@@ -61,11 +61,12 @@ namespace Voxel
if (_world == null) return;
int offset = 0;
foreach (Chunk chunk in _world.GetAllChunks())
{
ChunkMesh chunkMesh = chunk.GetChunkMesh();
if (chunkMesh.NeedsUpdate)
if (chunkMesh.NeedsUpdate) // always true
{
byte[] data = chunkMesh.GetPackedData();
GL.BufferSubData(BufferTarget.ShaderStorageBuffer, (IntPtr)offset * 8, chunkMesh.Size * 8, data);