FBC: NIGHT SHIFT - added the enhancement-slices doc and delivered S0/S1: light-surface-post pass and identity props

docs/ENV_ENHANCEMENT.md: full slice plan S0-S5 with acceptance criteria.\n\nS0 light/surface/post: bevels on 119 boxes, floor gloss variation, dead +\nhanging fluorescent fixtures, teal Polaris alcove, threshold-door red light\nspill, 70 dust motes, compositor bloom -> chromatic aberration -> vignette.\n\nS1 identity props: Hotline, Benicoff TV, Service Weapon pedestal, Rubber Duck\nunder glass, security desk, filing cabinets, scattered redacted papers, puddles.\n\nScene 243 -> 405 objects; concept frames re-rendered and validated (hero\np5/p50/p95 0.10/0.30/0.53, red 15.9%, teal 1.4%).
This commit is contained in:
dandovlatov 2026-10-24 11:02:36 +04:00
parent 20b59889f5
commit aba0fcd7a0
7 changed files with 377 additions and 7 deletions

View file

@ -48,6 +48,7 @@ raylib 6.2 is fetched automatically by CMake (FetchContent). Needs a C++23 compi
- `docs/TECHNICAL.md` — stack, architecture, module map
- `docs/ROADMAP.md` — milestones M0–M6 and current status
- `docs/concept/` — rendered Blender concept frames (visual target for M5)
- `docs/ENV_ENHANCEMENT.md` — enhancement slices S0–S5 for the environment
- `tools/blender/` — procedural Blender scene builder + render scripts
## IP note

140
docs/ENV_ENHANCEMENT.md Normal file
View file

@ -0,0 +1,140 @@
# 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`, world-anchored bars, corruption-keyed post shaders, HUD-overlay concept frames | planned [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]
- [ ] Wire `assets/sprites/*.png` into `render/presenter.cpp` (replace soft-disc
billboards; keep manual back-to-front sort + blob shadows).
- [ ] World-anchored damage numbers/health bars styled as form fields.
- [ ] Corruption-keyed post shaders (`assets/shaders/`): VHS noise, chromatic
aberration, red resonance pulses.
- [ ] 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.*
## 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/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-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.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 MiB

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 MiB

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 MiB

After

Width:  |  Height:  |  Size: 2.2 MiB

View file

