3D biomes

This commit is contained in:
2026-11-07 12:13:43 -03:00
parent b726ce9695
commit 22191d260c
53 changed files with 874 additions and 316 deletions
+3 -1
View File
@@ -199,7 +199,8 @@ export function chunk_worker(
// the sections of the middle one of 3x3 chunks meshed by a chunk worker, asked for the way the client asks: all of
// them, or the indexes in options.sections. the chunks are each block's value in one array, y from the bottom of the
// world then z then x, null where there's none. what comes back is each section's mesh, and all of them put together:
// world then z then x, null where there's none, all of one biome whose grass, foliage and water colors are each chunk's
// options.biome_colors. what comes back is each section's mesh, and all of them put together:
// their layers' quads one after another, their light, their visuals with indexes in the whole chunk (like an array's)
// and the bounds of them all
export async function mesh_column(
@@ -231,6 +232,7 @@ export async function mesh_column(
first,
chunks: columns.map((column) => column?.sections.slice(first, end).map((section) => section.data) ?? null),
sky: columns.map((column) => column && column_heights(column, opacity).slice(CHUNK_AREA)),
biomes: columns.map((column) => column?.biomes.sections.slice(first, end) ?? null),
biome_colors: options.biome_colors ?? chunks.map(() => null),
camera: options.camera ?? [0, 0, 0],
};