Block visuals

This commit is contained in:
2026-10-13 23:52:30 -03:00
parent 55ad08266e
commit 6ad476ac18
19 changed files with 854 additions and 14 deletions
+5
View File
@@ -35,6 +35,9 @@ export type ToChunkWorker =
models: Record<string, ModelJson>;
textures_info: Record<string, SpriteRegion>;
image: { width: number; height: number };
// the numeric ids of blocks with visuals, and whether each visual replaces the block's model, see
// ctx.render.register_visual
visuals: [number, boolean][];
}
| {
type: "mesh";
@@ -89,6 +92,8 @@ export type FromChunkWorker =
// the chunk's light, one byte per block indexed like its blocks: block light << 4 | sky light, like sodium's
// packed light data. entities are lit from it
light: Uint8Array<ArrayBuffer>;
// the blocks in it with visuals, as pairs of the block's index in the chunk (like light's) and its value
visuals: Uint32Array<ArrayBuffer>;
}
| {
type: "sorted";