A 3D model pipeline, pushed by GPT-6-Astra
agent (cont.)
+0:26exec_commandsed -n '261,517p' ~/context/lowmarch.md (+1 more)
command
sed -n '261,517p' ~/context/lowmarch.md sed -n '1,490p' docs/portrait-guide.md
result, 8 lines
Script completed Wall time 0.1 seconds Output: Warning: truncated output (original token count: 13353) Total output lines: 2 {"chunk_id":"772317","wall_time_seconds":0.000004681,"exit_code":0,"original_token_count":4529,"output":" - the clothes are the body: Yin has no skin under the shirt and pants;\n - a Rigify A-pose rig split over 3 armatures, about 1,640 bones;\n - expressions are bones, not shape keys.\n- Reimplementing their techniques in our own code copies no asset.\n\n**Lessons for lowmarch, ranked:**\n1. **Proxy shading normals (\"Vertex Skeleton Normals\")** in `vs_nrm`:\n - `n = normalize(P - mix(mean of the skeleton, nearest point on a short vertical edge inside the head, 0.5))`;\n - blended in by a painted mask, blurred 5 times, renormalized; the neck uses a capsule (factor 0.95).\n - Bake it at build time into the GLB normals (`tools/export_glb.py` / `review/vroid-02/build.py`). Then the armory\n page's painted renderer (`review/vroid-02/index.html`), the pixel path and later the game all get it. Paint the\n mask once on VRoid's shared face template. Led #1114.\n - The contact sheet's A/B (our 4 bands and headlight on their mesh) shows the difference. Mesh normals give noisy\n nose and cheek patches that move with yaw; the proxy gives clean ovals at every angle.\n2. **One proxy for the whole head:** hair, brows, lashes and mouth use it too, so shade edges carry from hair into face.\n3. **Two skin tones split at N.L 0.1**, with the rest authored. That is fewer bands than our 4.\n4. **Authored shade:** a painted per-corner `Shadows` attribute, plus tiny nose, lip and eyelid shadow cards. Yang's nose\n card flips sides with the light; for us that would be UV marks picked by the light's side.\n5. **Line-only geometry:** `Eyelids` is edges only, for Line Art. For us, lid and nose lines as 3D polylines projected\n per frame, like `draw_curve_mouth`.\n\n**Proportions:**\n- Yin: 7.3 heads, eye line 0.58 down from the crown.\n- Yang: about 7.8 heads, eyes at 0.55, higher than any VRoid sample.\n- Ours: arm_f_slender 7.3 heads, arm_m_youth 6.5, both with eyes at 0.61.\n\n**Not checked:**\n- the Goo Engine look;\n- the Wiggle 2 dependency;\n- GN input values beyond the group defaults;\n- (Since checked: the owner ran the shipped-shader turnaround with autoexec on. All 8 renders, both rigs at 4 yaws, are\n pixel-identical to the autoexec-off ones. The 6 Python drivers don't touch the rest pose.)\n- Line Art draws nothing headless, so the sheet's outlines are approximate.\n\n### Face shading from the rigs' lessons (2026-10-30, owner's go)\n\nCommits **Armory v13** (`121a1e4`, `face_normals`), **v13.1** (`dc3c532`) and **v13.2** (`fbffd7c`), in\n`tools/vroid_portrait.py` and on by default; portrait guide lessons 32 and 33.\n- **v13:** the face, brows, lines, mouth and skull are shaded from normals pointing away from a line inside the head.\n The nose patch and the blotchy jaw are gone.\n - The line sits at the head's middle (`forward=0.0`), not Yin's 13% forward: VRoid faces are flatter.\n - Hair is off: the trick flattens the strands in the painted renderer.\n- **v13.1 (superseded):** a nose shadow and the chin's V on the neck, made by turning normals down in soft patches.\n The owner saw scars: the edges followed the mesh's triangles.\n- **v13.2** (`fbffd7c`, `shadow_cards`): designed geometry instead, like the Yin rig's shadow cards.\n - A crescent on the neck under the real jaw line, and a half-moon under the nose tip.\n - New role \"shadow\": skin that only darkens into its shade tone (export, the painted page\n `review/vroid-02/index.html`, the pixel path).\n - `face_normals` gains a neck cylinder. Portrait guide lesson 34. Sheet: `shadow-cards.png`.\n- **v13.3:** the neck's line now comes from the skeleton (`neck_frame`: neck bone to head bone).\n - The skin-slice estimate had broken the slender woman's card in the T-pose, which is why she and the youth\n looked different. `neck-isolated.png` shows it with the neck held lit.\n - The crescent is shallower and tapers before the jaw's angle, and cards darken only to a soft shade\n (`min(lit, 0.37)`).\n- **v13.4 (`5e928b9`, kept by the owner 10-30, hair-strand shadows included):** the chin's shadow is cast in screen space from the jaw and hair (portrait guide\n lesson 35, after Anime Shading Plus's depth-offset shadows).\n - The painted renderer draws its info pass first; body skin walks toward the key across it.\n - The chin card is off (`CHIN_CARD`). Sheet: `cast-shadows.png`.\n- **Light, not changed:** the armory's light is a camera headlight from the upper left, with a slightly blue shade\n tint. `light-test.png` shows other directions and a warm tint; the owner found the shape, not the light, was the\n problem.\n- **Fewer tones:** already true on faces after these two steps, so the shared skin shader was left alone.\n- **Step 3 (lid crease) dropped.** Painted into the face texture it can't get darker than about 55% (the skin\n shader's clamp), and bangs hide it. Doing it as ink on VRoid's eyeline overlay is optional follow-up (led).\n- **Only arm_f_slender and arm_m_youth are rebuilt** (local `review/out/armory/site`). The other 12, and the\n published armory page, are still v12.1.\n - Every edit to `vroid_portrait.py` changes `tools/cage.py`'s cache key. A full refresh is\n `python3 -I tools/cage.py`, then `LOWMARCH_SITE=armory python3 review/vroid-02/build.py`, then `sheets.py`,\n then republishing (owner's go). Bodies come out byte-identical; it costs about a minute a body.\n- **Sheets and scripts:** `~/.local/share/lowmarch/trials/face-shading-2026-10-30/`.\n - `arm_shoot.py` shoots a patched copy of the built armory page headless.\n - `variant_build.py` builds settings variants into a scratch site without touching the repo.\n - `armsite_before_v13/` is the v12.1 site with Head and Body rows at 0/35/60/90.\n\n**Flattice in the armory renderer** (`flattice-slender-before-after.png`, same folder): `patch_lens_flattice.py`\ngives a scratch copy of the built page a perspective lens per tile, perspective-aware outline depth, and Flattice as\na vertex-shader squash (pivot at the head bone, along pivot to camera, chin falloff, normals untouched).\n- At flatten 1 every head layer lands on one plane and the depth buffer can't order them (z-fighting), so it uses\n 0.85 and scales the outline pass's depth step by the same amount.\n- **The chin is the cursor, not the pivot.** The docs put the 3D cursor on the chin, but the cursor only sets where\n the squash starts (full above it, fading 5 cm below). The pivot is the parent bone. On the Yin rig: the falloff\n starts at her chin (z 1.447), and the pivot is the head bone 4.7 cm above it, about 11 cm behind the face front.\n Ours matches: cursor at the chin, pivot at J_Bip_C_Head, about 3 cm above it.\n- **Pivot moved to the chin's front (`flattice-pivot.png`):** the head keeps its size at 0 and 35 degrees, but at 60\n and 90 the hair breaks up near the neck. The head-bone pivot is the stable one. A close-up head still looks a\n little small, mostly because the unflattened shoulders bulge toward the lens. Options for the game camera: a pivot\n partway forward, or a light squash on the shoulders too.\n\n**Flattice parked (owner, 2026-10-30): no real value until game scenes are composed with a camera.**\n- The \"something off\" in the head-only renders is two lenses in one picture: a drawn-flat head on shoulders and arms\n still in strong 24 mm perspective. Flattening the whole figure (`flattice-whole.png`) reads consistent, but it then\n comes close to the lens-less armory camera, so the armory gains nothing.\n- **When scenes come:** the anime trick is characters flattened and backgrounds left in perspective. DillonGoo's own\n copy says it can flatten \"face, chest, or whole body\", so start from whole-figure, per shot.\n- The scratch page patch (`patch_lens_flattice.py`) already does lens, whole-figure, head-only and pivot options.\n\n### Skin range (2026-10-30)\n\n- **Armory republished** (same link, version 15): all 14 bodies with v13.4 face shading, plus a skin picker.\n- **The range** (`5a2b154`, `47dcd23`, portrait guide lesson 36):\n - `cast.SKINS` has 12 people tones (porcelain to ebony) and 7 fantasy tones (drow_ash, drow_slate, ashen, orc,\n orc_deep, sea, infernal). The mobs' older 7 tones are unchanged.\n - `export_glb.skin_ramp` derives each tone's shade and deep shade; the painted renderer uses the ramp.\n- **The picker:** `?skin=<tone>` for headless sheets; `SKIN_PICKER` in build.py lists it. The armory bodies themselves\n still default to light skin.\n- **Sheets:** `skin-range-people.png`, `skin-range-fantasy.png` (trials folder). Runner: `scripts/run_range.sh`.\n- **Next range candidates (owner to order):**\n - hair types VRoid lacks (curly, coily, braids, locs) via our hair kit;\n - feature variety (nose, lips, eye shape);\n - eye colours, freckles and marks;\n - fantasy ears (elf);\n - ages and builds beyond the 14.\n\n### Expressions: Yin and Yang vs ours (2026-10-30)\n\nSheet: `~/.local/share/lowmarch/trials/yin-yang-review-2026-10-30/expressions-vs-yin-yang.png`. It shows 9\nexpressions and 5 lip-sync mouths, at 0 and 35 degrees, with Yin beside our slender woman and Yang beside our youth.\n\n**How their faces are posed:** with the rig's own macro controls, Rigify Action constraints (`yy_action_map.py`):\n- `eye-look-blink-macro`: Z+ gives happy closed eyes, Z- sleepy closed eyes;\n- `lip-corner-MASTER.L/R`: Z for smile and frown;\n- `brow-shape-control`;\n- eye tilt on the `eye-blink-top/bottom` rotation;\n- the `jaw` rotation;\n- `sync-control`: 9 lip-sync mouths.\n\nLine Art evaluates headless once its Grease Pencil objects are visible in the viewport. `yin_expr.py` projects its\nstrokes and `expr_lines.py` draws them, because the rig's closed mouth is Line Art.\n\n**Ours:** VRoid's 57 shapes, baked at build (`variant_build.py rest=...`).\n\n**Findings:**\n- **Open mouths:** ours are a flat dark-brown blob. VRoid's own mouth texture (FaceMouth) holds white teeth, a pink\n tongue and a pink lining, and the painted renderer throws it away (the mouth role is flat colour \"1\"). Yin shows\n teeth and tongue.\n- **Brows:** our slender woman's bangs cover her brows, so angry and sad barely read. Yin's bangs stop above hers,\n with gaps. She does not draw brows over hair; that anime trick would be our own option.\n- **Asymmetry:** VRoid has no one-sided mouth shapes, so no smirk. The rig's bones allow it.\n- **Closed-mouth shapes:** theirs are drawn strokes (a \"u\" smile, an inverted-v frown). Ours are VRoid's painted line,\n barely changing.\n- **Holding up:** joy, wink and the vowels read fine on ours.\n\n### Expressions, iterated (2026-10-30, `0d42cea`, portrait guide lesson 37)\n\n**Six rounds on our slender woman and youth.** Frontal sheets (before vs now):\n`~/.local/share/lowmarch/trials/expressions-2026-10-30/expressions-front-{woman,youth}.png`.\n\n**In the painted renderer now:**\n- the mouth from VRoid's texture in an anime palette, with an inked rim;\n- brows through the bangs (a brow-only pass);\n- the painted lip line inked;\n- one-sided shapes (`@L`/`@R`) in vrm.py.\n\n**The pipeline:**\n- `scripts/build_expr.sh LIST [names]` builds expressions into kept dirs (`out/exb/<name>`);\n- `shoot_expr.sh PAGE TAG` reshoots a page change without rebuilding;\n- `front_sheet.py` lays out the sheets.\n- Expression recipes are in `expr_list.txt` (VRoid shape names; `none` = neutral).\n\n**Still weak:** closed frowns (angry, sad). VRoid's painted lip line is too faint. Next: a drawn lip line, real line\ngeometry along the lips' seam (as the rigs' Line Art), which follows every shape.\n\n**Not yet in the published armory:** the page changes are committed. Republishing needs a look at the other 12 bodies\nfirst (brows through other hairstyles, the lip window on other faces).\n\n### Expressions benchmark (2026-10-30)\n\n**Three tracks, same task, from `47dcd23`.** Folder `~/Projects/lowmarch-bench` (README, brief, kit, worktrees `a/ b/ c/`\non branches `bench-{a,b,c}`).\n\n| Track | Doer | Rounds | Min | Commit | Blind verdict |\n|---|---|---|---|---|---|\n| A | Opus 5.5 alone | 4 | 41 | `5ebe476` | tied 1st |\n| B | Opus 5.5 + GPT-6.1-Terra reviewer | 6 | 64 | `fc3970d` | tied 1st |\n| C | Codex, Terra end to end | 5 | 42 | `fffca34` | 3rd |\n\n- **Owner's notes:**\n - B has the right smug (one-sided shapes) but messy wink lashes. Terra flagged them 4 times; B declined.\n - A has the best mouth interior and lashes, but left the closed-eye iris strip.\n - C alone fixed that strip (closest on the youth's joy), but left open mouths flat brown.\n- **Brows:** all three drew them over the bangs.\n- **Judging files:** `judge/` (`OWNER_VERDICT.md`, `LEAD_BLIND.md`, `BLIND_KEY.json`, blind sheets). The rebuilds were\n pixel-identical to each track's own finals.\n- **Transcripts:** redacted bundle in `transcripts/public/` (tools in `transcripts/tools/`). It's live, unlinked and\n noindex, at https://baldanders.severian.dev/expressions-2026-10/. baldanders keeps a snapshot, so after any change message the\n site session (personal/severian-site) to re-scan and republish.\n- **Combined row (track D, branch `bench-d` at `07d18f0`, worktree `d/`, notes `work/d/NOTES.md`):** B's brows and\n recipes, A's mouth and wink, main's closed-eye fix. Sheets `judge/sheets/combo_*.png`.\n - **Rule (owner, 10-31):** one lash size per character, shared by open and closed lids. A closed lid is that lash\n moved (`keep_lash_weight`, `lid_gap`), never a stack. The face shape has a `lash` setting (1 = the sample's own).\n Lesson 38.\n - **Check:** `python3 tools/lash_check.py [names]` (not `-I`: numpy is user-site). Flags a lid more than 15% off.\n Both test bodies pass; run `cage.py` first for the other 12.\n- **Open:**\n - The youth's joy: tiny pale specks inside the closed lids.\n - Merged 10-31: master `c4f1015` has bench-d (lids, lash rule and checks) and bench-e (mouths: `hold_mouth`,\n `even_mouth`, no teeth in a slit, `fangs` switch in cast.py, lesson 40). All 14 bodies pass `lash_check.py`.\n - The old armory artifact belongs to the standby account and can't be updated from the primary. The owner chose\n a new page: the cast expressions page [redacted: a link to a private page] (14 x 14 tiles, source\n and tile builder in `~/Projects/lowmarch-bench/kit/expr_page/`, 14-body render script `kit/all14.sh`).\n - Open: old man's fangs (owner's call), angry hairline on four women (#1184, needs the drawn lip line #1128),\n smug tick (#1185), stepped lid tops (#1186), youth lid 0.8 in shots (#1181), the average woman's ear and hair\n slice (#1123, next).\n - A blog post later (led #1141).\n\n### Hair research (2026-10-31)\n\nReport: [redacted: a link to a private page] (copy and scripts in `~/.local/share/lowmarch/trials/hair-research-2026-10-31/`).\n- **#1123 diagnosed:** the 90 degree slice and the pale stripe at 35 are one gap between side and back locks, crown to neck,\n showing scalp and ear. VRoid sample A has it as shipped; our warp widens it and our base ear is bigger. The ear is in the\n face mesh and takes the skin tone. Fix proposed: a shell under the locks in the darkest hair tone (all styles), lock back\n faces in that tone. `sideview2.py` draws the flat side view by primitive.\n- **Blender:** no extension fixes our bugs. 5.2.3 ships 26 hair nodes (Braid, Curl, Frizz, Clump, Shrinkwrap), scriptable,\n no install. VRM Add-on 4.10.3 (saturday06) round-trips VRM headless; install needs the owner's go. Paid tools (Stylized Hair\n PRO $22 MIT, Hair Tool 4 $52, Anime Hair Maker $25) have no Python API: hand styling only, on hold.\n- **Plan:** #1123 inner layer (owner go pending), braid/coil locks in hair.py (#1192), half-day Blender built-ins trial (#1193).\n\n### Reflection and research (2026-11-08, no building)\n\nPage for the owner: `~/citadel-render/workers/handoff/reflect/lowmarch.html` (private, not published). Recommendation: restart on one whole character in\none game frame, with the owner choosing between rows early. New catch: our VRoid sample exports carry `Redistribution_Prohibited`, `OnlyAuthor`,\ncommercial `Disallow` in their VRM meta (probably the export dialog's default; pixiv's A to Z help page is still unread).\nBuild material (scripts, shots, transcript extracts, the research downloads) is copied out of the scratchpad to\n`~/.local/share/lowmarch/trials/reflect-2026-11-08/`. The page file itself is the master; the box was added only there.\n\n**Next (owner, 11-08, via the lead):** they'll start over with one character, from scratch, to work out together a faster, better process. Nothing to build until they\nstart it. The first-session plan is the box at the top of the page; the retro below it is background, so don't wait for comments on it.\n\n### Sources\n\n1. https://superhivemarket.com/products/flattice\n2. https://superhivemarket.com/products/flattice/docs\n3. https://dillongoo.gumroad.com/l/flattice (price and rating from the page data)\n4. https://www.dillongoostudios.com/add-ons\n5. https://extensions.blender.org/add-ons/flattice/\n6. https://github.com/merlinperry97/flattice\n7. https://extensions.blender.org/add-ons/flattice/versions/\n8. https://superhivemarket.com/products/flattice/faq\n9. https://extensions.blender.org/add-ons/latticemagic\n10. https://studio.blender.org/pipeline/addons/lattice_magic\n11. https://booth.pm/ja/items/5377757\n12. https://superhivemarket.com/products/stylized-normals\n13. https://80.lv/articles/get-clean-normals-for-stylized-shading-with-this-free-blender-tool (2025-04-25)\n14. https://docs.blender.org/manual/en/dev/modeling/modifiers/modify/data_transfer.html\n15. https://erichu33.github.io/ASPDocs/en/articles/face-shadow-map-creation-and-baking-workflow.html\n16. https://booth.pm/en/items/8245542\n17. https://docs.blender.org/manual/en/dev/grease_pencil/index.html\n\n**Not verified:**\n- DillonGoo's version number, its exact release date (only \"3 days ago\"), and whether it scripts headless;\n- a Patreon release mentioned by a search summary;\n- a TikTok promo by the studio;\n- a Blendatlas listing that returned 403;\n- Merlin Perry's headless behaviour (read, not run);\n- the Line Art page for Blender 5.x;\n- Goo Engine's current version: its page says open source, with downloads through Patreon\n (https://www.dillongoostudios.com/gooengine).\n"} {"chunk_id":"b0652c","wall_time_seconds":0.00000392,"exit_code":0,"original_token_count":8578,"output":"# Portrait guide\n\n**Status (2026-11-08):** detail log, kept as written. Start at `docs/handbook.md`, which marks each rule earned or guessed.\n\nHow we draw Lowmarch portraits, and what each study taught us. Update this after every\nportrait so the next one starts further ahead.\n\n## Format\n\n- 96×80 mug, ¾ view **facing left** (mirror at runtime for the right side of a dialogue).\n- Layers: `back` (hair behind the head), `body` (neck, clothes), `face`, `hair` (front), plus\n overlays `blink`, `talk1`, `talk2` that sit between `face` and `hair`.\n- No hard colour cap. Rowan uses 26 colours; spend them where the eye looks (face, hair, trims).\n\n## House style (from the FE8 study, 61 portraits)\n\n**Line.** Outline is a dark purple, never black. Lines *inside* a material use that\nmaterial's own darkest tone: rosy brown in skin, darkest hair tone between locks.\n\n**Skin.** Five tones. The main fill is the *lightest* cream; form comes from warm shadow\nsteps (yellow-cream → orange → brown → line). Shadows go: under the bangs (cast), the far side\nof the nose bridge, under the nose tip, the turned side of the face toward the ear, along the\njaw, under the chin, the neck.\n\n**Eyes.** Smaller than you expect. Near eye ≈ 7×5 px, far eye 3–4 px wide and cut by the face\ncontour. Two-pixel upper lash with a flick at the outer corner; sclera on the nose side;\niris pushe…3353 tokens truncated…eft, cool shadows (rosy for\n skin), warm lights, a fresnel rim, metal as a sky/ground reflection plus a highlight streak, a hair\n sheen, object-space brush grain (per material: skin 0.02, hair 0.04, cloth 0.10, ground 0.16),\n coloured outlines (a 2.2 px outer silhouette, interior lines at depth breaks, each a darker\n shade of the colour it borders), and crease darkening from depth.\n- **One rigged character** (`export_glb.export_skinned`): the reference-pose mesh, VRoid skeleton\n with our bone scales, inverse binds, and per-vertex weights for every piece. Clips are\n authored in `tools/clips.py` as a few key poses, finished with `tools/rig.py` (two-bone leg IK,\n `aim` for the sword, `rotate_world`). Poses accept 4×4 adjustments (`poses.move`) for root motion.\n- **Garment weights come from the exact skin they grew from** (`fitting.blend_weights` through\n subdivision). Copying from the nearest skin let one boot take the other leg's bones, and the\n boots stretched into sheets when the legs split.\n- **Export a channel for every bone the clip moves away from the reference pose,** even if it\n then holds still: a held fist has no variation, but without a channel it reverts to the open\n reference hand.\n- three.js shader includes must start a line: `void main() {\\n#include <...>`.\n- Cloth on an animated body: hide the skinned cape and read its pinned row with\n `getVertexPosition` each frame; colliders follow bones by name; the simulated copy is a plain mesh\n in world space.\n\n### 10 · Painted renderer tuned to the study, and the costume kit, 2026-10-08\n\nThe Unicorn Overlord study (24 official images, measured) gave shader rules and a costume\nlanguage. The art itself was used for study only; nothing of it is in the repo.\n\n- **Painted shader** (`PAINT_FS`):\n - **Ramps.** Each role carries a kind and one base colour (`scene_info` → `paint`, from the\n cast's `paint` dict). The shader builds the ramp: shadows rotate toward violet (cool hues) or\n magenta (warm hues, leather), and lights rotate toward yellow with less saturation.\n Terminators are ±0.03, and the light band starts at `lit` 0.91: at 0.82, everything facing\n the camera landed in the highlight.\n - **Skin** uses the measured ramp (`#f8e1d5` / `#c6a89b` / `#73524f`) with no grain.\n - **Hair** has four bands and a spec band shaped by the strand texture. Keep the texture's\n influence low (0.12), or VRoid's baked streaks turn into noise.\n - **Steel** uses hard bands on the reflection's y. A surface facing the camera (r.y ≈ 0) must\n land on the plate's own grey, not a dark band. Jitter the thresholds with noise stretched\n along the bands, or they break into blobs.\n - **Stage grade:** ambient, key colour and back rim, set per view.\n- **Painted line art** (`PAINT_COMP`): the ink is the local hue at saturation 0.2–0.45 and value\n 0.19. The silhouette is about 0.42% of the figure's height on screen. Interior lines are 55%\n of that, and only at depth breaks between pieces.\n- **Costume kit** (`outfit.py`):\n - `limb_lames`: bands around a limb, cast out of the bone axis. Use at least one row per 15 mm\n along the limb: with sparse rows the calf bulged through between them.\n - `dome` and `fan` (`joint_guard`): couters and poleyns with wings.\n - `pipe`: rolled plate edges, which define plate instead of gold.\n - `panel`: the tabard.\n - `mantle`: the hooded scarf.\n - `shield`: the round shield with a chevron device.\n - The new `lord` builds in the study's layering order: doublet, plate, belts, tabard, scarf.\n The first costume stays as `lord_tunic`.\n- **Cloth must start outside what it covers.** The drape only pushes outward along the nearest\n face, so a scarf that starts inside the breastplate stays there. Push it out with level rays\n from the neck axis.\n - Keep overhanging pieces (spaulders) out of that collision set. A ray that passes under one\n lands on the arm and pulls the cloth into the gap.\n - The scarf is short at the sides, so the spaulders stand over its edges.\n- **Spaulder spread about 108°.** At 132° the lames' front ends wrapped onto the chest and cut\n through the scarf.\n- **Per-cloth colliders** (`export_glb.CLOTH`): panels hanging from the belt meet the legs only.\n The hip capsule's round end pushed the back panel out behind.\n- **Contacts are inelastic** (the viewer's `Cloth.step`): 80% of a push-out is added to the\n previous position too. Otherwise a stepping thigh flings the tabard.\n- New pixel roles: `signature` (the cast's coat bands) and `doublet` (cream, `Q R S T`).\n- **Follow-up after review (user):**\n - **Body proportions.** New shape keys in `bone_pose`: `shoulders` (clavicle length), `arms`\n and `legs` (limb thickness), `torso` (waist to chest), `leg_len` (the hips lift by the leg's\n growth, so the feet stay down) and `hands`. Aldric is now about 7.5 heads (from 6.8), with\n shoulders 1.28.\n - **Bone scales vs. pieces that use a bone's frame.** Pieces that take directions from a bone's\n world matrix (the sword in the hand) must normalise it once the bone carries a scale.\n - **An under-layer next to skin must not be skin-toned.** The cream doublet read as bare arms,\n so the doublet is dark charcoal-navy; borders and devices use a separate cool-white\n `heraldry` role.\n - **Belts cast with the body skin in the set wrap the hanging forearms** in the reference pose,\n and stick out sideways once the arms move. Cast belts onto torso layers only.\n - **Body skin is culled under a costume, so every joint needs an overlap.** The wrist showed a\n gap between the sleeve hem and the glove. Gauntlet cuffs overlap both.\n\n### Milestone · Aldric v9 frozen, 2026-10-08\n\nThe user froze Aldric here as the reference character and asked to put on record how far the\nwork has come. In two days, the same character went from:\n\n1. a 96 px GBA-style portrait;\n2. a code-built head mannequin;\n3. a VRoid base with archetype controls (bone scales, an anchored face sculpt, rest morphs);\n4. shrink-wrapped, ray-cast fitted costumes and a high-resolution offline pixel renderer;\n5. a live viewer with 3D, pixel and painted renderers, cloth simulation and a rigged battle\n animation;\n6. a re-dress after a Unicorn Overlord design study, in its layering order, with heroic\n proportions.\n\nThe user's verdict: \"a little too muscular but I like it\".\n\n- **Snapshot:** `review/out/frozen/aldric-v9/` (the built site, `cast.py` and `outfit.py`).\n Published as version 9 of the viewer artifact.\n- **Keep him stable.** Don't change Aldric's cast entry or the `lord` costume unless asked.\n After a change to the shared kit, rebuild and compare his meshes with the snapshot.\n\n### 11 · Elaine, and a two-character bind, 2026-10-08\n\nThe brief (user): a blonde swordswoman like Saber, next to Aldric in the same viewer, locked in a\nsword struggle.\n\n- **Base:** `HairSample_Female` (CC0). `Portrait(hair_trim=0.12)` drops any hair piece that\n reaches past 12 cm from the centreline, which removes the twin tails and their ties. That\n leaves the bangs and side locks.\n- **Costume** (`knight_dress`): `updo` is a bun, a two-strand braid wound round it, a ribbon\n and a flattened, tapering cowlick. With it come a bodice, tights, a breastplate, a closed\n `skirt` (with `drape(closed=True)` and `closed_grid_mesh`), spaulders, gauntlets, greaves and\n `sabaton`s.\n - **Female bases weight the chest to Bust bones.** Include \"Bust\" in a plate's bone list, or it\n comes out with two holes.\n - **Feet with toes:** a wrap shows the toes, a squashed ellipsoid reads as a triangular hoof\n (the user caught it), and a shell projected onto the convex hull creases. What worked is a\n parametric shoe last from the foot's measurements: rounded heel and toe, widest at the ball,\n rising to the ankle.\n - **`slice_line` cuts each shared edge twice.** Deduplicate before running a pipe along it, or\n the pipe's first tangent is zero.\n- **Proportion scales shear turned limbs.** Scaling the clavicle (`shoulders`) skews the arm\n once it rotates: Aldric's hanging upper arms are about 20% shorter and wider sideways (frozen\n as is). New characters use `shoulder_w`, which moves the arm joints out instead. The rig's\n `ortho` mode rotates through the parent's pure rotation. The duel's grip solve measures the\n real fist after each step (CCD-style), because the analytic arm IK alone undershoots on a\n sheared arm.\n- **The bind** (`tools/duel.py`):\n - **Setup:** one stage, a shared crossing point, and a placement per fighter (position and\n yaw). The player stands on the right, turned 62°.\n - **Grip:** `rig.grip` puts the fist on its target with the blade aimed through the crossing\n point. The blades meet within 1 mm; `review/vroid-02/duel_check.py` prints it.\n - **Stance:** a two-handed fighter's left fist sits 9.5 cm down the grip. A long dress gets a\n short stance.\n - **Motion:** the clip loops a push: the crossing point drifts toward whoever is giving ground.\n- **Viewer:** a character picker and a Duel view; the fighters stand on a stage group that the\n turn slider rotates. The second character's hair gets its own info-pass role id (11), so the\n pixel renderer inks each character's hair in that character's own darkest tone.\n- **Long skirts are posed, not simulated** (`SkirtRig`). A free cloth tube against moving leg\n colliders broke in every variant:\n - pushed out the nearest way, it slipped between the legs;\n - pushed out round the leg, the teleports added energy and the hem flew up;\n - with friction on every iteration, it drifted.\n\n Instead, each column hangs from its waist point at its rest shape and is pushed straight out\n along itself past any leg; rows below a contact hang from it. Segment lengths are kept and the\n pushes are smoothed round the skirt and over time.\n- **Clips can ease in from another clip** (`setClip(name, from)`), so cloth sees the legs move\n rather than jump.\n- **Cloth contacts have friction, applied once per step** (keeping 40% of the speed). Applied\n inside every constraint iteration, it compounded.\n\n### 12 · Checking what the user sees, 2026-10-08\n\nThe user's review of Elaine found two things my checks had missed:\n- **A shelf at the waist:** the top of her skirt stands out past her hips at the sides.\n- **An arm through her body:** in the bind, her right upper arm passes through her chest.\n\nBoth were hidden by how I checked. Every view had the arms hanging over the sides of the waist. The\noffline renderer doesn't run the viewer's skirt rig. And the duel check measured only the fists and\nthe blades, never the arms against the body. The fixes are tools, not care:\n\n- **Check sheets** (`review/vroid-02/sheets.py`): one image per character, plus one for the duel,\n rendered by the review page itself (`index.html?sheet=<name>` in headless Chromium, about 15 s each).\n - **Rows:** arms out (35° from the T-pose: `apose`, a clip exported for checking) and idle, each\n from six angles; the attack keyframes; close-ups of the waist, the wrists and the feet; and a\n close-up of every keyframe the checks flag. The duel sheet shows three beats from four sides,\n plus the bind close up.\n - **Each tile** is posed, gets its cloth settled at that angle, and is rendered by the painted\n renderer, so it is what the user sees.\n- **Clearance checks** (`tools/checks.py`, run by every build, reported in the page's panel):\n - **Method:** each arm segment is a capsule (the bone's centre line, with the limb's median\n radius measured from the mesh), tested against the posed torso skin.\n - **Skin-vertex tests failed both ways.** Hanging arms read as several centimetres \"inside\",\n because of the skinning's squash at the armpit, and VRoid's unused vertices (with zero normals)\n read as touching.\n - **Nearest-vertex signs mislead.** The shoulder top is weighted to the Shoulder bones, so a\n raised arm's nearest torso vertex can be the downward-facing armpit skin. A point counts as\n inside only along the inward normal (|s| > d/2). The upper arm's first half is skipped.\n - **What the checks found:** the v10 bind put Elaine's arm 6.4 cm inside her chest. The shared\n attack clip's follow-through puts the sword arm 2 to 3.5 cm into the chest on both characters.\n Aldric's wind-up is also flagged (the forearm behind the neck, under the mantle) and still to\n be confirmed.\n- **The fix for the bind:**\n - **Reach first, search second.** Searching elbow directions (`duel.clear_grip`) cleared the right\n arm, but the left kept lying across the chest whatever the elbow did: the left arm was nearly\n straight to reach the pommel.\n - **What worked:** a two-handed fighter is now placed from where the grip sits relative to its\n own chest (`reach`: close in and a little to the left). Both arms then bend and clear the body\n by about 2 cm, and the blades still meet within 1 mm.\n- **Faster loop:**\n - **No pixel frames:** the build no longer renders the 96 offline pixel images (the pixel renderer\n is paused). Cameras come from `Portrait.frame()` without rendering.\n - **One character at a time:** `build.py elaine` rebuilds just Elaine.\n - **Cached duel:** the bind's poses are cached, keyed on the rig, duel, check and pose code and\n the two cast entries.\n - **Times:** a full build takes about a minute, and the three sheets about 45 s.\n- **Viewer:** the page is now a full-window stage with two control bars and a side panel (notes,\n checks, sheets, display options, pieces). It offers the painted and 3D renderers only. Battle and\n duel frame the figures rather than the game's ground strip. A clip only carries the bones it\n moves, so each clip starts from the reference pose (`skeleton.pose()`).\n\n### 13 · Outline plates, trim and steel that follows the form, 2026-10-08\n\n- **Elaine's waist shelf** was the belt bug again. The skirt's waistband was cast (outermost hit)\n onto the bodice, and the bodice includes its sleeves. With the arms hanging beside the hips in the\n reference pose, the ring caught the sleeves at the sides. Rule: cast waist rings onto the torso\n only. `outfit.without(piece, bones)` drops a garment's triangles that are weighted to the arms.\n- **Plates drawn as outlines** (`tools/plates.py`). The first kit could only make bands and wraps;\n shaped plate needs outlines.\n - **Charts:** `TorsoChart` (u = degrees round the body, 0 front, +90 the character's right; v =\n height) and `LimbChart` (u round a bone, v along it). Each is a field of ray casts onto the layer\n underneath, filled and smoothed. As a shell (max with a wide blur, then a blur) it bridges hollows\n such as the cleavage, so plates are shells, not mouldings of the skin.\n - **`outline_plate`:** the region between `bottom(u)` and `top(u)`, so the outline is the mesh\n boundary and a pointed waist, a scooped neckline or a pointed cuff is one function. It is offset\n along the chart's normal, domed (`crown`), belled (`flare`), and given real thickness. Optional\n rolled edges (pipes, any role) and rivets come with it.\n - **Orientation:** a thick shell has as many inward faces as outward ones, so a majority vote on\n normal direction is a coin flip. Orient the outer face along the chart normal explicitly.\n - **Plate data:** each vertex carries (1, distance to the outline, border width, height in the\n plate), exported as `_PLATE`. The painted shader draws the gold border, an engraved line on the\n border's seam and one 5 mm inside it, and a gradient up the plate.\n- **Steel that follows the form:**\n - **The blotches:** hard reflection bands keyed on the reflection vector are lines on a tube but\n fill a broad plate (and make closed rings on a dome).\n - **Bands by curvature:** the shader measures curvature on screen (`fwidth(n) / fwidth(position)`,\n in 1/m) and fades the bands below about 1/(10 cm). Broad steel gets a soft tone: darker toward\n the ground and lighter facing up, or, on outline plates, lighter up the plate, plus a hard-edged\n key highlight.\n - **WebGL:** give the material default values for custom attributes (`defaultAttributeValues`),\n or meshes without them read whatever another program left in that attribute slot.\n- **Saber (study)** is a benchmark, not for the game: Elaine's base dressed as Saber with the new\n kit, to measure how close it gets to a well-known design. `tools/compare.py` puts a study\n reference beside a sheet tile, written to the study folder outside the repo.\n- **Decals:** designs painted in a piece's own coordinates (`plates.Canvas`). The texture has\n three channels: R paint (the cast entry's `motif` colour), G a recessed groove (dark), B gold\n inlay. Outline plates take `decal=[...]` shapes in chart coordinates, with sizes in metres.\n - **Bug:** glTF's texture origin is the top left, while the canvas draws with t increasing upward.\n Every decal came out upside down until the exporter flipped t.\n - **Bug:** the cloth hem band colour used to overwrite `uGold`, which turned gold decals on a\n simulated skirt grey. It now has its own uniform, `uBand`.\n- **More plate features:**\n - **Seams:** panels dome between seam polylines, which sink into grooves and are painted dark.\n - **Studs** sit at seam junctions.\n - **Facets:** flat faces between given angles. Their corners are pushed out (circumscribed);\n otherwise each face cuts inward by about 8% of the radius across 45°.\n - **`ConeChart`:** a chart with a radius function, for skirts and the plates over them.\n - **`stiffen`:** moves a share of a garment's weight onto the hips.\n - **Cloth trim:** outline pieces in cloth roles get the gold border and a fine inner line too.\n- **Layer check, second try:**\n - **What failed:** distance from the body can't tell under from over. Where a plate bridges a\n hollow, the cloth in the hollow is further from the nearest body point than the plate is.\n - **What works:** cast a ray inward from each garment point along its own normal; if it meets\n the plate's face within 3 cm, the garment is outside the plate.\n - **Scope:** each garment region is tested only against plates on the same body part, so a sleeve\n hanging beside a breastplate doesn't count.\n - **Reporting:** overlaps in the reference pose are reported once; keyframes report only what\n motion adds.\n- **Comparing against references** (study use only; everything stays in the study folder):\n - **Large renders:** `sheets.py --big NAME 0 3` renders the reference-pose row at 3×, and\n `tools/compare.py` sets references beside a tile at the same figure height.\n - **The reference row is drawn level, without the sword.** Model sheets are straight-on and\n orthographic; at an 8° pitch, parts at the front project lower than parts behind.\n- **Benchmark (Saber study, `tools/saber_study.py`):** a reference agent wrote a part-by-part spec\n in fractions of height (H) and head height (hd). Our base's landmarks agree with it to a few\n percent, so each part is placed at y(f) = top − f·H. What the comparisons fixed:\n - **The underskirt hung to the floor:** settling swings a flared skirt down, so it is scaled back\n to its length afterwards.\n - **The overskirt and hip plates hid the hands:** the cone must widen mostly below the hands\n (t^1.45, not linear).\n - **The underskirt showed through behind the hips:** an outer cone must be built after the layer\n under it and kept outside it.\n - **Seams and motifs read only when bold:** about 4 mm grooves and broad blades. Fine detail\n vanishes at game scale.\n - **Still to do:** her hair (the base's bob lacks Saber's side locks and braided crown); flat\n"}
agent
+0:30The record points to a strong body-building pipeline, but little evidence yet of a whole dressed character working in the intended view. I agree with restarting around one character. I’d change the proposed order: test a pose early, and keep a second camera view so one attractive shot cannot hide a fit problem. I’m checking which existing assets can make that concrete.
exec_commandsed -n '1,200p' docs/portrait-guide.md
command
sed -n '1,200p' docs/portrait-guide.md
result, 4 lines
Script completed Wall time 0.0 seconds Output: {"chunk_id":"5ec1ea","wall_time_seconds":0.0000043,"exit_code":0,"original_token_count":3360,"output":"# Portrait guide\n\n**Status (2026-11-08):** detail log, kept as written. Start at `docs/handbook.md`, which marks each rule earned or guessed.\n\nHow we draw Lowmarch portraits, and what each study taught us. Update this after every\nportrait so the next one starts further ahead.\n\n## Format\n\n- 96×80 mug, ¾ view **facing left** (mirror at runtime for the right side of a dialogue).\n- Layers: `back` (hair behind the head), `body` (neck, clothes), `face`, `hair` (front), plus\n overlays `blink`, `talk1`, `talk2` that sit between `face` and `hair`.\n- No hard colour cap. Rowan uses 26 colours; spend them where the eye looks (face, hair, trims).\n\n## House style (from the FE8 study, 61 portraits)\n\n**Line.** Outline is a dark purple, never black. Lines *inside* a material use that\nmaterial's own darkest tone: rosy brown in skin, darkest hair tone between locks.\n\n**Skin.** Five tones. The main fill is the *lightest* cream; form comes from warm shadow\nsteps (yellow-cream → orange → brown → line). Shadows go: under the bangs (cast), the far side\nof the nose bridge, under the nose tip, the turned side of the face toward the ear, along the\njaw, under the chin, the neck.\n\n**Eyes.** Smaller than you expect. Near eye ≈ 7×5 px, far eye 3–4 px wide and cut by the face\ncontour. Two-pixel upper lash with a flick at the outer corner; sclera on the nose side;\niris pushed toward the ear so the character looks at the viewer; a catchlight on the pupil;\na short lower lid. Iris uses 3 tones dark-top to light-bottom.\n\n**Brows.** Men: heavy, sitting right on the lash line. Women: thin, high.\n\n**Nose and mouth.** No outline. The nose is a bridge shadow plus 1–2 dark pixels under the\ntip. The mouth is a 3–5 px line with a lower-lip shade beneath.\n\n**Hair.** Flows from a crown whorl. Each lock tapers to a tip and has a lit side (toward the\nupper left) and a shadow side; the separating line sits on the shadow side. Bangs sweep\ntoward the way the face turns. Shine is broken streaks on lit locks, never one band.\n\n**Body.** The bust fills the bottom ~25 rows and needs bright trims or plate highlights;\na dark, flat costume kills the value structure under the face.\n\n**Archetype cues.** Youth: taller eyes. Age: narrower eyes, bags, smile lines, hollow cheeks.\nHeavy builds: round masses. Women: rounder cheeks, more eye white, thin high brows.\nVillains: slanted eyes, longer nose, asymmetric mouth.\n\n## Workflow\n\n1. **Block in** big masses with vectors (`tools/vecpix.py`): drawn at 4×, shrunk by a\n palette-preserving majority vote, outlined automatically. Good for silhouettes and\n proportions; never for features.\n2. **Face from a template** (`art/templates/face_<archetype>.strokes`), placed with\n `pix.py paint --offset`. Features are hand-placed pixels at final size.\n3. **Hair and cloth with clumps** (`Canvas.clump` + `lock()`): per-lock lit/shadow edges and\n separating lines. Then `pix.py shadow` casts the bangs onto the face.\n4. **Polish** with coordinate strokes (`polish.strokes`). Every hand edit lives in a strokes\n file so `build.py` can rebuild the portrait from source at any time.\n5. **Check at 1×** (the real display size) and in greyscale with `pix.py compare` against\n references. Read the value structure before colour.\n\n## Lessons log\n\n### 01 · Rowan (young man), 2026-10-07\n\n- Writing whole 96-character rows by hand invites miscounts. Use absolute-coordinate strokes.\n- Bangs hanging straight down read as a curtain. Sweep them toward the face's turn.\n- Lines on every lock edge look like planks. Line only the shadow side; layer locks right to left.\n- One flat shine band reads as a cap. Break shine into streaks on lit locks.\n- A dark navy coat swallowed every detail. Lighter ramp, gold trims, a lit shoulder ridge.\n- A thin lock between the eyes became a dark stripe. Keep tips short there, or lighten them.\n- Bare forehead between bangs looked like light columns. Always run the cast-shadow pass.\n- **Open:** the face reads narrower than FE8 because the sideburn and back hair cover the turned\n cheek. Next time leave the ear and cheek visible. The hair is spikier than FE8's rounder clumps.\n\n### 02 · Head mannequin spike, 2026-10-07\n\nBoth 2D attempts (mine and Fable's) plateaued on the same thing: perspective was guessed one\npixel at a time. `tools/head3d.py` builds the head in 3D instead (cranium, a lofted face and jaw,\nnose, ears, neck), poses it, cel-shades it and shrinks it with the vecpix reduction. Features stay\nhand-drawn and are placed at the landmarks the renderer reports.\n\n- FE8 light comes from about the camera, not the upper left: a bright face centre with orange\n toward *both* the far contour and the side plane. Use `LIGHT ≈ (0.08, 0.06, 1)`.\n- FE8 proportions, young man, measured from the eye line: nose tip ≈ +9 px, mouth ≈ +14,\n chin ≈ +17–20. The ear sits ≈ 17 px behind the mouth, so anime heads are shallower than real ones.\n Move the ear forward and keep the head narrow.\n- The chin sits under the mouth, not behind it. A receding loft chin looks wrong at ¾.\n- Self-shadowing from a high light darkens the whole face. Faces take only short cast shadows\n (nose, hairline). The neck takes the long one from the jaw.\n- Without hair, judge the face with a placeholder cap on. A bald cranium makes every head read as\n a light bulb.\n\n### 03 · Features by angle, 2026-10-07\n\nFrom research into anime-style 3D (Guilty Gear Xrd, view-dependent geometry, Genshin face shadow\nmaps, anime head drawing guides). The rule everyone follows: anything that looks wrong from an angle\ngets authored for that angle.\n\n- **Flat eye plane.** A cylinder-like face squeezes the far eye even at 20° (\"cursed\"). Keep brow and\n eye keys square at the front (pf ≈ 4, m ≈ 0.55) so the eyes sit on a plane that turns at the temple.\n Far/near eye width should be ≈ 0.84 / 0.71 / 0.56 at 20 / 35 / 50°.\n- **Features are 2D, drawn per view** (`tools/features.py`). Eye width comes from projected corners.\n The far eye anchors on its inner corner and is clipped by the face. Irises shift toward the viewer by\n ≈ 0.6·sin(yaw)·W/2 px. The mouth spans its projected corners (4–5 px at the front).\n- **The nose is an outline, not a shading source.** It uses proxy normals, casts no shadow, and gets\n a dash under the tip plus a short far-side bridge shadow. Its rise grows with yaw (`view` keys).\n- **Jaw corner under the earlobe**; the back of the jaw rises into it. The ear runs from the lash line\n to the nose base, tilted back about 12°.\n- **Authored shading beats computed shading.** From 35° the strip between the nose line and the far\n contour is forced to the shadow tone, and from 15° the side plane past the outer eye corner stays\n orange. Proxy-normal blend 0.72 with bands 0.84 / 0.72 / 0.45 gives a clean lit centre.\n- **View-dependent shape** goes in the preset's `view` table (yaw → values, blended with a\n sharpened lerp). Use it for anything that should cheat by angle.\n\n### 04 · VRoid base, 2026-10-08\n\nOur own mannequin plateaued because every shape number was invented. Rendering the unpixelated\nmodel showed it: a flat slab face, a shovel jaw, a spike nose. VRoid's sample models (CC0 and\nVRoid Hub licence, see `docs/vroid.md`) give a professionally built anime head, hair, body and\nexpressions. The first raw render already beat everything we had drawn.\n\n- **Use a real 3D reference before tuning shapes.** Judging 3D at 96×80 hides construction errors.\n Always look at the smooth model (`smooth_view`) as well as the pixels.\n- **Features from geometry and masks.** Eyes, brows and lashes come from VRoid's alpha-tested face\n parts, which classify to palette roles. Lines get a higher vote weight in the 4×4 reduction so\n thin lids and closed eyes survive.\n- **Hair.** VRoid hair is built from strands. Separation lines go where one strand sits in front of\n another, and inner layers drop a tone, which gives FE-style clumps without drawing any.\n- **Archetypes are shape controls on the mesh** (face length, jaw, chin, cheeks, eyes, brows, nose,\n mouth, neck, shoulders, head size), plus hair swaps between models and per-character colours.\n- **Never deform a face by height bands.** Scaling everything between two heights turned Gorm's face\n into a shield and his chin into a spike. Use three layers instead: bone scales for proportions\n (`bone_pose`), anchored RBF sculpting of named anatomical points (`sculpt`; the eyes, ears, skull\n and neck are held still), and VRoid's own expression shapes at low weight for hooded or stern eyes\n (`rest`). Check every archetype in the smooth view, front and profile, not just at 35° in pixels.\n- In a bust, drop the body skin below the neck. Clothes are fitted to the base body, and any change\n of build makes skin poke through.\n\n### 05 · First costume, 2026-10-08\n\n`tools/outfit.py` builds costumes in code against a `Fit` (posed bone positions plus the body skin).\nThe VRoid clothes are dropped when a cast entry names a `costume`.\n\n- **One-sided sheets need a known outside.** Give every generated piece `outward_from` (a point, or\n a line with `axis`) so its normals face out. The renderer then shades the inside of a cape or\n collar one tone darker. Wrong winding made the first shoulder plate render as its dark inside.\n- **Capes drape; they don't hang.** A cape hung straight down disappears behind the shoulders below\n the frame. Lay its top edge over the shoulders, raise it behind the neck, and clamp it above the\n body's top surface (`Fit.top_height`) plus clearance.\n- **Steel at 1×** needs a narrow top band: bands 0.975 / 0.86 / 0.55, or the plate reads as white.\n- **Male VRoid eyes read small at 1×.** Lords and youths want eye scale around 1.1–1.15. The\n \"surprised\" shape shrinks the irises and does not open the lids.\n\n### 06 · Full figure and review tooling, 2026-10-08\n\n- **The closed mouth is painted, not modelled.** VRoid's mouth mesh is the inside of the mouth.\n The lip line and nose mark are on the face texture. `Portrait(mouth=...)` picks how they are drawn:\n `texture` (painted line grown 4 texels so it survives the vote), `texture+lip` (plus a lower-lip\n shade), `drawn` (an FE8 mouth between the projected corners), or `none`. Marks only count\n inside the nose-and-mouth window of the shared VRoid face layout, or the ear shading turns brown.\n- **Low-poly skin has sparse vertices.** Cross-sections taken from nearby vertices came back empty on\n the thighs, which looked like missing skin; the skin is complete. Take sections from\n triangle-plane intersections, and fit garments to the skin alone. VRoid's own clothes are bulky.\n- **Camera elevation is not a nod.** Turn the character first, then tilt the camera\n (`camera_rotation`). Tilting in model space made the battle figure lean sideways.\n- **Scenery needs its own light.** The camera-facing light leaves flat ground in shadow; scenery\n uses `SUN`.\n- **Keep build scripts in the repo** (`review/<page>/build.py`); the session scratchpad gets wiped.\n Artifact hosting serves `.json`, not `.glb`, so models ship base64-wrapped in `<view>.glb.json`.\n\n### 07 · High resolution and the armour refit, 2026-10-08\n\n**Resolution decision (user):** no GBA-native constraint. Render the 3D models as high-resolution\npixel art on a 640×360 base screen (integer scales to 1080p, 1440p, 4K): portraits 192×160\n(`BUST_*`), battle 640×360 at 90 px/m (`BATTLE_*`). The 4×4 vote and the inking are vectorised.\nRules tuned at 96×80 (strand lines, mark growth) may need retuning.\n\n**Fit (from the armour-fit study: CC0 Quaternius/KayKit references plus measurements of our pieces):**\n- Shrink-wrap garments (`outfit.wrap`, `fitting.shrink_wrap`): weld VRoid's UV-seam vertices first,\n Taubin-smooth (plain Laplacian shrinks the surface about 9 mm, putting 44% of the tunic inside the\n body), then set every vertex at the offset with a floor. Offsets: shirt/tunic 6–10 mm, trousers 8,\n boots 17, gloves 2–3, each layer on top +5–8 mm.\n- Fit collars and plates by ray casts to what they cover (`collar`, `pauldron`), not fixed ellipses.\n An apex gap is fine; open rims and edges touching nothing are what read as floating. Give rims\n thickness (`thick_grid`).\n- The collar rises at the back (44 mm against 28 at the front), sits 9–15 mm off the neck, and its\n front tips stay at least 25 mm below the chin.\n- Capes attach: the top edge lies on the tunic under the collar, clasped at the collarbones, and a\n small cloth solve (`drape`) settles it with clearance from 10 mm (shoulders) to 45 mm (hem).\n Build what it drapes over (tails, belt) first.\n- Build every piece once in the reference pose with skin weights (copied from the body, limited to\n allowed bones for capes and tails, rigid for plates and props), and pose through the skeleton\n (`repose`), so nothing drifts or pops between animation frames.\n\n### 08 · Live renderer and cloth, 2026-10-08\n\n- **The pixel renderer has a real-time GPU port** (`review/vroid-02/index.html`, three.js). It runs a\n colour pass (palette bands per role, camera light, textures for eyes and lids, nose mark) and an\n info pass (role and piece IDs plus depth) into low-res targets, then a composite applies the same\n ink rules as `Portrait.ink`. Use `hex()`-style raw colours and `LinearSRGBColorSpace` output, or\n three.js colour management darkens the palette. The Python renderer stays the reference.\n"}