import { type UndergroundEdge } from '@pascal-app/viewer'; /** * The ground as the medium, seen from above: over a level below grade the ground stays solid and * a hole opens in it over the below-grade footprint, through which the level is seen clearly. The * hole's edge is a noise threshold, an eroded border: the distance from the footprint is compared * to a radius that wanders with a fractal perlin noise (broad waves with finer ones riding them), * so the cut is a living, eroded line rather than an offset outline. Along it the ground darkens * in a soft feather and a thin light line marks the cut itself. * * The footprint is a signed-distance field baked on the CPU into a small texture when the * footprints change (the polygons the grade ring is drawn from), so the ground's mask costs one * texture fetch and one noise lookup per fragment, whatever the building's outline. How far the * hole is open (0 to 1, eased, 0 in a capture) is the viewer's `groundHoleOpenNode`. */ /** * The shipped edge's base margin around the footprint (metres) and how far the noise moves the * edge in or out of it. The edge looks (`underground-edge.ts`) vary both, and the noise's scale * (cells per metre of its broadest octave, ~1.7 m waves at today's), through uniforms. */ export declare const HOLE_MARGIN: number; export declare const HOLE_ERODE: number; /** * Sets the hole's edge look: the shader's margin, erosion, noise scale, feather and line (all * uniforms, nothing recompiles), and the CPU's twin of them. The pit's walls are cut again by * `GroundHole` after this. */ export declare function setGroundHoleEdge(edge: UndergroundEdge): void; type Point = readonly [number, number]; /** * Bakes the signed distance to `polygons` (the below-grade footprints, world plan) into the * hole's texture. No polygons: the field is far everywhere, so the ground has no hole. */ export declare function setGroundHoleFootprints(polygons: ReadonlyArray>): void; /** The baked signed distance to the footprints at a world XZ (bilinear, as the shader reads it). */ export declare function groundHoleDistanceAt(x: number, z: number): number; /** The baked field's box in the world's plan, `null` while no footprint is baked. */ export declare function groundHoleBox(): { originX: number; originZ: number; span: number; } | null; /** * The hole's radius at a world XZ at full opening, as the shader's noise gives it: what the pit's * walls are laid along (`hole-noise.ts` is that noise on the CPU). */ export declare function holeRadiusAt(x: number, z: number): number; /** * The CPU twin of the hole for one pick: whether `(x, z)` is surely in the hole now. The edge's * noise is not replayed here, so this is the part of the hole that is open whatever the noise * does (margin less the full erosion): a click there falls through to the floor under it, and a * click in the wandering fringe still lands on the ground. */ export declare function groundHoleContains(x: number, z: number): boolean; /** * The mask the solid ground draws with: the ground window's, and not in the hole (the hole's * edge being the noise threshold). Everywhere with the window and the hole closed. */ export declare function solidGroundMaskNode(): import("three/webgpu").Node<"bool">; /** Whether a fragment is in the hole, a hand's width over: what the pit's floor is drawn in. */ export declare function groundHoleFloorNode(): any; /** * How the solid ground receives shadows while the hole is open: not at all. The storeys that are * hidden above the level shown still cast their shadows (so the rooms stay shaded), and on the * ground that would read as ghosts of a building that is not there. */ export declare function groundHoleShadowNode(): () => any; /** * The ground's colour with a soft shade (`shadeColor`) feathered along the hole's cut and a thin * light line on the cut itself; the plain colour with the hole closed. */ export declare function groundHoleColorNode(shadeColor: string): import("three/webgpu").Node<"vec3">; /** * Feeds the hole the footprints it is cut over (the polygons the grade ring runs along: the level * shown and the ones between it and grade), and says to the rest of the viewer whether the scene * has a level below grade at all (`present`): the ground materials carry the hole's mask, and the * eye's fill light is mounted, from then on, once, so that changing floors only changes uniforms. * * It also stands the pit in the hole (`ground-pit.tsx`): walls cut along the hole's own contour * from the ground (`topAt`, at `topY` flat) down to `floorY`, the floor of the level shown, in the * `topsoil` colour at their top; its dark floor is drawn at `drawnFloorY` (`groundPitFloorY`). */ export declare function GroundHole({ footprints, present, floorY, drawnFloorY, topY, topAt, topsoil, }: { footprints: ReadonlyArray>; present: boolean; floorY: number | null; drawnFloorY: number | null; topY: number; topAt: (x: number, z: number) => number; topsoil: string; }): import("react").JSX.Element | null; export {}; //# sourceMappingURL=ground-hole.d.ts.map