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
+6 -1
View File
@@ -34,7 +34,12 @@ self.onmessage = (event: MessageEvent<{ port: MessagePort }>) => {
try {
const raw = (await loaded!).generate(x, z);
const sections = raw.column.sections.map((section) => section.data);
const buffers = sections.flatMap((data) => typeof data === "number" ? [] : [data.buffer]);
// sections can share their biomes' array
const buffers = new Set(
[...sections, ...raw.column.biomes.sections].flatMap((data) =>
typeof data === "number" ? [] : [data.buffer]
),
);
send({ type: "chunk", x, z, sections, spills: raw.spills, biomes: raw.column.biomes }, [
...buffers,
raw.spills.buffer,