@ -11,6 +11,7 @@
# render_shots.py for the camera captures.
import math
import os
import random
import bpy
import numpy as np
@ -115,6 +116,17 @@ def add_noise_bump(mat, scale=6.0, strength=0.15, detail=6.0):
if b.inputs.get("Normal") is not None:
nt.links.new(bump.outputs["Normal"], b.inputs["Normal"])
def add_bevel(obj, width=0.028, segments=2):
"""Chamfer hard edges so they catch light (S0 realism pass)."""
try:
mod = obj.modifiers.new("Bevel", "BEVEL")
mod.width = width
mod.segments = segments
mod.limit_method = "ANGLE"
except Exception as exc:
print("[bevel] skipped on", obj.name, exc)
# ------------------------------------------------------------- mesh factories
def _finish_mesh(name, verts, faces, uvs=None, coll="Scene"):
mesh = bpy.data.meshes.new(name)
@ -139,6 +151,8 @@ def make_box(name, cx, cy, cz, sx, sy, sz, mat, coll="ENV"):
(2, 6, 7, 3), (0, 4, 6, 2), (1, 3, 7, 5)]
obj = _finish_mesh(name, verts, faces, coll=coll)
obj.data.materials.append(mat)
if min(sx, sy, sz) > 0.09: # thin decals can't take a chamfer
add_bevel(obj)
return obj
@ -153,6 +167,8 @@ def make_box_obj(name, size, loc, rot, mat, coll="ENV"):
obj.location = loc
obj.rotation_euler = rot
obj.data.materials.append(mat)
if min(size) > 0.09:
add_bevel(obj)
return obj
@ -170,6 +186,21 @@ def make_quad(name, cx, cy, cz, w, h, yaw, mat, coll="STANDEES"):
return obj
def make_quad_flat(name, cx, cy, z, w, h, yaw, mat, coll="FX"):
"""Horizontal quad in the XY plane (light spills, decals)."""
hw, hh = w / 2.0, h / 2.0
rx, ry = math.cos(yaw), math.sin(yaw)
sx, sy = -ry, rx # in-plane perpendicular
verts = [(cx - rx * hw - sx * hh, cy - ry * hw - sy * hh, z),
(cx + rx * hw - sx * hh, cy + ry * hw - sy * hh, z),
(cx + rx * hw + sx * hh, cy + ry * hw + sy * hh, z),
(cx - rx * hw + sx * hh, cy - ry * hw + sy * hh, z)]
uvs = [(0.0, 0.0), (1.0, 0.0), (1.0, 1.0), (0.0, 1.0)]
obj = _finish_mesh(name, verts, [(0, 1, 2, 3)], uvs=uvs, coll=coll)
obj.data.materials.append(mat)
return obj
def make_cyl(name, cx, cy, z0, z1, r, mat, segs=16, coll="ENV"):
verts = []
for z in (z0, z1):
@ -452,6 +483,15 @@ def build_materials():
nt.links.new(noise.outputs["Fac"], ramp.inputs["Fac"])
nt.links.new(ramp.outputs["Color"], b.inputs["Base Color"])
add_noise_bump(floor, scale=40.0, strength=0.05, detail=10.0)
# Gloss variation: sealed concrete reflects unevenly.
gloss = nt.nodes.new("ShaderNodeValToRGB")
gloss.location = (-520, -40)
gloss.color_ramp.elements[0].position = 0.3
gloss.color_ramp.elements[0].color = (0.07, 0.07, 0.07, 1.0)
gloss.color_ramp.elements[1].position = 0.8
gloss.color_ramp.elements[1].color = (0.32, 0.32, 0.32, 1.0)
nt.links.new(noise.outputs["Fac"], gloss.inputs["Fac"])
nt.links.new(gloss.outputs["Color"], b.inputs["Roughness"])
m["floor"] = floor
# Red carpet: signal red, fabric-ish.
carpet = principled("carpet_red", (0.42, 0.012, 0.03), rough=0.72)
@ -478,6 +518,23 @@ def build_materials():
m["hazard_y"] = principled("hazard_yellow", (0.78, 0.6, 0.05), rough=0.55)
m["blob"] = principled("blob_shadow", (0.0, 0.0, 0.0), rough=0.9, alpha=0.42)
m["base"] = principled("standee_base", (0.1, 0.1, 0.11), rough=0.45)
# --- S0/S1 additions -------------------------------------------------
m["flicker"] = principled("fluor_dead", (0.16, 0.16, 0.17), rough=0.4,
emit=(0.5, 0.5, 0.55), emit_str=0.25)
m["teal"] = principled("polaris_teal", (0.1, 0.45, 0.4), rough=0.35,
emit=(0.3, 0.79, 0.69), emit_str=4.0)
m["glass"] = principled("glass_case", (0.75, 0.85, 0.9), rough=0.06,
alpha=0.13)
m["water"] = principled("puddle", (0.02, 0.025, 0.03), rough=0.05)
m["screen"] = principled("screen_dark", (0.01, 0.012, 0.015), rough=0.18,
emit=(0.12, 0.16, 0.2), emit_str=0.6)
m["hotline"] = principled("hotline_red", (0.55, 0.03, 0.04), rough=0.3,
emit=(1.0, 0.1, 0.08), emit_str=1.1)
m["plastic"] = principled("plastic_dark", (0.07, 0.07, 0.08), rough=0.35)
m["paper_scrap"] = principled("paper_scrap", (0.78, 0.75, 0.66), rough=0.7)
m["duck"] = principled("duck_yellow", (0.85, 0.62, 0.05), rough=0.22)
m["dust"] = principled("dust_mote", (0.9, 0.85, 0.7), rough=0.5,
emit=(1.0, 0.92, 0.72), emit_str=2.2, alpha=0.55)
vol = new_mat("haze_volume")
nt = vol.node_tree
for node in list(nt.nodes):
@ -576,15 +633,21 @@ def build_structure(m):
# camera sees the floor; beams cross the frame and reflect in the polish).
for y in (-6, 4, 14):
make_box("Beam_%d" % y, 0, y, 7.65, 45.2, 1.1, 0.8, m["concrete"])
make_box("Strip_%d" % y, 0, y, 7.2, 38.0, 0.55, 0.12, m["strip"])
# Sector failing: the y=-6 strip is dead (art doc: lights fail one by one).
make_box("Strip_%d" % y, 0, y, 7.2, 38.0, 0.55, 0.12,
m["flicker"] if y == -6 else m["strip"])
for x in (-11, 11):
make_box("BeamX_%d" % x, x, 6, 7.65, 1.1, 33.0, 0.8, m["concrete"])
# A fixture torn loose, hanging at an angle.
make_box_obj("StripHanging", (0.55, 2.4, 0.12), (11, 9.2, 6.7),
(0.32, 0.0, 0.18), m["flicker"])
# Red flickering strips near the door (corruption).
for x in (-7.5, 7.5):
make_box("StripRed_%d" % x, x, 17.8, 6.6, 0.5, 4.5, 0.12, m["strip_red"])
# Wall-mounted strips on the far wall.
for x in (-17, -8.5, 8.5, 17):
make_box("WallStrip_%d" % x, x, 21.8, 6.9, 4.2, 0.15, 0.32, m["strip"])
# Wall-mounted strips on the far wall (one dead).
for i, x in enumerate((-17, -8.5, 8.5, 17)):
make_box("WallStrip_%d" % x, x, 21.8, 6.9, 4.2, 0.15, 0.32,
m["flicker"] if i == 1 else m["strip"])
# Brass stanchions + red ropes along the carpet.
post_y = [-7.0, -1.8, 3.4, 8.6, 13.8, 19.0]
for side in (-4.35, 4.35):
@ -629,6 +692,10 @@ def build_structure(m):
for k, (dz, w) in enumerate(((0.55, 2.6), (0.0, 3.0), (-0.55, 2.2))):
make_box("SideSignBar_%d_%d" % (x, k), x - math.copysign(0.03, x), 6,
4.6 + dz, 0.06, w, 0.28, m["ink"])
# Polaris alcove — the teal of the safe (palette entry 4/4), left wall.
make_box("PolarisRecess", -21.55, -6, 2.6, 1.1, 3.2, 5.2, m["door_dark"])
make_box("PolarisGlow", -20.95, -6, 2.6, 0.1, 2.3, 4.1, m["teal"])
make_box("PolarisLintel", -21.3, -6, 5.45, 1.6, 3.6, 0.35, m["concrete"])
CAM_HERO = (0.0, -34.0, 30.0) # billboards face this azimuth
@ -691,6 +758,115 @@ def build_standees(m, imgs):
make_quad("Shot_%d" % i, x, y, z, 0.85, 0.85, yaw, mats["glow"],
coll="STANDEES")
def tinted_glow_mat(name, img, tint, emit_str):
"""Radial glow decal material (light spills), tinted per use."""
mat = new_mat(name)
nt = mat.node_tree
b = bsdf_of(mat)
tex = nt.nodes.new("ShaderNodeTexImage")
tex.image = img
mult = nt.nodes.new("ShaderNodeVectorMath")
mult.operation = "MULTIPLY"
mult.inputs[1].default_value = tint
nt.links.new(tex.outputs["Color"], mult.inputs[0])
if b.inputs.get("Emission Color") is not None:
nt.links.new(mult.outputs["Vector"], b.inputs["Emission Color"])
set_in(b, "Emission Strength", emit_str)
if b.inputs.get("Alpha") is not None:
nt.links.new(tex.outputs["Alpha"], b.inputs["Alpha"])
try:
mat.surface_render_method = "BLENDED"
except Exception:
pass
try:
mat.show_transparent_back = False
except Exception:
pass
return mat
def build_fx(m, imgs):
"""S0 atmosphere: light spills + dust motes."""
spill = tinted_glow_mat("spill_red", imgs["glow"], (1.0, 0.12, 0.1), 1.1)
teal_spill = tinted_glow_mat("spill_teal", imgs["glow"], (0.3, 0.85, 0.72), 1.0)
# Threshold-door spill: red washes out of the doorway onto the carpet.
make_quad_flat("DoorSpill_A", 0, 18.4, 0.075, 9.0, 8.5, math.pi / 2, spill)
make_quad_flat("DoorSpill_B", 0, 20.4, 0.08, 6.5, 5.0, math.pi / 2, spill)
# Polaris alcove pool on the floor.
make_quad_flat("PolarisSpill", -19.6, -6, 0.02, 5.5, 5.5, 0.0, teal_spill)
# Dust motes: seeded emissive micro-voxels (deterministic per seed).
rng = random.Random(7)
for i in range(70):
x = rng.uniform(-20.0, 20.0)
y = rng.uniform(-18.0, 21.0)
z = rng.uniform(0.4, 7.0)
s = rng.uniform(0.02, 0.055)
make_box("Dust_%d" % i, x, y, z, s, s, s, m["dust"], coll="FX")
def build_props(m):
"""S1 identity props: Objects of Power + FBC furniture."""
# --- Hotline (the Board's phone) — left, near the far wall.
make_box("HotlineTable", -13, 17.2, 0.42, 1.35, 0.95, 0.84, m["plastic"])
make_box("HotlineBase", -13, 17.2, 0.93, 0.55, 0.38, 0.16, m["hotline"])
make_box_obj("HotlineHandset", (0.5, 0.12, 0.12), (-13, 17.2, 1.08),
(0.0, 0.0, 0.25), m["hotline"])
make_box("HotlineCord", -13, 17.05, 0.86, 0.06, 0.3, 0.06, m["ink"])
# --- Benicoff TV — right of the door.
make_box("TVStand", 10, 17.4, 0.45, 2.5, 1.15, 0.9, m["plastic"])
make_box("TVBody", 10, 17.4, 1.72, 2.15, 0.85, 1.45, m["plastic"])
make_box("TVScreen", 10, 16.94, 1.72, 1.85, 0.06, 1.15, m["screen"])
make_box("TVAntenna", 10.6, 17.6, 2.72, 0.05, 0.05, 0.7, m["ink"])
# --- Service Weapon on its pedestal — left of the carpet cross.
make_box("Pedestal", -7, 12, 0.58, 1.15, 1.15, 1.15, m["concrete"])
make_box("PedestalTop", -7, 12, 1.18, 0.85, 0.85, 0.07, m["ink"])
make_box_obj("ServiceWeapon_A", (0.62, 0.11, 0.11), (-7, 12, 1.38),
(0.0, 0.0, 0.55), m["plastic"])
make_box_obj("ServiceWeapon_B", (0.42, 0.1, 0.1), (-6.83, 12.05, 1.32),
(0.0, 0.55, -0.35), m["plastic"])
make_box("PedestalGlow", -7, 11.42, 0.9, 0.55, 0.04, 0.08, m["strip"])
# --- Rubber Duck under glass — right of the carpet cross.
make_box("DuckPlinth", 7, 12, 0.45, 0.8, 0.8, 0.9, m["concrete"])
make_box("DuckBody", 7, 12, 1.06, 0.32, 0.24, 0.2, m["duck"])
make_box("DuckHead", 7, 11.92, 1.26, 0.16, 0.15, 0.15, m["duck"])
make_box("DuckBeak", 7, 11.82, 1.25, 0.07, 0.09, 0.05, m["hotline"])
make_box("DuckCase", 7, 12, 1.21, 0.58, 0.58, 0.62, m["glass"])
# --- Security desk — front-left, the guard's post.
make_box("DeskTop", -12, -8, 0.92, 4.6, 1.7, 0.1, m["plastic"])
for dx in (-1.85, 1.85):
make_box("DeskPed_%d" % dx, -12 + dx, -8, 0.44, 0.65, 1.5, 0.88,
m["door_dark"])
make_box("MonitorStand", -12, -8.55, 1.13, 0.3, 0.28, 0.32, m["plastic"])
make_box("Monitor", -12, -8.6, 1.62, 1.25, 0.09, 0.78, m["plastic"])
make_box("MonitorScreen", -12, -8.54, 1.62, 1.08, 0.03, 0.62, m["screen"])
make_box("DeskLampStem", -13.7, -8.5, 1.18, 0.16, 0.16, 0.42, m["ink"])
make_box("DeskLampHead", -13.7, -8.42, 1.42, 0.3, 0.22, 0.1, m["strip"])
make_cyl("ChairPost", -13.6, -9.6, 0.0, 0.5, 0.07, m["plastic"], segs=10)
make_box("ChairSeat", -13.6, -9.6, 0.55, 0.58, 0.58, 0.1, m["plastic"])
make_box("ChairBack", -13.6, -9.32, 0.95, 0.55, 0.09, 0.62, m["plastic"])
# --- Filing cabinets along the right wall (drawer seams + handles).
for i, y in enumerate((0.2, 1.35, 2.5)):
make_box("Cabinet_%d" % i, 20.7, y, 1.15, 1.05, 1.05, 2.3, m["door_dark"])
for k in range(4):
make_box("CabinetSeam_%d_%d" % (i, k), 20.16, y, 0.5 + k * 0.52,
0.03, 0.92, 0.03, m["ink"])
make_box("CabinetHandle_%d_%d" % (i, k), 20.13, y, 0.62 + k * 0.52,
0.05, 0.3, 0.05, m["plastic"])
# --- Scattered redacted papers (seeded).
rng = random.Random(11)
n = 0
for cx, cy in ((-12, -8), (14, -2), (-16, 8), (6, 16)):
for _ in range(6):
x = cx + rng.uniform(-2.2, 2.2)
y = cy + rng.uniform(-1.8, 1.8)
make_box_obj("Paper_%d" % n, (0.34, 0.25, 0.012), (x, y, 0.012),
(0.0, 0.0, rng.uniform(0.0, math.pi)), m["paper_scrap"])
n += 1
# --- Puddles: dark glossy discs for reflection interest.
for i, (x, y, r) in enumerate(((-14, 2, 1.9), (12, -8, 2.4), (18, 8, 1.5))):
make_cyl("Puddle_%d" % i, x, y, 0.02, 0.028, r, m["water"], segs=24)
def build_lights_and_cameras(m):
# Volumetric haze (light shafts + atmosphere).
make_box("Haze", 0, 0, 4.2, 44.0, 44.0, 8.4, m["volume"], coll="ATMOS")
@ -716,6 +892,11 @@ def build_lights_and_cameras(m):
# first, docs/ART_DIRECTION.md).
add_light("Hero_Kicker", "POINT", (-2.2, -2.6, 3.4), (0, 0, 0), 220,
(1.0, 0.85, 0.62), radius=0.9)
# Polaris teal (the safe) + red wash pouring out of the threshold door.
add_light("Polaris_Teal", "POINT", (-19.6, -6, 2.8), (0, 0, 0), 350,
(0.35, 0.85, 0.75), radius=1.2)
add_light("Door_Spill", "AREA", (0, 20.4, 2.4), (math.radians(-65), 0, 0),
550, (1.0, 0.1, 0.08), size=7)
# Cameras.
add_camera("Cam_Hero", CAM_HERO, (0, 1.5, 2.5), lens=45.0)
add_camera("Cam_Game", (0, -16, 20), (0, 1.0, 1.0), lens=29.0) # fovy 45
@ -739,7 +920,7 @@ def setup_world_and_render():
sc.render.image_settings.file_format = "PNG"
sc.render.film_transparent = False
ee = sc.eevee
for attr, val in (("taa_render_samples", 128),
for attr, val in (("taa_render_samples", 96),
("use_raytracing", True),
("use_volumetric_shadows", True),
("volumetric_samples", 96),
@ -807,9 +988,55 @@ def setup_glare(sc):
out = nt.nodes.new("CompositorNodeComposite")
out_sock = out.inputs["Image"]
nt.links.new(rl.outputs["Image"], glare.inputs["Image"])
nt.links.new(glare.outputs["Image"], out_sock)
tail = glare.outputs["Image"]
# Chromatic aberration (subtle dispersion at the frame edges).
try:
dist = nt.nodes.new("CompositorNodeLensdist")
for sock, val in (("Distortion", 0.02), ("Dispersion", 0.03)):
try:
dist.inputs[sock].default_value = val
except Exception:
pass
nt.links.new(tail, dist.inputs["Image"])
tail = dist.outputs["Image"]
print("[post] chromatic aberration on")
except Exception as exc:
print("[post] lensdist skipped:", exc)
# Vignette: blurred ellipse mask multiplied over the frame.
try:
mask = nt.nodes.new("CompositorNodeEllipseMask")
for sock, val in (("Value", 1.0), ("Position", (0.5, 0.5)),
("Size", (1.28, 1.06))):
try:
mask.inputs[sock].default_value = val
except Exception:
pass
blur = nt.nodes.new("CompositorNodeBlur")
try:
blur.inputs["Size"].default_value = (220, 220)
except Exception:
pass
nt.links.new(mask.outputs["Mask"], blur.inputs["Image"])
try:
mix = nt.nodes.new("ShaderNodeMix") # unified Mix (5.x)
mix.data_type = "RGBA"
mix.blend_type = "MULTIPLY"
mix.inputs[0].default_value = 0.42
a_sock, b_sock, r_sock = mix.inputs[6], mix.inputs[7], mix.outputs[2]
except Exception:
mix = nt.nodes.new("CompositorNodeMixRGB") # 4.x fallback
mix.blend_type = "MULTIPLY"
mix.inputs[0].default_value = 0.42
a_sock, b_sock, r_sock = mix.inputs[1], mix.inputs[2], mix.outputs[0]
nt.links.new(tail, a_sock)
nt.links.new(blur.outputs["Image"], b_sock)
tail = r_sock
print("[post] vignette on")
except Exception as exc:
print("[post] vignette skipped:", exc)
nt.links.new(tail, out_sock)
sc.render.use_compositing = True
print("[glare] bloom enabled")
print("[glare] post chain wired")
except Exception as exc:
print("[glare] skipped:", exc)
@ -821,7 +1048,9 @@ def main():
build_walls(m)
build_structure(m)
imgs = build_sprites()
build_fx(m, imgs)
build_standees(m, imgs)
build_props(m)
build_lights_and_cameras(m)
setup_world_and_render()
setup_glare(bpy.context.scene)