/// <summary> /// Done while BuildVBO generating /// </summary> void GenOcclusionForChunk(CubeChunk3D _chunk, int _chX, int _chY, int _chZ) { int x, y, z; //Reset occlusion map Array.Clear(m_abyOcclusionCubeMap, 0, m_abyOcclusionCubeMap.Length); //Make occlusion SmallCube c; for (x = 0; x < CubeArray3D.CHUNKSIZE; x++) { for (y = 0; y < CubeArray3D.CHUNKSIZE; y++) { for (z = 0; z < CubeArray3D.CHUNKSIZE; z++) { _chunk.GetCube(x, y, z, out c); //Opaque if (c.byMatL0 != 0) { _GenOcclusionPerCube(_chX + x, _chY + y, _chZ + z, x, y, z); } } } } }
//Generate cubes for a chunk //.position in chunk idx void GenChunkVBO(CubeChunk3D _chunk, int _chX, int _chY, int _chZ) { SmallCube c; int x, y, z; for (x = 0; x < CubeArray3D.CHUNKSIZE; x++) { for (y = 0; y < CubeArray3D.CHUNKSIZE; y++) { for (z = 0; z < CubeArray3D.CHUNKSIZE; z++) { _chunk.GetCube(x, y, z, out c); if (c.byMatL0 != 0) { GenCubeVBO2(c, _chX + x, _chY + y, _chZ + z, x, y, z); } } } } }