Draw the 3D world's far ground as runs of blocks

Far tiles showed one height and one block per column, sampled from a
single column, so trees became pillars of leaves or vanished.

For each generated chunk the server now finds, in areas 2 to 16 blocks
across, the runs of heights that are solid in at least a quarter of
the area, split where the main block changes and ending at the ground,
as Distant Horizons draws far terrain. Coarser tiles carry these runs
when asked for the ground's shape, and the studio draws each as a box
with its top, its underside where it floats, and the sides its
neighbours leave open, in the average colours of its block's pictures,
which near textures fade to.
This commit is contained in:
piexel committed 2026-11-12 08:41:05 +01:00
1 parent dccdd8c09d
commit 428f9cfb0e
19 files changed
+765 -46

No files matched your search

@@ -52,8 +52,11 @@ export interface TileRequest {
pickNoise: boolean
/** Where the tile's blocks come from, or null for a tile without them. */
blocks: BlockSource | null
/** Whether a tile of a block a pixel with blocks also carries every block seen from the open air. */
voxels?: boolean
/**
* Whether a tile with blocks also carries the ground's shape in 3D: every block seen from the open air at a block a
* pixel, the runs of solid blocks of each cell's area when coarser.
*/
shape?: boolean
}
/** One tile of a pattern: tile (x, z) covers columns × blocksPerColumn blocks from x × that, z × that. */
@@ -143,8 +146,8 @@ export class BridgeClient {
})
if (request.blocks !== null) {
query.set('blocks', request.blocks)
if (request.voxels === true) {
query.set('voxels', '1')
if (request.shape === true) {
query.set('shape', '1')
}
this.cancelOnAbort(query, signal)
}
+25 -5
View File
@@ -1,4 +1,4 @@
import type { LabelKind, MapLabel, MapTile, TileBlocks, TileVoxels } from './types'
import type { LabelKind, MapLabel, MapTile, TileBlocks, TileRuns, TileVoxels } from './types'
const ALIGNMENT_BYTES = 4
@@ -15,9 +15,11 @@ interface TileHeader {
raised?: number
/** How many blocks can be seen from the open air, or -1 on a tile without them. */
voxels?: number
/** How many runs of solid blocks the cells have together, or -1 on a tile without them. */
runs?: number
}
const NO_VOXELS = -1
const NONE = -1
function aligned(bytes: number): number {
return Math.ceil(bytes / ALIGNMENT_BYTES) * ALIGNMENT_BYTES
@@ -48,17 +50,18 @@ export function decodeTile(buffer: ArrayBuffer): MapTile {
regions: new Int16Array(buffer, regionsAt, cells),
heights: header.heights ? new Float32Array(buffer, heightsAt, cells) : null,
pickNoise: header.pickNoise ? new Float32Array(buffer, pickNoiseAt, cells) : null,
blocks: header.blocks == null ? null : decodeBlocks(buffer, groundAt, cells, header.blocks, header.raised ?? 0, header.voxels ?? NO_VOXELS)
blocks: header.blocks == null ? null : decodeBlocks(buffer, groundAt, cells, header.blocks, header.raised ?? 0, header.voxels ?? NONE, header.runs ?? NONE)
}
}
function decodeBlocks(buffer: ArrayBuffer, groundAt: number, cells: number, names: string[], raisedCount: number, voxelCount: number): TileBlocks {
function decodeBlocks(buffer: ArrayBuffer, groundAt: number, cells: number, names: string[], raisedCount: number, voxelCount: number, runCount: number): TileBlocks {
const gridBytes = aligned(cells * Int16Array.BYTES_PER_ELEMENT)
const coverAt = groundAt + gridBytes
const raisedCountsAt = coverAt + gridBytes
const raisedYAt = raisedCountsAt + gridBytes
const raisedAt = aligned(raisedYAt + raisedCount * Int16Array.BYTES_PER_ELEMENT)
const voxelsAt = aligned(raisedAt + raisedCount * Int16Array.BYTES_PER_ELEMENT)
const runsAt = voxelsAt + (voxelCount === NONE ? 0 : voxelBytes(voxelCount))
return {
names,
ground: new Int16Array(buffer, groundAt, cells),
@@ -66,7 +69,8 @@ function decodeBlocks(buffer: ArrayBuffer, groundAt: number, cells: number, name
raisedStart: startsOf(new Int16Array(buffer, raisedCountsAt, cells)),
raisedY: new Int16Array(buffer, raisedYAt, raisedCount),
raised: new Int16Array(buffer, raisedAt, raisedCount),
voxels: voxelCount === NO_VOXELS ? null : decodeVoxels(buffer, voxelsAt, voxelCount),
voxels: voxelCount === NONE ? null : decodeVoxels(buffer, voxelsAt, voxelCount),
runs: runCount === NONE ? null : decodeRuns(buffer, runsAt, cells, runCount),
colors: [],
looks: [],
covers: [],
@@ -74,6 +78,22 @@ function decodeBlocks(buffer: ArrayBuffer, groundAt: number, cells: number, name
}
}
function voxelBytes(count: number): number {
return aligned(count) * 3 + aligned(count * Int16Array.BYTES_PER_ELEMENT) * 2
}
function decodeRuns(buffer: ArrayBuffer, countsAt: number, cells: number, count: number): TileRuns {
const bottomsAt = countsAt + aligned(cells * Int16Array.BYTES_PER_ELEMENT)
const topsAt = bottomsAt + aligned(count * Int16Array.BYTES_PER_ELEMENT)
const blocksAt = topsAt + aligned(count * Int16Array.BYTES_PER_ELEMENT)
return {
starts: startsOf(new Int16Array(buffer, countsAt, cells)),
bottoms: new Int16Array(buffer, bottomsAt, count),
tops: new Int16Array(buffer, topsAt, count),
blocks: new Int16Array(buffer, blocksAt, count)
}
}
function decodeVoxels(buffer: ArrayBuffer, xAt: number, count: number): TileVoxels {
const zAt = xAt + aligned(count)
const yAt = zAt + aligned(count)
+15
View File
@@ -363,6 +363,8 @@ export interface TileBlocks {
raised: Int16Array
/** The blocks seen from the open air, where the tile is a block a column and they were asked for; else null. */
voxels: TileVoxels | null
/** The runs of solid blocks of the area each cell stands for, where the tile is coarser and they were asked for; else null. */
runs: TileRuns | null
/** Each named block's model with its pictures placed, for the blocks {@link voxels} names; the tile source fills it in. */
models: (CoverLook | null)[]
/** The colour of each named block from above, as 0xRRGGBB; the tile source fills it in. */
@@ -389,6 +391,19 @@ export interface TileVoxels {
faces: Uint8Array
}
/**
* The ground of a coarser tile in 3D, as Distant Horizons draws far terrain: for each cell, the runs of solid blocks of
* the area it stands for, highest first. The last run of a cell is its ground, which reaches down out of sight.
*/
export interface TileRuns {
/** Where each cell's runs start in the arrays below, with one more entry for where the last cell's end. */
starts: Int32Array
bottoms: Int16Array
tops: Int16Array
/** The index in the tile's block names of the block most of each run's top shows. */
blocks: Int16Array
}
/** The order of the sides in {@link TileVoxels.faces}. */
export const VOXEL_SIDES = ['down', 'up', 'north', 'south', 'west', 'east'] as const
+3 -2
View File
@@ -57,8 +57,8 @@ function encode(size: number, withHeights: boolean, withPickNoise = false): Arra
return buffer
}
function nothingRaised(cells: number): Pick<TileBlocks, 'raisedStart' | 'raisedY' | 'raised' | 'voxels' | 'models'> {
return { raisedStart: new Int32Array(cells + 1), raisedY: new Int16Array(0), raised: new Int16Array(0), voxels: null, models: [] }
function nothingRaised(cells: number): Pick<TileBlocks, 'raisedStart' | 'raisedY' | 'raised' | 'voxels' | 'runs' | 'models'> {
return { raisedStart: new Int32Array(cells + 1), raisedY: new Int16Array(0), raised: new Int16Array(0), voxels: null, runs: null, models: [] }
}
/** A tile of one pixel with its blocks as the bridge sends them: ground, cover and the raised blocks' counts, heights and blocks. */
@@ -193,6 +193,7 @@ describe('tile style', () => {
raisedY: Int16Array.of(70, 69),
raised: Int16Array.of(1, 2),
voxels: null,
runs: null,
colors: [0x808080, 0x00ff00, 0x654321],
looks: [],
covers: [],
+5 -4
View File
@@ -13,8 +13,8 @@ export interface TileLayer {
pickNoise: boolean
/** Where the tiles' blocks come from, or null for tiles without them. */
blocks: BlockSource | null
/** Whether tiles of a block a pixel with blocks also carry every block seen from the open air, to draw one by one. */
voxels?: boolean
/** Whether tiles with blocks also carry the ground's shape in 3D, to draw it as blocks and runs of blocks. */
shape?: boolean
/** Bumped when the pack is hotloaded, so older tiles are not used again. */
revision: number
}
@@ -43,12 +43,13 @@ export function hasBlocksAt(blocksPerPixel: number): boolean {
*/
export function mapTileSource(client: BridgeClient, tileSize: number, art: BlockArt, mostBlocksPerPixel = MAP_MOST_BLOCKS_PER_PIXEL): TileSource<MapTile, TileLayer, TileStyle> {
return {
layerKey: (layer) => [layer.revision, layer.view, layer.preview ?? '', layer.heights, layer.pickNoise, layer.blocks ?? '', layer.voxels === true].join('/'),
layerKey: (layer) => [layer.revision, layer.view, layer.preview ?? '', layer.heights, layer.pickNoise, layer.blocks ?? '', layer.shape === true].join('/'),
fetch: async (address, layer, signal) => {
const blocks = layer.blocks !== null && address.blocksPerPixel <= mostBlocksPerPixel ? layer.blocks : null
const tile = await client.tile({ ...layer, ...address, size: tileSize, blocks }, signal)
if (tile.blocks !== null) {
await art.paint(tile.blocks, address.blocksPerPixel === TEXTURED_BLOCKS_PER_PIXEL)
// Runs show each block's sides in the colours of its pictures, so their looks are read too.
await art.paint(tile.blocks, address.blocksPerPixel === TEXTURED_BLOCKS_PER_PIXEL || tile.blocks.runs !== null)
}
return tile
},
@@ -23,6 +23,7 @@ function tileWithALeaf(): MapTile {
raisedY: Int16Array.of(LEAF_Y),
raised: Int16Array.of(1),
voxels: null,
runs: null,
colors: [STONE, LEAVES],
looks: [],
covers: [],
@@ -4,6 +4,7 @@ import type { BlockLook } from './blockLooks'
import type { CoverLook } from './coverLooks'
import type { TerrainPictures } from './terrainAtlas'
import type { RaisedBlock, TerrainSurface } from './terrainMesh'
import type { SurfaceRuns } from './runFaces'
import type { SurfaceVoxels } from './voxelMesh'
import { blocksPerColumn, originXOf, originZOf, type TerrainTile } from './terrainTiles'
@@ -93,6 +94,14 @@ export class MapTerrain implements TerrainSurface {
}
}
runs(): SurfaceRuns | null {
const blocks = this.coloring === 'blocks' ? this.tile.blocks : null
if (blocks === null || blocks.runs === null) {
return null
}
return { runs: blocks.runs, cellAt: (column, row) => this.cellAt(column, row), looks: blocks.looks, colors: blocks.colors }
}
colorAt(column: number, row: number): number {
if (this.coloring === 'height') {
return heightColor(this.heightAt(column, row), this.fluidHeight)
@@ -0,0 +1,71 @@
import { Vector3 } from 'three'
import { describe, expect, it } from 'vitest'
import { ColumnField } from './columnField'
import { runFaces, uncovered, type SurfaceRuns } from './runFaces'
import type { TerrainSurface } from './terrainMesh'
const GROUND = 10
const BASE = 0
const CANOPY_BOTTOM = 14
const CANOPY_TOP = 15
// Two columns side by side, a block each: plain ground on the west, ground with a canopy floating over it on the east.
const surface: TerrainSurface = {
columns: 2,
rows: 1,
originX: 0,
originZ: 0,
blocksPerColumn: 1,
groundAt: () => GROUND,
waterAt: () => null,
colorAt: () => 0x808080
}
const runs: SurfaceRuns = {
runs: {
starts: Int32Array.of(0, 1, 3),
bottoms: Int16Array.of(0, CANOPY_BOTTOM, 0),
tops: Int16Array.of(GROUND, CANOPY_TOP, GROUND),
blocks: Int16Array.of(0, 1, 0)
},
cellAt: (column) => column,
looks: [null, null],
colors: [0x808080, 0x00ff00]
}
function faces(): { middle: Vector3; normal: Vector3 }[] {
const geometry = runFaces(new ColumnField(surface), runs, BASE).geometry()
const positions = geometry.getAttribute('position')
const found: { middle: Vector3; normal: Vector3 }[] = []
for (let first = 0; first < positions.count; first += 4) {
const corner = (index: number): Vector3 => new Vector3().fromBufferAttribute(positions, first + index)
const [origin, up, along, far] = [corner(0), corner(1), corner(2), corner(3)]
found.push({ middle: origin.clone().add(far).multiplyScalar(0.5), normal: up.clone().sub(origin).cross(along.clone().sub(origin)).normalize() })
}
return found
}
describe('run faces', () => {
it('finds the parts of a span its neighbours leave open', () => {
expect(uncovered({ bottom: 0, top: 10 }, [{ bottom: 3, top: 5 }])).toEqual([{ bottom: 0, top: 2 }, { bottom: 6, top: 10 }])
expect(uncovered({ bottom: -Infinity, top: 10 }, [{ bottom: -Infinity, top: 12 }])).toEqual([])
})
it('floats a canopy over the ground with its underside showing', () => {
const drawn = faces()
expect(drawn.some((face) => face.normal.y === -1 && face.middle.y === CANOPY_BOTTOM && face.middle.x === 1.5)).toBe(true)
expect(drawn.some((face) => face.normal.y === 1 && face.middle.y === CANOPY_TOP + 1 && face.middle.x === 1.5)).toBe(true)
})
it('shows the side of a run toward a neighbour where the neighbour leaves it open, and walls the field edge down to the base', () => {
const drawn = faces()
const canopyWest = drawn.filter((face) => face.normal.x === -1 && face.middle.x === 1)
const groundBetween = drawn.filter((face) => face.normal.x !== 0 && face.middle.x === 1 && face.middle.y <= GROUND + 1)
expect(canopyWest.map((face) => face.middle.y).sort()).toEqual([CANOPY_BOTTOM + 0.5, CANOPY_TOP + 0.5])
expect(groundBetween).toEqual([])
// Under the top block's side, the wall at the field's edge reaches from the base to the ground's top block.
expect(drawn.some((face) => face.normal.x === -1 && face.middle.x === 0 && face.middle.y === (BASE + GROUND) / 2)).toBe(true)
})
})
+169
View File
@@ -0,0 +1,169 @@
import type { TileRuns } from '../bridge/types'
import type { Direction } from './blockModels'
import type { BlockLook } from './blockLooks'
import type { ColumnField } from './columnField'
import { shaded } from './columnFaces'
import { FACE_LIGHT } from './coverLooks'
import { QuadBatch, type Vec3 } from './quadBatch'
import { sunk, tintAt } from './waterTint'
/** A coarser tile's runs of solid blocks, and how to colour the blocks they name. */
export interface SurfaceRuns {
runs: TileRuns
/** Where a column's runs lie in {@link runs}, by its column and row. */
cellAt(column: number, row: number): number
looks: readonly (BlockLook | null)[]
colors: readonly number[]
}
interface Side {
direction: Direction
columnStep: number
rowStep: number
}
const SIDES: readonly Side[] = [
{ direction: 'north', columnStep: 0, rowStep: -1 },
{ direction: 'south', columnStep: 0, rowStep: 1 },
{ direction: 'west', columnStep: -1, rowStep: 0 },
{ direction: 'east', columnStep: 1, rowStep: 0 }
]
/** A span of heights, both ends included. */
interface Span {
bottom: number
top: number
}
/**
* A coarser tile's ground in 3D: each run of solid blocks of each column as a box as wide as the column, with its top,
* its underside where it floats, and its sides where the columns beside it leave them in the open. The ground reaches
* down to the run under its neighbours' tops, or to {@code base} at the field's edge and beside holes, so tiles next to
* each other leave no cracks. Each face takes the average colour of its block's picture on that side, as the textures of
* finer ground fade to it with distance, so the change from one to the other cannot be seen.
*/
export function runFaces(field: ColumnField, surface: SurfaceRuns, base: number): QuadBatch {
const batch = new QuadBatch(true)
for (let row = 0; row < field.rows; row++) {
for (let column = 0; column < field.columns; column++) {
if (field.hasGround(column, row)) {
addColumn(batch, field, surface, column, row, base)
}
}
}
return batch
}
function addColumn(batch: QuadBatch, field: ColumnField, surface: SurfaceRuns, column: number, row: number, base: number): void {
const { runs } = surface
const cell = surface.cellAt(column, row)
const first = runs.starts[cell]
const last = runs.starts[cell + 1] - 1
const water = field.waterTopAt(column, row)
for (let run = first; run <= last; run++) {
const isGround = run === last
const top = runs.tops[run]
const bottom = runs.bottoms[run]
const block = runs.blocks[run]
if (run === first || runs.bottoms[run - 1] !== top + 1) {
addTop(batch, field, column, row, top + 1, colorOf(surface, block, 'top', FACE_LIGHT.up), water)
}
if (!isGround && (run === last || runs.tops[run + 1] !== bottom - 1)) {
addBottom(batch, field, column, row, bottom, colorOf(surface, block, 'top', FACE_LIGHT.down), water)
}
for (const side of SIDES) {
const neighbour = [column + side.columnStep, row + side.rowStep] as const
const known = field.hasGround(...neighbour) && hasRuns(surface, surface.cellAt(...neighbour))
const lowest = isGround ? (known ? -Infinity : base) : bottom
const covered = known ? spansOf(surface, surface.cellAt(...neighbour)) : []
for (const open of uncovered({ bottom: lowest, top }, covered)) {
addSide(batch, field, surface, column, row, side, open, top, block, water)
}
}
}
}
function hasRuns(surface: SurfaceRuns, cell: number): boolean {
return surface.runs.starts[cell + 1] > surface.runs.starts[cell]
}
// The heights of a column its runs fill, the ground's reaching all the way down.
function spansOf(surface: SurfaceRuns, cell: number): Span[] {
const { runs } = surface
const spans: Span[] = []
const last = runs.starts[cell + 1] - 1
for (let run = runs.starts[cell]; run <= last; run++) {
spans.push({ bottom: run === last ? -Infinity : runs.bottoms[run], top: runs.tops[run] })
}
return spans
}
/** The parts of {@code span} none of {@code covered} fills, lowest first. */
export function uncovered(span: Span, covered: readonly Span[]): Span[] {
let open: Span[] = [span]
for (const cover of covered) {
open = open.flatMap((part) => {
if (cover.top < part.bottom || cover.bottom > part.top) {
return [part]
}
const left: Span[] = []
if (cover.bottom > part.bottom) {
left.push({ bottom: part.bottom, top: cover.bottom - 1 })
}
if (cover.top < part.top) {
left.push({ bottom: cover.top + 1, top: part.top })
}
return left
})
}
return open.filter((part) => part.top >= part.bottom).sort((first, second) => first.bottom - second.bottom)
}
// The top block of a run shows its side picture; the blocks under it, the picture of the blocks under a column's top.
function addSide(batch: QuadBatch, field: ColumnField, surface: SurfaceRuns, column: number, row: number, side: Side, open: Span, runTop: number, block: number, water: number | null): void {
const light = side.direction === 'north' || side.direction === 'south' ? FACE_LIGHT.north : FACE_LIGHT.west
if (open.top === runTop) {
addSideQuad(batch, field, column, row, side, runTop, runTop + 1, colorOf(surface, block, 'side', light), water)
}
const belowTop = open.top === runTop ? runTop - 1 : open.top
if (belowTop >= open.bottom) {
addSideQuad(batch, field, column, row, side, open.bottom, belowTop + 1, colorOf(surface, block, 'below', light), water)
}
}
function addSideQuad(batch: QuadBatch, field: ColumnField, column: number, row: number, side: Side, from: number, to: number, color: Vec3, water: number | null): void {
const step = field.blocksPerColumn
const x = field.originX + column * step
const z = field.originZ + row * step
const up: Vec3 = [0, to - from, 0]
const [origin, along]: [Vec3, Vec3] =
side.rowStep < 0
? [[x, from, z], [step, 0, 0]]
: side.rowStep > 0
? [[x + step, from, z + step], [-step, 0, 0]]
: side.columnStep < 0
? [[x, from, z + step], [0, 0, -step]]
: [[x + step, from, z], [0, 0, step]]
batch.add(origin, along, up, underWater(color, from, water), underWater(color, to, water))
}
function addTop(batch: QuadBatch, field: ColumnField, column: number, row: number, y: number, color: Vec3, water: number | null): void {
const step = field.blocksPerColumn
const shown = underWater(color, y, water)
batch.add([field.originX + column * step, y, field.originZ + row * step], [step, 0, 0], [0, 0, step], shown, shown)
}
function addBottom(batch: QuadBatch, field: ColumnField, column: number, row: number, y: number, color: Vec3, water: number | null): void {
const step = field.blocksPerColumn
const shown = underWater(color, y, water)
batch.add([field.originX + column * step, y, field.originZ + row * step], [0, 0, step], [step, 0, 0], shown, shown)
}
function colorOf(surface: SurfaceRuns, block: number, face: 'top' | 'side' | 'below', light: number): Vec3 {
const look = surface.looks[block]
return shaded(look === null || look === undefined ? surface.colors[block] : look[face].color, light)
}
function underWater(color: Vec3, y: number, water: number | null): Vec3 {
return water === null ? color : sunk(color, tintAt(water - y))
}
@@ -6,6 +6,7 @@ import { coverGeometry } from './coverFaces'
import type { CoverLook } from './coverLooks'
import { QuadBatch } from './quadBatch'
import { addRaisedFaces } from './raisedFaces'
import { runFaces, type SurfaceRuns } from './runFaces'
import { voxelGeometries, type SurfaceVoxels } from './voxelMesh'
import type { TerrainPictures } from './terrainAtlas'
import type { ColumnArea } from './terrainTiles'
@@ -41,6 +42,8 @@ export interface TerrainSurface {
* ground lies; null to draw the columns.
*/
voxels?(): SurfaceVoxels | null
/** The runs of solid blocks of each column's area, to draw in place of the columns' tops; null to draw the columns. */
runs?(): SurfaceRuns | null
}
/** A solid block above a column's ground, drawn as a whole block. */
@@ -76,6 +79,10 @@ export function buildTerrainMesh(surface: TerrainSurface, base: number, holes: r
if (voxels !== null && field.pictures !== null) {
return voxelMesh(field, voxels, field.pictures)
}
const runs = surface.runs?.() ?? null
if (runs !== null) {
return runMesh(field, runs, base)
}
const groundBatch = groundFaces(field, base)
const seeThroughBatch = new QuadBatch(true, field.pictures?.plain ?? null)
addRaisedFaces(field, groundBatch, seeThroughBatch)
@@ -119,6 +126,15 @@ function voxelMesh(field: ColumnField, voxels: SurfaceVoxels, pictures: TerrainP
return { object: group, field, dispose: () => parts.forEach((part) => part.dispose()) }
}
function runMesh(field: ColumnField, runs: SurfaceRuns, base: number): TerrainMesh {
const batch = runFaces(field, runs, base)
const parts = [meshOf(batch.geometry(), new MeshBasicMaterial({ vertexColors: true, side: FrontSide })), meshOf(waterFaces(field).geometry(), waterMaterial())]
const group = new Group()
// The water is drawn last, over what stands under it.
group.add(...parts.map((part) => part.mesh))
return { object: group, field, dispose: () => parts.forEach((part) => part.dispose()) }
}
function meshOf(geometry: BufferGeometry, material: MeshBasicMaterial): { mesh: Mesh; dispose(): void } {
return {
mesh: new Mesh(geometry, material),
@@ -29,7 +29,7 @@ const MOST_BLOCKS_PER_COLUMN = 2 ** COARSEST_LEVEL
// Tiles with generated blocks take seconds to minutes each. The same tiles without them stand in, but only on ground
// where no tile with blocks of any level is known yet.
function withoutBlocks(layer: TileLayer): TileLayer | null {
return layer.blocks === null ? null : { ...layer, blocks: null, voxels: false }
return layer.blocks === null ? null : { ...layer, blocks: null, shape: false }
}
interface WorldStudio3DProps {
@@ -59,7 +59,7 @@ export function WorldStudio3D({ title, client, world, mapArea, packRevision, onS
)
const showsBlocks = coloring === 'blocks'
const layer = useMemo<TileLayer>(
() => ({ view: 'biomes', preview: null, heights: true, pickNoise: false, blocks: showsBlocks ? 'generated' : null, voxels: showsBlocks, revision: packRevision }),
() => ({ view: 'biomes', preview: null, heights: true, pickNoise: false, blocks: showsBlocks ? 'generated' : null, shape: showsBlocks, revision: packRevision }),
[packRevision, showsBlocks]
)
const style = useMemo<TerrainStyle<MapTile>>(