cntrl/docs/ENV_ENHANCEMENT.md

241 lines
14 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# FBC: NIGHT SHIFT — Environment Enhancement Slices
Working plan for turning the Blender concept diorama (and later the in-game
presenter) into a full Oldest House environment. `docs/ART_DIRECTION.md` is the
source of truth for *the look*; this file tracks *what's next*, slice by slice,
with acceptance criteria.
Legend: **[B]** Blender scene (`tools/blender/build_scene.py`) · **[G]** game
(`render/presenter.cpp`, M5) · **[R]** render/post only (`render_shots.py`).
## Slice overview
| # | Slice | Adds | Status |
|---|---|---|---|
| S0 | Light, surface & post pass | bevels, floor gloss variation, dead/flickering strips, teal Polaris alcove, threshold-door light spill, dust motes, vignette + chromatic aberration | **DONE** [B][R] |
| S1 | Identity props | Objects of Power (Hotline, Benicoff TV, Service Weapon pedestal, Rubber Duck), security desk, filing cabinets, scattered redacted papers, puddles | **DONE** [B] |
| S2 | Corruption decay layer | glyph particles, chanting-glyph signage, sparks on dead strips, red mist pockets, wall stains/leaks, more floating debris | planned [B] |
| S3 | Standee art v2 | paper grain + halftone, sleeve sheen, new archetypes (Hiss Elevated, Cluster, Taken, Mold Host), boss standee, elite affix rim variants | planned [B]→[G] |
| S4 | Breadth: floors | Oceanview Motel shop diorama (yellow doors, teal carpet), Maintenance/mold variant (green palette) | planned [B] |
| S5 | Game integration (M5 kickoff) | sprite PNGs into `presenter.cpp`, diorama scene dressing, corruption-keyed post shaders, HUD-overlay concept frames | **partial** [G] |
| S6 | Actors in 3D (replaces S3 standees) | Blender GLB actors + lit shader in the game, backdrop/environment polish | **DONE** [B][G] |
| S7 | One concrete material | seamless 2K PBR maps from Blender shared by floor/walls/pillars, triplanar in-engine, merged static mesh | **DONE** [B][G] |
| S8 | Corruption wave FX | SDF billboard aura on Hiss units + reusable fading ground emitter for events/bosses; saved Blender reference scene | **DONE** [B][G] |
## S0 — Light, surface & post pass [B][R]
Goal: kill the "starter render" tells — hard edges, even lighting, clean frame.
- [x] **Bevel pass** on all box kit (walls, pillars, beams, door, props) —
chamfers catch light. *Accept: no un-beveled box edge > 9 cm thick in the
ENV collection; thin decals excluded.*
- [x] **Floor gloss variation** — noise-driven roughness (0.08–0.30) so
reflections break up like sealed concrete. *Accept: strip reflections
visibly widen/narrow across the slab.*
- [x] **Dead / flickering strips** — one wall strip and one beam strip dark
(sector failing per the art doc), one strip hanging loose.
*Accept: at least 3 non-lit or misaligned fixtures visible.*
- [x] **Teal Polaris alcove** — 4th palette entry (`#4ec9b0`) on the left wall:
dark recess + teal glow panel + teal light. *Accept: teal present in hero
frame without stealing focus from red.*
- [x] **Threshold-door light spill** — red glow decal + red area light washing
the carpet out of the doorway. *Accept: carpet reads red→black gradient
toward camera from the door.*
- [x] **Dust motes** — ~70 seeded emissive micro-voxels in the air.
*Accept: visible sparkle in light pools, deterministic per seed.*
- [x] **Post pass on renders** — compositor: bloom (done), chromatic
aberration (lens dispersion), vignette. *Accept: corners ≥ 25% darker
than center mean; aberration subtle at edges only.*
## S1 — Identity props [B]
Goal: the frame must say *Oldest House*, not "brutalist lobby".
- [x] **Hotline** — red phone on a side table, faint red glow (left, near far wall).
- [x] **Benicoff TV** — boxy TV on a stand, dark emissive screen (right of the door).
- [x] **Service Weapon pedestal** — concrete plinth, angular dark weapon form,
white inlay glow (left of the carpet cross).
- [x] **Rubber Duck under glass** — plinth + duck + transparent case (right of
the carpet cross) — the joke that sells the tone.
- [x] **Security desk** — desk + monitor + papers + chair (front-left, the
guard's post).
- [x] **Filing cabinets** — row along the right wall with drawer seams.
- [x] **Scattered redacted papers** — ~24 seeded scraps on floor/desk.
- [x] **Puddles** — 3 dark glossy discs near walls for reflection interest.
*Accept (group): hero frame contains ≥ 6 recognizable prop silhouettes;
nothing clips the carpet runners or standee sightlines.*
## S2 — Corruption decay layer [B] *(next)*
Goal: the House decaying in real time — the art doc's "best part", currently
~10% realized (red slabs + red strips only).
- [ ] **Hiss glyph particles** — floating red glyph quads (tiny bar clusters)
drifting up near corrupted areas.
- [ ] **Chanting-glyph signage** — one wall sign half-converted: redaction bars
tilted/replaced by red glyph bars.
- [ ] **Sparks on dead strips** — small warm emissive bursts under the dead
fixture + a red-tinted pool below it.
- [ ] **Red mist pockets** — 2–3 low-density red volume boxes near walls/door.
- [ ] **Wall stains & leaks** — dark grime decals under strips and at wall
bases; a drip stain under the ceiling beams.
- [ ] **More floating debris** — 4–6 extra slabs at floor level (not just
ceiling), one intersecting a pillar.
- *Accept: red-dominant share of the hero frame rises from ~17% to 22–26%
without the scene reading "Christmas"; decay is clustered, not uniform.*
## S3 — Standee art v2 [B]→[G]
- [ ] **Card treatment** — paper grain + halftone dots + sleeve specular
streak; slight card bend (2-segment warped quad).
- [ ] **New archetypes** — Hiss Elevated (mid-teleport afterimage), Hiss
Cluster (stationary spitter), Taken (near-black + white rim — the
crossover), Mold Host (tanky), Threshold Creature.
- [ ] **Boss standee** — 2–3× screen height (Former hand or Hiss-Marshall),
per the art doc.
- [ ] **Elite affix rims** — Resonant (ring), Phasing (afterimage), Volatile
(flicker), Shielded (shell), Mending (green halo) as sprite variants.
- *Accept: ≥ 8 distinct silhouettes readable at hero distance; boss reads from
the far wall.*
## S4 — Breadth: floors [B]
- [ ] **Oceanview Motel shop diorama** — yellow doors, teal carpet, dim
bedside lamps: the reroll shop, iconic and cheap.
- [ ] **Maintenance/mold variant** — tight corridor, pipes, green mold blooms,
sickly green light (exercises the mold palette).
- *Accept: each variant is a named collection the camera set can be pointed at;
palette per art doc stays consistent.*
## S5 — Game integration — M5 kickoff [G]
- [x] Wire `assets/sprites/*.png` into `render/presenter.cpp` (sprite standees
via `DrawBillboardRec`, per-archetype textures, hit-flash tint; missing
art degrades to the soft-disc standee; manual back-to-front sort + blob
shadows kept).
- [x] Diorama scene dressing in the presenter: polished-concrete palette, red
carpet runners, pillar red bands + bases, threshold door with Hiss glow +
hazard stripes, EXIT signs, curb light strip, painted walkway lines.
- [x] Corruption-keyed post shaders (`assets/shaders/post_fx.fs`): VHS scanlines
+ noise, chromatic aberration, red Hiss tint, vignette, damage flash —
all scaling with `game.corruption.value()`; frame renders to a
`RenderTexture` in `main.cpp`.
- [ ] World-anchored damage numbers/health bars styled as form fields (needs
the OFL fonts — lands with the fonts milestone).
- [ ] HUD-overlay concept frame: containment gauge + HP/XP form fields +
Board Directive cards composited over a Blender render — the "UI as
bureaucracy" money shot.
- *Accept: 60 s `--bot` run looks like the concept frames at gameplay scale —
met for scene + standees + post; UI styling pending fonts.*
## S6 — Actors in 3D [B][G] *(replaces S3)*
Goal: retire the 2D standee cards; every unit is a low-poly but detailed puppet
that lives in the diorama's depth buffer.
- [x] **Actor library** — `tools/blender/build_enemies.py` builds the guard, Hiss
Corrupted Staff (reaching arm + crystal growths + floating shards), Mold
Spore (lobed caps, tendrils, drifting spores), Hiss Brute (pauldrons, core,
spines, gauntlet) and Resonance Shard. 136–1392 triangles each; origins at
the feet, facing +Z in engine. *Accept: five distinct silhouettes in the
`enemy_lineup.png` turnaround.*
- [x] **Export pipeline** — GLB per actor into `assets/models/`, source scene in
`assets/blender/fbc_enemies.blend`, concept frames in `docs/concept/`.
- [x] **In-engine lighting** — `assets/shaders/actor.{vs,fs}`: facet key/fill,
fluorescent rim, emissive-resin treatment for the saturated Hiss/Board/
Polaris palette, corruption bleed in shadows, per-actor hit flash.
- [x] **Presenter integration** — `ModelBank` draws 3D actors for player and all
enemies, spins XP shards, keeps blob shadows and camera-facing glows for
projectiles only. Missing GLBs degrade to primitive shapes, never cards.
- [x] **Framing / set dressing** — fovy 45 at 14m height, curb-height fluorescent
strips (a real ceiling occluded the tactical camera), Hiss light pools,
pillar signage, grime patches, tightened carpet runners, gentler chromatic
aberration.
- *Accept: `--bot --no-damage --screenshot` shows readable lit actors at gameplay
scale with the red/paper/navy palette intact.*
## S7 — One concrete material [B][G]
Goal: replace flat grey boxes with a believable, reused surface — without
multiplying draw calls.
- [x] **Maps** — `tools/blender/build_materials.py` generates seamless 2K
albedo / normal / roughness maps from periodic fBm + noise-warped Voronoi
pores: mottled `#2b2b2f` base, fine aggregate grit, uneven sealer gloss.
Saved to `assets/textures/concrete/`, source library `fbc_concrete.blend`.
- [x] **One material everywhere** — `build_scene.py` imports `apply_concrete()`
so walls, pillars, beams and the polished floor of the diorama use those
same maps. In-engine `ConcreteMaterial` draws floor, curbs, pillars, pillar
bases and the door frame from a single merged static mesh with one shader.
- [x] **Triplanar shader** — `assets/shaders/concrete.{vs,fs}` samples all three
maps in world space with normal-weighted blending (no stretched UVs on
differently sized boxes), tangent-detail perturbation, sealed-floor
specular sheen (vertex alpha carries the polish factor) and corruption
bleed in the shadows.
- *Accept: `--bot --no-damage --screenshot` shows visible grain/roughness on
floor and pillars with the palette intact; 22 concrete boxes cost one draw
call; missing maps fall back to the old flat colours.*
## S8 — Corruption wave FX [B][G]
- [x] **No more orbiting shards** — the six/seven static red octahedra around
Hiss Staff and Brute are gone; attached crystal growths and the darkened
base rings remain. Actors dropped to 866 / 1252 triangles.
- [x] **Unit aura** — `assets/shaders/aura.{vs,fs}` is a pure SDF (radial body,
breathing ring front, ragged silhouette) on one camera-facing quad per
Hiss unit. Near-black to dark-crimson, keyed to corruption. Fixed a
row/column transpose in the billboard transform that had been dropping
the quads onto the floor.
- [x] **Reusable scene wave** — `CorruptionAura::spawn_ground(pos, radius, life,
phase)` pushes a flat, fading XZ decal using the same material/draw call
path. Tier-ups emit one at the player; the API is ready for boss entrances
and other events. Up to 16 concurrent waves.
- [x] **Saved for reuse** — `tools/blender/build_wave.py` saves an animated node
material mirroring the SDF in `assets/blender/fbc_corruption_wave.blend`
with a preview in `docs/concept/corruption_wave.png`.
- *Accept: enemies carry a subtle dark-crimson aura without floating shards;
ground waves fade smoothly and can be spawned from any event.*
## How to run
```python
# inside Blender:
exec(open("/home/dandovlatov/Documents/cntrl/tools/blender/build_scene.py").read())
exec(open("/home/dandovlatov/Documents/cntrl/tools/blender/build_enemies.py").read())
exec(open("/home/dandovlatov/Documents/cntrl/tools/blender/build_materials.py").read())
exec(open("/home/dandovlatov/Documents/cntrl/tools/blender/build_wave.py").read())
exec(open("/home/dandovlatov/Documents/cntrl/tools/blender/render_shots.py").read())
```
Renders land in `docs/concept/`, the scene in `assets/blender/`, sprites in
`assets/sprites/`. Validation: luminance/contrast stats + ASCII luminance and
red-dominance maps per render; hero targets — p5/p50/p95 ≈ 0.10/0.29/0.51,
clipping < 0.5%, red-dominant 15–25%.
## Status log
- 2026-11-22 (S8): removed the static orbiting Hiss shards, added an SDF
dark-crimson aura on Hiss units (fixed a billboard matrix transpose that had
been laying the quads on the floor), and made the ground variant a reusable
fading emitter for tier-ups / bosses. Saved an animated Blender reference
scene and preview.
- 2026-11-22 (S7): generated one seamless 2K concrete PBR set in Blender,
applied it to diorama walls/floor/pillars and to a single triplanar in-engine
material that draws all 22 concrete boxes in one call. Validated with bot
screenshots — mottled grain on floor and pillars, palette held.
- 2026-11-22 (S6): replaced the 2D standee cards with five Blender-built GLB
actors and a custom lit actor shader; rebuilt the presenter around `ModelBank`,
re-framed the tactical camera and cleaned up the set dressing. Validated with
`--bot --no-damage --screenshot` (lit actors, red/paper/navy palette intact).
- 2026-10-24 (S5): wired the art into the game — sprite standees + diorama scene
dressing + `assets/shaders/post_fx.fs` corruption post chain. Validated via
`--bot --screenshot`: sprites load with correct orientation (card stripe
down), post FX provably active (noise/scanline signature on flat patches),
palette held (red-dominant 18%), frame readable (p50 0.19, clip 0.1%).
- 2026-10-24: S0 + S1 implemented in `build_scene.py`; scene 243 → 405 objects
(119 beveled boxes, 83 prop objects, 70 dust motes, 4 light-spill decals).
Compositor post chain live: bloom → chromatic aberration → vignette.
Concept frames re-rendered (96 samples) and validated — hero: p5/p50/p95 =
0.10/0.30/0.53, clipping 0.15%, red-dominant 15.9%, teal 1.4% (palette now
4/4 in frame); game cam: 0.12/0.34/0.50, red 20.3%; detail: punchy close-up.
Next up: S2 corruption decay layer.