facett-map3d/Cargo.toml
[package]
name = "facett-map3d"
description = "facett — 3D map viewer: extrude OSM ways into 3D (building footprints → prisms, terrain plane, camera orbit); CPU painter + wgpu fast path; znippy rabbit as the synthetic 3D fixture"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
# Development notes, agent instructions and machine-local tooling stay in the
# repository; they are not part of the published crate.
exclude = [
".nornir/",
]
[features]
# `wgpu` turns on the GPU depth-tested 3D map renderer (the lit `egui_wgpu` paint
# callback that draws the extruded prisms + terrain). OFF by default: the CPU
# painter projects + back-face-culls + depth-sorts + lights the triangles itself,
# so a host with no wgpu RenderState still gets a real, lit 3D map. ON gives the
# host the GPU fast path (reuses facett-graph3d's depth-tested pipeline for the
# rabbit logo overlay).
default = []
wgpu = ["dep:egui-wgpu", "dep:wgpu", "dep:bytemuck", "facett-graph3d/wgpu", "facett-map/wgpu"]
# L4: functional-status emitter passthrough (see facett-core). No-op in release —
# the self-test's emit + its expensive detail-building are gated behind this, so a
# release build carries no emit call and no nornir-testmatrix edge.
testmatrix = ["facett-core/testmatrix"]
[dependencies]
# `web_time::Instant` for the GPU upload/blit wall clocks: `std::time::Instant::now()`
# PANICS on wasm32-unknown-unknown ("time not implemented on this platform"), measured
# 2026-09-28 in the browser on the osm3d GPU lane. Same as std on native; already in the
# graph through egui (1.1.0), so it adds no build.
web-time = "1"
facett-core = { path = "../facett-core", version = "0.3.0" }
facett-map = { path = "../facett-map", version = "0.2.0" }
facett-graph3d = { path = "../facett-graph3d", version = "0.2.0" }
egui = { workspace = true }
serde = { version = "1", features = ["derive"] }
serde_json = { workspace = true }
# GFX_V2 item 3 — the ONE deliberate exception to facett's hand-rolled-math default.
# 4x4 camera/shadow/inverse algebra maps 1:1 onto WGSL (`Mat4` IS `mat4x4<f32>`:
# `#[repr(C)]`, 64 B, column-major), it auto-vectorises where our scalar `set(row,
# col, ..)` loops cannot, and it deleted a hand-transcribed MESA cofactor inverse.
# NOT optional and NOT behind `wgpu`: `sky.rs` is CPU-painter code too. Kept lean —
# no `bytemuck` feature, because the public signatures stay `[f32; 16]`, so nothing
# on the GPU upload path changed shape. Local pin (not `[workspace.dependencies]`)
# matches how `wgpu`/`bytemuck` are declared here: one crate uses it so far.
glam = { version = "0.33", default-features = false, features = ["std"] }
# GATLING multicore is LAW (rayon is FORBIDDEN). The extrusion fan (extrude.rs:
# per-way prism/ribbon work into per-worker Mesh3 arenas, concatenated with index
# rebase) and the CPU z-buffer rasteriser (lib.rs raster_zbuffer: disjoint
# color+invz scanline rows) both run through znippy's fork-join gatling — the same
# engine + version pin facett-core's `gatling_scanlines` raster already uses.
znippy-zoomies = { path = "../../znippy-zoomies", version = "0.1.26" }
# GPU 3D-map deps (only compiled with the `wgpu` feature). Versions match the
# egui 0.34 stack (egui-wgpu 0.34 → wgpu 29), same as facett-map / facett-graph3d.
# `default-features = false`: egui-wgpu's default list ends in `wgpu/webgl`, which
# compiles wgpu's WebGL2 backend (and `glow`) into every wasm surface that reaches
# this crate. facett renders on WebGPU (`preferred_backends()` is
# `Backends::BROWSER_WEBGPU` on wasm32), so that backend is unreachable dead weight
# in the browser download. Features are additive and unify across the graph, so it
# can only be kept out where it is switched on. The two defaults that carry weight
# are re-listed; `wgpu/default` comes from the direct `wgpu` dep below, so native
# Vulkan/Metal/DX12 are unchanged. See facett-core/Cargo.toml for the full rationale.
egui-wgpu = { version = "0.36", optional = true, default-features = false, features = [
"fragile-send-sync-non-atomic-wasm",
"macos-window-resize-jitter-fix",
] }
wgpu = { workspace = true, optional = true }
bytemuck = { version = "1", optional = true, features = ["derive"] }
[dev-dependencies]
# `facett_core::golden` — THE before/after pixel predicate (`moved` + `MinChange`), used
# by the post-FX bypass proof (tests/postfx_bypass.rs) to assert the bypassed and the
# full-post frames genuinely DIFFER, rather than re-rolling a pixel comparison. Same
# dev-dependency form facett-map uses for the same reason (LAW #5).
facett-core = { path = "../facett-core", version = "0.3.0", features = ["golden"] }
# Render PROOF (LAW #4 "non-blank render", tests/render_proof.rs) — the wgpu
# backend egui_kittest provides, same as facett-map / facett-graph3d.
egui_kittest = { version = "0.36", features = ["wgpu", "snapshot"] }
image = { version = "0.25", default-features = false, features = ["png"] }
# Adapter-presence guard for the physical-sky LUT on-screen proof (tests/sky_lut_proof.rs):
# self-skip with a recorded sentinel when no GPU adapter is present. Same pollster 0.4 the
# flight crate's GPU parity proof blocks on.
pollster = "1"
# HEAVY render/throughput bench (benches/heavy_render.rs). default-features off to
# stay light (no gnuplot/plotters); same convention as facett-graphview.
criterion = { version = "0.8", default-features = false }
# On-screen WATCH demo (examples/flythrough.rs): the cinematic flight-sim over the
# extruded OSM 3D city, GPU depth-buffered. Native eframe window; same egui 0.34 /
# wgpu 29 stack as facett-demo.
# `wgpu_no_default_features`, NOT `wgpu` (LAW 4 / GFX_V2 Decision 0). eframe's plain
# `wgpu` feature expands to `egui-wgpu/default` -> `wgpu/default` -> `wgpu-hal/default`
# -> **glow**, the GL backend this constellation dropped. Cargo features are additive
# and unify across the whole graph, so one DEV dependency spelling it this way turns the
# GL backend on for every crate here, normal edges included. Backends come from the
# workspace `wgpu` entry.
eframe = { version = "0.36", default-features = false, features = ["default_fonts", "wgpu_no_default_features", "wayland", "x11"] }
# The headless 3D-map render SELF-TEST. An `example` (so it can use the
# egui_kittest wgpu offscreen backend, a dev-dependency) run as:
# cargo run -p facett-map3d --example selftest --features testmatrix
# It renders the extruded 3D map offscreen on a wgpu framebuffer, counts lit
# pixels + emitted triangles + tiles, computes ok = (triangles>0 && tiles>0 &&
# lit_px>0), and EMITS one functional-status row (the emit + its expensive
# detail-building gated behind `testmatrix`, so a release build strips it).
[[example]]
name = "selftest"
path = "examples/selftest.rs"
[[bench]]
name = "heavy_render"
harness = false
[[example]]
name = "flythrough"
path = "examples/flythrough.rs"
required-features = ["wgpu"]
[[example]]
name = "sigtuna_tour"
path = "examples/sigtuna_tour.rs"
required-features = ["wgpu"]