Huge skylight optimizations. Also fixed the submodules.

This commit is contained in:
milkwx3
2026-07-04 01:48:50 +03:00
parent 85ddc90883
commit 7ab2d5a083
7 changed files with 81 additions and 52 deletions
+4 -5
View File
@@ -23,21 +23,20 @@ MeshData GenerateChunkMesh(World &world, ChunkRenderData chunkRenderData, Chunk
std::vector<unsigned short> indices;
int face = 0;
for (int x = 0; x < CHUNK_SIZE; ++x)
for (int y = 0; y < WORLD_HEIGHT; ++y)
for (int z = 0; z < CHUNK_SIZE; ++z)
for (int index = 0; index < CHUNK_DATA_SIZE; index++)
{
int index = GetIndexChunk(x,y,z);
uint8_t crdata = chunkRenderData.sides[index];
if (crdata == 0) continue;
int x, y, z;
GetXYZFromIndex(index, &x, &y, &z);
int wx = (chunkWorldX * CHUNK_SIZE + x);
int wy = (y);
int wz = (chunkWorldY * CHUNK_SIZE + z);
int this_block = fetch_block(chunk, x,y,z);
BlockDef definition = BLOCKS[this_block];
BlockDef definition = GetBlockDefinition(this_block);
UVCorners UVside = GetUVTex(definition.textureSide);
UVCorners UVtop = GetUVTex(definition.textureTop);