agent

+2:06
reasoning

Reviewing additional files aims to solidify the understanding of the project's scope and underlying logic. Focused on documentation and core tools to ensure full comprehension of proportions, light frame concepts, factions, and the shoot module's functionality. This will hopefully provide a more complete picture of the project.

  • read_file{"Path":"~/work/sortie/docs/study-proportions.md"}

    input

    {
      "Path": "~/work/sortie/docs/study-proportions.md"
    }

    result, 153 lines

    Showing lines 1-152 of 152
    1: # Study: line mech proportions
    2: 
    3: > **Status 2026-11-08: parked.** The measurements are usable. The targets were my choice and don't bind the one-mech restart. See [handbook.md](handbook.md).
    4: 
    5: What makes a mass produced line mech read as handsome, measured, and what the common pattern took
    6: from it. Read 2026-10-27. References are for study only: images stay in review/out/proportions
    7: (gitignored), nothing here is copied, sources are linked below.
    8: 
    9: ## Method
    10: 
    11: - **References.** Near front photos of plastic kits on a plain ground, one per design: the GM and
    12:   GM II, the Jegan and Jesta, the Zaku II, the Graze, the GN-X, and the Ingram as an outlier (a police
    13:   labor, half our height class). Kits follow the settei closely and photograph square on. The
    14:   Phantom Brigade families (review/out/pb) for the side view and the frame, principles only.
    15: - **Readings.** Every number is a fraction of the crown height: the helmet top, antennae and
    16:   backpack racks skipped, down to the sole. Heights are measured up from the ground. Landmarks were
    17:   read by eye on a pixel grid, leg widths from silhouettes where the kit cut out cleanly. The camera
    18:   sits at mid height a few metres off, so expect plus or minus .02 on heights and widths. Ratios
    19:   between designs are more reliable than any one number.
    20: - **Ours.** Flat silhouettes from the lab (`?sil=1`, a 6 degree lens from 200 m, so close to
    21:   orthographic), measured by a script with the same definitions. The knee joint comes from the kit.
    22: - **Target.** The middle of the GM, GM II, Jegan and Graze: the plain workhorse, not a hero.
    23: 
    24: ## Ratios
    25: 
    26: Widths are full widths (both sides), the thigh and lower leg one leg. The lower leg's widest point is
    27: the widest row between the knee and the ankle cuff.
    28: 
    29: | Ratio | GM | GM II | Jegan | Graze | Jesta | Zaku II | GN-X | Workhorse range | Round 7 medium | Round 7 heavy | Target | Retuned medium | Retuned heavy |
    30: |---|---|---|---|---|---|---|---|---|---|---|---|---|---|
    31: | Head height | .11 | .12 | .11 | .10 | .12 | .10 | .09 | .10 to .12 | .08 | .09 | .10 | .10 | .10 |
    32: | Head width | .11 | .11 | .13 | | | | .11 | .11 to .13 | .10 | .11 | .11 to .12 | .12 | .12 |
    33: | Chin above pauldron top | 0 | 0 | below | 0 | below | 0 | 0 | at or below | .03 | .03 | 0 | 0 | 0 |
    34: | Shoulder span | .39 | .45 | .53 | .55 | .52 | .49 | .53 | .39 to .55 | .38 | .40 | .45 | .45 | .46 |
    35: | Chest width | .23 | .22 | .23 | | .22 | .24 | .28 | .22 to .24 | .22 | .23 | .23 to .26 | .27 | .28 |
    36: | Waist width | .19 | .17 | .16 | | .13 | .24 | | .13 to .19 | .10 | .11 | .13 | .14 | .15 |
    37: | Hip and skirt width | .25 | .27 | .29 | | .34 | .29 | | .25 to .29 | .24 | .33 | .28 | .28 | .28 |
    38: | Crotch | .53 | .54 | .57 | .53 | .51 | .51 | .63 | .53 to .57 | .56 | .54 | .54 | .54 | .53 |
    39: | Knee joint | .39 | .40 | .43 | .40 | .36 | .37 | .39 | .39 to .43 | .35 | .35 | .39 | .39 | .39 |
    40: | Visible thigh (crotch to knee) | .14 | .14 | .14 | .13 | .15 | .14 | .24 | .13 to .14 | .21 | .19 | .15 | .15 | .14 |
    41: | Thigh width | .09 | .11 | .09 | .17 | .14 | .09 | | .09 to .11 | .09 | .11 | .09 | .09 | .11 |
    42: | Lower leg, widest | .12 | .15 | .18 | | | .23 | | .12 to .18 | .08 | .09 | .12 | .12 | .12 |
    43: | Lower leg widest at | .36 and .14 | .14 | .23 | .17 | .24 | .20 | .15 | .14 to .24 | .18 | .18 | .25 | .24 | .28 |
    44: | Lower leg / thigh width | 1.4 | 1.4 | 2.1 | | | 2.6 | | 1.4 to 2.1 | .93 | .85 | 1.3 to 1.4 | 1.3 | 1.1 |
    45: | Hand bottom | .48 | .49 | .49 | | | .51 | | .48 to .51 | .51 | .52 | .48 | .49 | .49 |
    46: | Foot width (front) | .12+ | .13+ | .13+ | | | | | .12 and up | .09 | .10 | .11 | .11 | .13 |
    47: 
    48: Still off the target after the retune: the chest is a little wide (.27, the shoulders moving out
    49: widen its top), and the heavy's lower leg is only 1.1 times its thigh in front view, because the
    50: heavy thigh carries its shield and the heavy calf pack sits behind the shin. Side view, retuned
    51: medium: chest depth .28, foot length .23, the knee the most forward point of the leg.
    52: 
    53: Round 8 closes both, measured on an orthographic front silhouette (ray cast in Blender, the chest
    54: read at .78, the thigh as its widest row between .42 and .50, the lower leg as its widest between .10
    55: and .36):
    56: 
    57: | Ratio | Light before | Light after | Medium before | Medium after | Heavy before | Heavy after |
    58: |---|---|---|---|---|---|---|
    59: | Chest width | .26 | .22 | .27 | .23 | .28 | .24 |
    60: | Thigh width | .083 | .083 | .095 | .095 | .115 | .104 |
    61: | Lower leg, widest | .117 | .117 | .123 | .123 | .126 | .152 |
    62: | Lower leg / thigh width | 1.41 | 1.41 | 1.29 | 1.29 | 1.10 | 1.46 |
    63: | Accent share of plate area | .12 | .22 | .17 | .23 | .16 | .24 |
    64: 
    65: The Ingram reads head .14, crotch .45, knee .23: a short labor, kept out of the range. The GN-X
    66: stands on long 00 style legs (crotch .63) and is kept out of the leg rows. Foot widths in the
    67: photos carry the most perspective, the feet stand nearest the camera and turn out, so the range is
    68: a floor.
    69: 
    70: ## Principles
    71: 
    72: In our words, for a plain line mech of the standard class.
    73: 
    74: - **The head is a tenth of the height** and sits down between the shoulders. The chin is level with
    75:   the pauldron tops or below them. A visible neck reads as a robot toy, not a soldier.
    76: - **Shoulder span is about four head widths**, .45 of the height: wider than the hips, narrower
    77:   than a hero's flared pauldrons (Jegan, Graze .53 to .55).
    78: - **The leg is a short thigh over a long shin.** The crotch sits at .54, the knee joint at .39, so
    79:   only .14 of thigh shows below the skirt and the lower leg runs .32 from knee to sole. The skirt
    80:   covers the top of the thigh. Our round 7 had the human ratio, a .21 thigh, which is what read as
    81:   "the legs are off".
    82: - **The lower leg is the widest part of the leg**, 1.3 to 2 times the thigh. A plain GM keeps it a
    83:   straight box with a cuff over the ankle, a Jegan or Zaku swells it into a bell. Its widest point
    84:   sits between .15 and .25 of the height, at or below its middle, never at the knee. The thigh is the
    85:   narrowest armoured mass in the leg.
    86: - **The knee armour is as wide as the shin top** and projects forward of both the thigh and the
    87:   shin, in the field colour, read by shape. A knee cap narrower than the leg, or in a contrasting
    88:   colour, reads as a band across the leg.
    89: - **Big feet.** A foot as wide as the lower leg at its widest, standing apart: the line mech stands
    90:   in a slight A, feet out from under the hips.
    91: - **The waist is a block, not a pinch.** Two thirds of the chest width or more, an abdomen plate
    92:   that carries the line from the chest down to the skirt.
    93: - **Hands hang at the crotch or a little below**, .48.
    94: - **Coverage.** The workhorses cover almost the whole leg: the frame shows at the back of the knee,
    95:   in the gap at the knee front, and at the ankle. Four or five horizontal breaks per leg: skirt hem,
    96:   knee top, knee bottom, the ankle cuff, the foot.
    97: - **Accent goes on the chest and the feet** (the GM's red chest and boots, the Jegan's dark feet),
    98:   plus the shoulders on some. Between hip and ankle the legs keep the field colour across their width,
    99:   so they read as one long mass: accent there only as long panels running down the leg, never as a band
    100:   across it.
    101: - **Side view.** The knee is the most forward point of the leg, the shin rakes back from it, the
    102:   calf swells behind at mid shin, the toe reaches well forward of the knee. The chest is the deepest
    103:   part of the body with the backpack, the waist sits back from the chest front. (From three quarter
    104:   photos and the Phantom Brigade side renders: lower confidence than the front.)
    105: 
    106: ## What changed in the common pattern
    107: 
    108: - `frame_std.proportion` (pattern builds only, after the plates and `bend_knees`): solves the drop
    109:   of the body and the knee height for crotch .54 and knee .39 of the crown, squeezes the thigh,
    110:   moves the knee region whole so the knee block keeps its shape, moves the shoulders out .25 with the
    111:   chest top widening to meet them, then scales so the crown lands at 16.9 m. The 22 joints keep their
    112:   names and tree. The striker and the other frames are untouched.
    113: - Head 1.24 times the drawn size, seated .6 lower, the chin on the collar.
    114: - Shin outline widened to its widest at about a quarter of the height, a cuff over the ankle. Knee
    115:   block as wide as the shin top, in the main colour. The steel hip block is gone, the tassets reach
    116:   further down over the thigh. Feet 1.45 times wider and a little shorter. Feet .4 out from under the
    117:   hips.
    118: - Waist plate and belly plate wider and taller.
    119: - Heavy legs keep the medium's outlines and add pieces: a thigh shield, knee cheeks both sides, a
    120:   spaced shin guard, a calf pack and ankle spats.
    121: - Light leg plates are thicker (.28), and every thin plate is cut by a block grown across the other
    122:   axes, so no coplanar walls leave stray slivers.
    123: - The back of the head is a neck guard carried down from the helmet with a vent slot and a red lamp.
    124: - Round 8: the breastplate narrowed to .23 (outer edge 1.84 to 1.64 before proportion), with a root
    125:   cover in the field colour in front of each shoulder housing, so the narrower chest does not open a
    126:   dark hole under the pauldron. The cover rides the shoulder joint and turns about its axis.
    127: - Round 8: colour blocking (docs/visual-language.md, Livery). The upper breastplate and the hatch, the
    128:   boots, the head's cheeks and two panels on the backpack's back are accent. The collar, the pauldrons,
    129:   the backpack tanks and the knee stay main. Long accent panels stay on the shins and outer thighs, and
    130:   the heavy's spaced shin guard carries its own.
    131: - Round 8: the thigh's lower lip is shorter with a chamfered corner and the knee block lower with an
    132:   upright front plane, so a seam shows between them in three quarter view. The heavy adds a faceted
    133:   module on the outer calf and pulls its thigh shield and knee cheeks in. Forearms and upper arms are
    134:   about 15 percent fuller. The light grade's thigh and calf backs are closed blocks behind the bone,
    135:   not thin plates on a curved face (those read as loops from the side).
    136: 
    137: ## Sources
    138: 
    139: Kit reviews (photos on a plain ground):
    140: 
    141: - GM, MG RGM-79 Ver 2.0: https://www.dalong.net/reviews/mg/m118/m118_p_e.htm
    142: - GM II, HGUC RMS-179: https://www.dalong.net/reviews/hg/h131/h131_p_e.htm
    143: - Jegan, MG RGM-89: https://www.dalong.net/reviews/mg/m204/m204_p_e.htm
    144: - Jesta, MG RGM-96X: https://www.dalong.net/reviews/mg/m168/m168_p_e.htm
    145: - Zaku II, HGUC MS-06: https://www.dalong.net/reviews/hg/h241/h241_p_e.htm
    146: - Graze, 1/100: https://www.dalong.net/reviews/ib/ib102/ib102_p_e.htm
    147: - GN-X, MG GNX-603T: https://www.dalong.net/reviews/mg/m128/m128_p_e.htm
    148: - Ingram, MG AV-98: https://www.dalong.net/reviews/mg/ing1/ing1_p_e.htm
    149: 
    150: Also consulted: the GN-X and Union Flag settei already in review/out/refs (painted with a low camera,
    151: too much perspective to measure), the Armored Core 6 frames there (three quarter art, not measured),
    152: and the Phantom Brigade renders in review/out/pb.
  • read_file{"Path":"~/work/sortie/docs/light-frames.md"}

    input

    {
      "Path": "~/work/sortie/docs/light-frames.md"
    }

    result, 208 lines

    Showing lines 1-207 of 207
    1: # Light frames: Code Geass reference study
    2: 
    3: > **Status 2026-11-08: reference.** Measurements used by the light class. See [handbook.md](handbook.md).
    4: 
    5: What a knightmare frame is made of, measured from official line art and design sheets, and what
    6: sortie's light class takes from it. Board: `review/out/refs/geass-board-*.jpg` (gitignored, 30
    7: tiles). Sources: official site design sheets (front, back, parts), TV and model kit line art,
    8: settei sketches for heads, cockpit, landspinners and harkens. Measured images: Sutherland,
    9: Glasgow (front and back), Gloucester, Lancelot, Guren, Vincent, Alexander (back).
    10: 
    11: Confidence: medium. The line art is mostly three-quarter standing poses on a low camera. Reads of
    12: +-3% on heights and +-0.03 on widths are normal. Ratios between frames are safer than any single
    13: number.
    14: 
    15: ## Official sizes
    16: 
    17: | frame | role | height | weight |
    18: |---|---|---|---|
    19: | Glasgow | 4th gen grunt | 4.24 m | 7.35 t |
    20: | Gloucester | 5th gen officer grunt | 4.29 m | 7.75 t |
    21: | Burai | Glasgow refit | 4.37 m | 7.48 t |
    22: | Sutherland | 5th gen grunt | 4.39 m | 7.48 t |
    23: | Alexander | 7th gen, Akito | 4.39 m | 6.73 t |
    24: | Vincent, Vincent Ward | 7th gen grunt | 4.44 m | 6.9 to 7.0 t |
    25: | Gekka, Akatsuki | Japanese 7th gen | 4.45 to 4.49 m | 7.8 to 7.9 t |
    26: | Lancelot | 7th gen lead | 4.49 m | 6.89 t |
    27: | Guren | 7th gen lead | 4.51 m | 7.51 t |
    28: | Shinkiro | 8th gen lead | 4.67 m | 8.06 t |
    29: | Mordred | 8th gen heavy | 4.71 m | 10.23 t |
    30: | Lancelot Albion | 9th gen lead | 5.15 m | 9.12 t |
    31: | Tristan | 8th gen transformer | 5.45 m | 7.35 t |
    32: | Gawain | 6th gen two-seater | 6.57 m | 14.57 t |
    33: | Gareth | Gawain-line grunt | 6.94 m | 14.78 t |
    34: | Galahad | Gawain-line lead | 7.20 m | 15.20 t |
    35: 
    36: Everything mainline is 4.2 to 4.7 m: two and a half humans. A pilot standing beside a Sutherland
    37: reaches its knee. Only the Gawain line is over 6 m and those read as a heavier class in the show
    38: (two seats, cannons, twice the weight). Sortie's 6 m light is already a Gawain-class knightmare,
    39: not a Sutherland.
    40: 
    41: ## Measured proportions
    42: 
    43: Fractions of total height, measured from the soles. Widths are fractions of height too.
    44: "Block top" is the top of the rear cockpit block.
    45: 
    46: | frame (image) | head h | chin at | shoulder w | waist w | hip pivot | crotch | knee | hand bottom | block top | foot module |
    47: |---|---|---|---|---|---|---|---|---|---|---|
    48: | Sutherland (suth-04) | 0.12 | 0.86 | 0.50 | 0.17 | 0.55 | 0.52 | 0.30 | 0.43 | 0.92 | 0.10 |
    49: | Glasgow front (glas-03) | 0.13 | 0.87 | 0.52 | 0.20 | 0.58 | 0.55 | 0.33 | 0.50 | 0.92 | 0.20 |
    50: | Gloucester (glou-03) | 0.11 | 0.87 | 0.50 | 0.17 | 0.55 | 0.52 | 0.30 | 0.45 | 0.96 | 0.12 |
    51: | Lancelot (lanc-06) | 0.12 | 0.79 | 0.48 | 0.14 | 0.55 | 0.50 | 0.28 | 0.43 | 0.91 | 0.10 |
    52: | Guren (guren-03) | 0.16 | 0.82 | 0.55 | 0.16 | 0.53 | 0.48 | 0.25 | 0.36 | 0.98 | 0.08 |
    53: | Vincent (vinc-02) | 0.11 | 0.82 | 0.52 | 0.15 | 0.57 | 0.50 | 0.28 | 0.40 | 0.97 | 0.10 |
    54: | Alexander back (alex-02) | 0.10 | 0.88 | 0.45 | 0.14 | 0.55 | 0.50 | 0.39 | 0.50 | 1.00 | 0.18 |
    55: | **grunt mean** | 0.12 | 0.87 | 0.51 | 0.18 | 0.56 | 0.53 | 0.31 | 0.46 | 0.93 | 0.14 |
    56: | **lead mean** | 0.13 | 0.81 | 0.52 | 0.15 | 0.55 | 0.49 | 0.27 | 0.40 | 0.95 | 0.09 |
    57: 
    58: Head height includes the crest. Guren's 0.16 is its swept crest, the helmet alone is 0.11.
    59: 
    60: Readings:
    61: 
    62: - **Hip at 55%.** Every frame, grunt or lead, pivots the hip at 0.53 to 0.58 and the crotch sits
    63:   at about 0.50. That matches sizes.md's 54% for the light class. It is lower than the striker's
    64:   0.60: knightmares are not leggy, they are long-armed.
    65: - **Head 0.11 to 0.13 of height**, 8 to 9 heads tall counting the crest. The helmet alone is about
    66:   0.10, so a plain head makes the frame 10 heads tall. sizes.md's 1/8 is right if the crest counts.
    67: - **Long arms.** Hands hang at 0.40 to 0.50, below the crotch on all of them and down to the knee
    68:   on Guren. Gundams hang at 0.55 to 0.58. This is the single biggest proportional difference and
    69:   it is what makes a knightmare read as a stooped, simian fighter rather than a standing soldier.
    70: - **Shins and knee.** Knee at 0.25 to 0.33 and hip at 0.55, so thigh and shin are equal at about
    71:   0.25 each. Leads drop the knee a little for a longer shin. The shin is slim and the calf is a
    72:   flat plate with the landspinner mount behind it.
    73: - **Shoulders 0.5 of height**, same as a Gundam, but reached with pauldrons rather than a wide
    74:   chest. Chest width under the pauldrons is only 0.25 to 0.30, waist 0.15 to 0.20. Grunts are
    75:   waistier than leads.
    76: - **Cockpit block.** A box behind the torso, 0.70 to 0.95 of height tall (about 1.0 m on a 4.4 m
    77:   frame), 0.30 to 0.32 of height wide (1.3 m) and about as deep. Its top is level with or above
    78:   the head on every frame. From the back it is the whole upper body: shoulders, head and arms are
    79:   attached to it. From the side it doubles the depth of the torso. The Sutherland's is a flat box
    80:   with a hatch panel, the Lancelot's a smooth pod, the Alexander's a long capsule, but all sit in
    81:   the same place at the same size.
    82: - **Landspinners.** Wheel diameter 0.12 to 0.13 of height (about 0.55 m), hub behind and below
    83:   the ankle, the wheel is wider than the foot. The whole foot module (toe to the top of the wheel
    84:   mount) is 0.10 to 0.20 of height. Grunts and the Alexander show the wheel fully, leads tuck it
    85:   into a blade-shaped heel.
    86: - **Harkens.** Chest sides at 0.70 to 0.78 of height, outboard of the chest and under the
    87:   pauldron, muzzles facing forward. Lancelot adds a pair at the wrists. The anchor head is a blade
    88:   about 0.10 of height long (0.45 m). Fired they trail a cable several frame heights long.
    89: 
    90: ## Design grammar: what makes a knightmare read as one
    91: 
    92: 1. **Hunched, long-armed stance.** Head forward and low, shoulders high, arms past the crotch, the
    93:    torso tilted forward of the hips. The cockpit block pushes the centre of mass back, so the
    94:    silhouette leans into it. A knightmare standing straight looks wrong.
    95: 2. **The block is the back.** The rear cockpit block is bigger than the chest. Its top edge rises
    96:    behind the head and its sides stick out past the shoulders on grunts. Harkens and the
    97:    float unit mount to it.
    98: 3. **Helmet, not face.** Grunts have a sensor pod the size of the pilot's whole cockpit hatch:
    99:    Sutherland and Glasgow carry a rabbit-eared pod with four lenses, Gloucester a conical helm
    100:    with a visor slit and four eyes. Leads get a knight's helm with a crest: Lancelot's winged
    101:    brow, Vincent's twin horns, Guren's swept hair. No V-fin, no mouth. The factsphere is a
    102:    separate sensor, usually in the chest, a hemisphere behind shutters that fold open.
    103: 4. **Wheel feet.** Big heel wheels and long flat toes. The frame moves like a skater, knees bent.
    104:    The wheels decide the leg shape: a straight shin with a mount behind the calf.
    105: 5. **Knightly armour on a mechanical frame.** Leads: pointed pauldrons, tassets over the hips,
    106:    greaves with a pointed knee, a narrow waist. Grunts: the same places but boxy, slabs with
    107:    straight edges, one visor and one shoulder vent. Armour is thin: lots of exposed joint
    108:    mechanics at the hip, knee and elbow, and the limbs are tubes with plates on the outer faces
    109:    only.
    110: 6. **Colour blocking.** Grunts: one body colour (Sutherland purple, Glasgow grey, Gloucester
    111:    plum, Ward violet), dark grey joints, a single red or black trim at the chest. Leads: white or
    112:    a hero colour with gold trim on every edge, dark grey inner frame, one red gem in the chest.
    113:    Trim traces the armour edge and the crest, never panels.
    114: 7. **Grunts vs leads.** Grunts are wider at the waist, boxier, shorter-shinned, with the block
    115:    and wheels exposed. Leads are smoother, sleeker, taller in the shin, with the block pod-shaped
    116:    and the wheels hidden in a blade heel. Both share the stance, the block, the harkens and the
    117:    wheels, which is why they read as one family.
    118: 8. **Float unit.** A winged pack hung on the block: two long angled blades bigger than the
    119:    torso, with a thruster core between them. It makes the frame a flying wedge from the back
    120:    and does not change the front silhouette much.
    121: 9. **Cockpit.** Pilot sits upright on a bike seat with screens on three sides, inside the box. The
    122:    whole box fires out backwards on a rocket and lands under a chute. The hatch is the back face
    123:    of the block.
    124: 
    125: ## Take, adapt, avoid
    126: 
    127: For each trait: take as a trait, adapt to sortie, avoid because it makes a lookalike.
    128: 
    129: 1. **Stance.** Take: hip at 54%, hands at 0.42, knee at 0.28, head low and forward with the
    130:    shoulders above the chin. Adapt: lean the torso 10 degrees forward of the hips in the rest
    131:    pose so the block reads from the front. Avoid: the exact rabbit-pod head angle and the fixed
    132:    stoop. A space frame stands straighter in zero g.
    133: 2. **Core block.** Take: a block 1/4 of height tall, 1/3 wide, 1/4 deep behind the chest, top at
    134:    or above the head. The whole block ejects. Adapt: make it a module with its own hull colour so
    135:    the pilot's part reads as a vehicle inside a frame, and let it carry the harkens and the float
    136:    pack hardpoints. Avoid: the Sutherland's hatch panel with a horizontal slot and the Lancelot's
    137:    egg pod shape in white and gold.
    138: 3. **Harkens.** Take: a pair on the block sides under the pauldrons, muzzles forward, anchor blade
    139:    0.1 of height. Adapt: in space the cable is the weapon, so give the muzzle a visible reel
    140:    housing and make the anchor a claw rather than a blade. Avoid: Lancelot's four-harken layout
    141:    with wrist pairs in gold.
    142: 4. **Spinners.** Take: a wheel 0.12 of height at the heel, a flat long toe, knees bent when
    143:    rolling. Adapt: magnetic hull wheels, so put a second small wheel under the toe and give the
    144:    wheels a lit rim. Avoid: the swing-down hinged wheel from the Glasgow, which is the show's
    145:    signature mechanism.
    146: 5. **Head.** Take: a helmet with a brow and a single visor slit, a crest that breaks the outline,
    147:    the eyes recessed under the brow (heads.md 2, 4, 5). Adapt: use the hood family already chosen
    148:    and add the crest as a swappable part. Avoid: the rabbit-ear sensor pod with four lenses, the
    149:    Gloucester cone, the Lancelot wing brow.
    150: 6. **Factsphere.** Take: a shuttered sensor hemisphere that opens for scan mode. Adapt: mount it
    151:    in the chest plate for grunts and in the brow for leads, so it doubles as a faction marker.
    152:    Avoid: the green glass dome with the orange iris.
    153: 7. **Armour layering.** Take: thin plates on outer faces only, exposed joints at hip, knee,
    154:    elbow, pointed pauldrons and tassets on leads, slabs on grunts. Adapt: fewer, larger plates
    155:    than the striker, as sizes.md already says, so a 6 m frame keeps the same detail density.
    156:    Avoid: gold edge trim on white, which is the Lancelot in one glance.
    157: 8. **Colour blocking.** Take: one body colour plus dark joints plus one trim accent at the chest
    158:    for grunts, and trim along armour edges for leads. Adapt: use the palette roles already in
    159:    `src/render/palette.ts`, with the block in a second body tone. Avoid: Britannian purple with
    160:    a red chest, red with an orange crest, white with gold.
    161: 9. **Float pack.** Take: a winged pack on the block, blades longer than the torso, that changes
    162:    the back silhouette and not the front. Adapt: make it the required space kit for the light
    163:    class, with the blades doubling as radiators. Avoid: the two-blade red Britannian unit and
    164:    Albion's energy wings.
    165: 10. **Grunt vs lead.** Take: same skeleton, grunts boxier and waistier with the mechanics
    166:     exposed, leads smoother with a longer shin. Adapt: this is the faction grunt rule for the
    167:     light class. Avoid: nothing here, the rule is generic.
    168: 
    169: ## Next to an 18 m mobile suit
    170: 
    171: No official crossover art puts a knightmare beside a Gundam at scale. Super Robot Wars sprites
    172: are not to scale. The composed chart on the board (`zz-scale-chart-composed.jpg`) uses the
    173: official heights.
    174: 
    175: - A 4.4 m Sutherland reaches an 18 m Gundam's knee. A 7.2 m Galahad reaches its thigh. A 6 m
    176:   frame reaches the knee cap, a 9 m frame the crotch.
    177: - Weight scales worse than height. Knightmares are 7 t against a mobile suit's 50 to 60 t. A 6 m
    178:   knightmare-built frame would be about 15 t, a 9 m one about 30 t.
    179: - Cockpit block sizing fixes a floor. The block must hold a seated pilot and screens, about 1.0 m
    180:   by 1.3 m by 1.0 m. That is 0.25 of height on a 4.4 m frame and 0.17 on a 6 m frame. At 9 m
    181:   it is 0.11 of height and no longer dominates the back: the trait that sizes.md calls out is
    182:   gone, or the block has to be padded with equipment to keep its visual size.
    183: - Harkens and spinners scale with the frame, so they keep their proportions at any size. The
    184:   pilot does not, so the human-scale cues (hatch, seat, ladder rungs) are the only size tell.
    185: 
    186: ### 6 m or 9 m
    187: 
    188: Recommend 6 m. Reasons:
    189: 
    190: - 6 m is already a Gawain-class knightmare. Pushing to 9 m makes the light frame half a striker
    191:   and the block, the main light-class trait, stops dominating the silhouette.
    192: - The 1/3 ratio (6 of 17.6) is a different kind of fight, which is the point of the class. 9 m is
    193:   half size, which reads as a small striker, not a different animal.
    194: - Two 6 m frames fit a 12 m bay side by side with a metre to spare. Two 9 m frames do not.
    195: - The hit radius and the camera already set 18 m as the mid-scale. At 6 m a light frame can use
    196:   hull geometry (gantries, doors, pipes) as cover and anchor points. At 9 m it mostly cannot.
    197: 
    198: If 6 m turns out too small on screen, raise the block and crest, not the frame: a knightmare's
    199: visual height is its block top, which is 0.95 to 1.0 of its height.
    200: 
    201: ## Open points for the light designer
    202: 
    203: - Rest pose: how far forward the torso leans. The references lean 10 to 15 degrees.
    204: - Whether the harkens sit on the block or the chest. On the block they move with the ejectable
    205:   module, which is a nice story but means the chest reads plain from the front.
    206: - Spinner wheel size at 6 m: 0.12 of height is 0.7 m, larger than a car wheel, which looks right
    207:   on hull surfaces.
  • read_file{"Path":"~/work/sortie/tools/shoot.mjs"}

    input

    {
      "Path": "~/work/sortie/tools/shoot.mjs"
    }

    result, 49 lines

    Showing lines 1-48 of 48
    1: // Screenshots of the running dev server for review.
    2: //   node tools/shoot.mjs out/dir name=/?view=striker name2=/?view=ship ...
    3: // Waits for window.__ready, then a few frames. Needs `npm run dev` on :5199.
    4: // SORTIE_GPU=1 uses the GPU (see below).
    5: import { chromium } from 'playwright';
    6: import { mkdirSync } from 'node:fs';
    7: import { join } from 'node:path';
    8: 
    9: const [out, ...shots] = process.argv.slice(2);
    10: const base = process.env.SORTIE_URL ?? 'http://localhost:5199';
    11: const W = Number(process.env.W ?? 1280), H = Number(process.env.H ?? 720);
    12: mkdirSync(out, { recursive: true });
    13: // SORTIE_GPU=1 renders on the GPU through a headed window on the WSLg display. WSLg ignores the
    14: // off-screen position, so the window shows on that machine's Windows desktop: on the workstation only
    15: // when nobody minds, on C1 (tools/c1-render.sh with C1_GPU=1) it shows on C1's own display.
    16: // Headless Chromium only gets SwiftShader, which is slow and loads the CPU.
    17: const gpu = process.env.SORTIE_GPU === '1';
    18: const browser = await chromium.launch(gpu
    19:   ? { headless: false, args: ['--use-angle=gl', '--ignore-gpu-blocklist', '--window-position=-4000,0'],
    20:       env: { ...process.env, DISPLAY: ':0', WAYLAND_DISPLAY: 'wayland-0', XDG_RUNTIME_DIR: '/mnt/wslg/runtime-dir',
    21:       // Mesa may fall back to llvmpipe unless told to use its D3D12 driver (C1's Radeon needs this)
    22:       GALLIUM_DRIVER: 'd3d12', LD_LIBRARY_PATH: '/usr/lib/wsl/lib' } }
    23:   : { args: ['--use-angle=swiftshader', '--enable-unsafe-swiftshader', '--ignore-gpu-blocklist'] });
    24: const page = await browser.newPage({ viewport: { width: W, height: H } });
    25: // SHOOT_TIMEOUT (ms) for page loads and screenshots: software rendering under load needs more than the default
    26: page.setDefaultTimeout(Number(process.env.SHOOT_TIMEOUT ?? 30000));
    27: let failed = 0;
    28: page.on('console', (m) => { if (m.type() === 'error' || m.type() === 'warning') console.log(`[${m.type()}]`, m.text().slice(0, 300)); });
    29: page.on('pageerror', (e) => console.log('[pageerror]', e.message));
    30: for (const s of shots) {
    31:   const i = s.indexOf('=');
    32:   const name = s.slice(0, i), url = s.slice(i + 1);
    33:   const t = Date.now();
    34:   // one slow or broken shot is reported and skipped, the rest of the batch still runs
    35:   try {
    36:     await page.goto(base + url);
    37:     await page.waitForFunction(() => window.__ready === true, null, { timeout: 300000 });
    38:     const frames = Number(new URL(base + url).searchParams.get('frames') ?? 1);
    39:     await page.evaluate((n) => new Promise((r) => { let k = 0; const f = () => (++k >= n ? r() : requestAnimationFrame(f)); requestAnimationFrame(f); }), frames);
    40:     await page.screenshot({ path: join(out, `${name}.png`) });
    41:     console.log(`${name}: ${Date.now() - t} ms`);
    42:   } catch (e) {
    43:     failed++;
    44:     console.log(`${name}: FAILED ${e.message.split('\n')[0]}`);
    45:   }
    46: }
    47: await browser.close();
    48: process.exitCode = failed ? 1 : 0;
  • read_file{"Path":"~/work/sortie/kit/lab/assembly.py"}

    input

    {
      "Path": "~/work/sortie/kit/lab/assembly.py"
    }

    result, 210 lines

    Showing lines 1-209 of 209
    1: """Fit lab variants onto the full striker frame: its head, chest armour and feet are removed and
    2: variants built onto the same joints. This is part swapping, the way the game will do it."""
    3: import re
    4: 
    5: import bpy
    6: from mathutils import Matrix, Vector
    7: 
    8: import backkit
    9: import bodykit
    10: import chestkit
    11: import headkit
    12: from lib import attach, empty
    13: from mech import build_striker
    14: 
    15: # striker parts replaced by a chest variant (base names; Blender may add .001 suffixes)
    16: CHEST_PARTS = {"chest_plate.L", "chest_plate.R", "chest_strip.L", "chest_strip.R", "rib_plate0.L", "rib_plate0.R", "rib_plate1.L",
    17:                "rib_plate1.R", "side_plate.L", "side_plate.R", "belly", "belly_vent", "lens_socket", "lens", "lens_core", "hatch",
    18:                "collar.L", "collar.R", "collar_side.L", "collar_side.R", "collar_vent.L", "collar_vent.R", "back_plate", "neck_guard"}
    19: 
    20: 
    21: def base(name):
    22:     return re.sub(r"\.\d{3}$", "", name)
    23: 
    24: 
    25: def joint(frame, name):
    26:     for o in frame.children_recursive:
    27:         if o.type == "EMPTY" and base(o.name) == name:
    28:             return o
    29:     raise KeyError(name)
    30: 
    31: 
    32: def remove(objs):
    33:     for o in objs:
    34:         bpy.data.objects.remove(o, do_unlink=True)
    35: 
    36: 
    37: def fit(build, at, parent):
    38:     """Build a variant into a temporary empty at `at`, then hand its parts to a frame joint."""
    39:     tmp = empty("_fit", at)
    40:     build(tmp)
    41:     for ob in list(tmp.children):
    42:         ob.matrix_parent_inverse = Matrix.Identity(4)
    43:         ob.location = (0, 0, 0)
    44:     bpy.context.view_layer.update()
    45:     for ob in list(tmp.children):
    46:         attach(ob, parent)
    47:     bpy.data.objects.remove(tmp, do_unlink=True)
    48: 
    49: 
    50: def assemble(head_parts, chest, foot, n, extras=(), fold=0.0):
    51:     frame = build_striker()
    52:     bpy.context.view_layer.update()
    53:     head_j, torso_j = joint(frame, "head"), joint(frame, "torso")
    54:     remove([o for o in head_j.children_recursive if o.type == "MESH"])
    55:     remove([o for o in torso_j.children if o.type == "MESH" and base(o.name) in CHEST_PARTS])
    56:     for s in ("L", "R"):
    57:         remove([o for o in joint(frame, f"foot.{s}").children_recursive if o.type == "MESH" and base(o.name) != f"ankle.{s}"])
    58:     bodykit.CONTEXT = False
    59:     try:
    60:         fit(lambda r: headkit.head_gen4(r, f"{n}h", head_parts, extras, fold), (0, -.05, 15.55), head_j)
    61:         fit(lambda r: chest(r, f"{n}c"), (0, 0, 11.9), torso_j)
    62:         for s, sx in (("L", 1), ("R", -1)):
    63:             fit(lambda r, s=s: foot(r, f"{n}f{s}"), (1.2 * sx, .1, .15), joint(frame, f"foot.{s}"))
    64:     finally:
    65:         bodykit.CONTEXT = True
    66:     return frame
    67: 
    68: 
    69: H = dict(headkit.GEN4)
    70: COMBOS = [
    71:     ("A", "Mantle IV", lambda r, n: bodykit.chest_hatch3(r, n, diamond=True), bodykit.foot_claw3),
    72:     ("B", "Duelist IV", bodykit.chest_swept3, bodykit.foot_raptor),
    73:     ("C", "Sentinel IV", bodykit.chest_cuirass3, bodykit.foot_sabaton2),
    74:     ("D", "Warden IV", bodykit.chest_hatch3, bodykit.foot_talon),
    75:     ("E", "Tracker IV", bodykit.chest_swept3, bodykit.foot_skid),
    76:     ("F", "Lancer IV", bodykit.chest_cuirass3, bodykit.foot_boot2),
    77: ]
    78: 
    79: 
    80: def build_assembly_lab():
    81:     root = empty("lab", (0, 0, 0))
    82:     for i, (tag, head, chest, foot) in enumerate(COMBOS):
    83:         frame = assemble(H[head], chest, foot, f"a{i}")
    84:         slot = empty(f"slot{i}", (i * 11.0, 0, 0), root, label=f"{tag}: {head}")
    85:         attach(frame, slot)
    86:         frame.matrix_parent_inverse = Matrix.Identity(4)
    87:         frame.location = (0, 0, 0)
    88:         bpy.context.view_layer.update()
    89:     return root
    90: 
    91: 
    92: # striker shoulder-shell parts replaced by a shoulder variant (block, trunnion and forks stay)
    93: SHOULDER_PARTS = {"shell0", "shell1", "shell_under", "shell_blade", "shell_edge", "shell_fin"}
    94: 
    95: 
    96: def move(j, at):
    97:     j.location = j.parent.matrix_world.inverted() @ Vector(at)
    98:     bpy.context.view_layer.update()
    99: 
    100: 
    101: def refit_back(frame, pack, shoulder, n):
    102:     """Swap a frame's backpack and shoulder shells. Variants build into roots at the origin in world
    103:     coordinates; the binder joints move to the pack's hinge before the parts are handed over."""
    104:     pack_j = joint(frame, "backpack")
    105:     J = {"P": pack_j, "L": joint(frame, "binder.L"), "R": joint(frame, "binder.R"),
    106:          "SL": joint(frame, "shoulder.L"), "SR": joint(frame, "shoulder.R")}
    107:     remove([o for o in pack_j.children_recursive if o.type == "MESH" or base(o.name).startswith("nozzle")])
    108:     for k in ("SL", "SR"):
    109:         remove([o for o in J[k].children if o.type == "MESH" and base(o.name).rsplit(".", 1)[0] in SHOULDER_PARTS])
    110:     roots = {k: empty(f"_{k}") for k in J}
    111:     x, y, z = pack(roots, f"{n}p")
    112:     move(J["L"], (x, y, z))
    113:     move(J["R"], (-x, y, z))
    114:     shoulder(roots, f"{n}s")
    115:     for k, root in roots.items():
    116:         for ob in list(root.children):
    117:             attach(ob, J[k])
    118:         bpy.data.objects.remove(root, do_unlink=True)
    119: 
    120: 
    121: def assemble_back(pack, shoulder, n):
    122:     """Frame A with a backpack and shoulder variant."""
    123:     frame = assemble(H["Mantle IV"], COMBOS[0][2], bodykit.foot_claw3, n)
    124:     if pack is not None:
    125:         refit_back(frame, pack, shoulder, n)
    126:     return frame
    127: 
    128: 
    129: def build_back_lab():
    130:     root = empty("lab", (0, 0, 0))
    131:     combos = [("now", "current pack and shoulders", None, None)] + [
    132:         (chr(65 + i), f"{p} + {s}", pf, sf) for i, ((p, pf), (s, sf)) in enumerate(zip(backkit.PACKS, backkit.SHOULDERS))]
    133:     for i, (tag, label, pack, shoulder) in enumerate(combos):
    134:         frame = assemble_back(pack, shoulder, f"b{i}")
    135:         slot = empty(f"slot{i}", (i * 11.0, 0, 0), root, label=f"{tag}: {label}")
    136:         attach(frame, slot)
    137:         frame.matrix_parent_inverse = Matrix.Identity(4)
    138:         frame.location = (0, 0, 0)
    139:         bpy.context.view_layer.update()
    140:     return root
    141: 
    142: 
    143: def build_chest_frames():
    144:     """Round 14: each new chest with one of the angled heads, on the wing pack and swept shoulders."""
    145:     root = empty("lab", (0, 0, 0))
    146:     for i, ((chest, cf), (head, parts, extras, fold)) in enumerate(zip(chestkit.CHESTS4, headkit.GEN5)):
    147:         frame = assemble(parts, cf, bodykit.foot_claw3, f"c{i}", extras, fold)
    148:         refit_back(frame, backkit.pack_wings, backkit.shoulder_swept, f"c{i}")
    149:         slot = empty(f"slot{i}", (i * 11.0, 0, 0), root, label=f"{chr(65 + i)}: {chest} chest, {head}")
    150:         attach(frame, slot)
    151:         frame.matrix_parent_inverse = Matrix.Identity(4)
    152:         frame.location = (0, 0, 0)
    153:         bpy.context.view_layer.update()
    154:     return root
    155: 
    156: 
    157: SHOW = [("A", "Mantle V", "Hatch IV", "Wings", "Swept", "Claw II"),
    158:         ("B", "Duelist V", "Prow", "Sunk drive", "Thruster", "Raptor"),
    159:         ("C", "Warden V", "Layered", "Fairing", "Shield", "Sabaton II"),
    160:         ("D", "Surveyor V", "Intakes", "Keel", "Sode", "Skid"),
    161:         ("E", "Sentinel V", "Gorget", "Rack", "Round", "Boot II"),
    162:         ("F", "Lancer V", "Frame", "Saddle", "Open frame", "Talon"),
    163:         ("G", "Tracker V", "Intakes", "Saddle", "Swept", "Talon")]
    164: 
    165: 
    166: def show_frame(i, n=None):
    167:     """One SHOW mix as a game model: frame A is SHOW[0]. The root is tagged striker_a, striker_b..."""
    168:     tag, head, chest, pack, shoulder, foot = SHOW[i]
    169:     parts, extras, fold = {h[0]: h[1:] for h in headkit.GEN5}[head]
    170:     n = n or f"f{tag.lower()}"
    171:     frame = assemble(parts, dict(chestkit.CHESTS4)[chest], dict(bodykit.FEET3)[foot], n, extras, fold)
    172:     refit_back(frame, dict(backkit.PACKS)[pack], dict(backkit.SHOULDERS)[shoulder], n)
    173:     frame["frame"] = f"striker_{tag.lower()}"
    174:     return frame
    175: 
    176: 
    177: def game_frame(i):
    178:     """A SHOW mix built alone as a game model (striker_a, striker_b): every node keeps its exact name."""
    179:     frame = show_frame(i)
    180:     # a pack's binder bells are named like the binder joints and come out binder.L.001: name them as
    181:     # the striker does, so a game model has no suffixed node
    182:     for o in frame.children_recursive:
    183:         if o.type == "MESH" and base(o.name) != o.name:
    184:             stem, side = base(o.name).rsplit(".", 1)
    185:             o.name = f"{stem}_nozzle.{side}"
    186:     assert not [o.name for o in frame.children_recursive if base(o.name) != o.name]
    187:     return frame
    188: 
    189: 
    190: def build_show(formation=False):
    191:     """Round 15: the round 13 and 14 parts mixed into seven frames. In a row 13 m apart, or in a V
    192:     behind frame A with the outer frames turned in a little."""
    193:     heads = {h[0]: h[1:] for h in headkit.GEN5}
    194:     chests, packs, shoulders, feet = (dict(x) for x in (chestkit.CHESTS4, backkit.PACKS, backkit.SHOULDERS, bodykit.FEET3))
    195:     root = empty("lab", (0, 0, 0))
    196:     for i, (tag, head, chest, pack, shoulder, foot) in enumerate(SHOW):
    197:         parts, extras, fold = heads[head]
    198:         frame = assemble(parts, chests[chest], feet[foot], f"s{i}", extras, fold)
    199:         refit_back(frame, packs[pack], shoulders[shoulder], f"s{i}")
    200:         side, rank = (1 if i % 2 else -1), (i + 1) // 2
    201:         at = (9.0 * side * rank, 6.0 * rank, 0) if formation else (i * 13.0, 0, 0)
    202:         slot = empty(f"slot{i}", at, root, label=f"{tag}: {head}, {chest}, {pack}, {shoulder}, {foot}")
    203:         attach(frame, slot)
    204:         frame.matrix_parent_inverse = Matrix.Identity(4)
    205:         frame.location = (0, 0, 0)
    206:         if formation:
    207:             slot.rotation_euler.z = -.17 * side * min(rank, 1)
    208:         bpy.context.view_layer.update()
    209:     return root
  • read_file{"Path":"~/work/sortie/src/render/pipeline.ts"}

    input

    {
      "Path": "~/work/sortie/src/render/pipeline.ts"
    }

    result, 259 lines

    Showing lines 1-258 of 258
    1: import * as THREE from 'three';
    2: import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js';
    3: import { GTAOPass } from 'three/addons/postprocessing/GTAOPass.js';
    4: import { OutputPass } from 'three/addons/postprocessing/OutputPass.js';
    5: import { Pass } from 'three/addons/postprocessing/Pass.js';
    6: import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js';
    7: import { UnrealBloomPass } from 'three/addons/postprocessing/UnrealBloomPass.js';
    8: import { DetailShader, GradeShader, look, type Look } from './look';
    9: 
    10: /** Meshes on this layer get surface detail (edge wear, grime, ink); glows, effects and sky stay off it. */
    11: export const DETAIL_LAYER = 1;
    12: 
    13: /**
    14:  * Rendering tiers. high: everything. medium: no multisampling, a smaller shadow map. low, for weak
    15:  * or software rendering: no multisampling, no shadows, no surface detail, bloom or grain, and at most
    16:  * 0.6 resolution. Multisampling the half-float buffers is by far the dearest part on a weak GPU.
    17:  */
    18: export type Tier = 'high' | 'medium' | 'low';
    19: export const TIERS: readonly Tier[] = ['high', 'medium', 'low'];
    20: 
    21: export interface Quality {
    22:   /** Render resolution relative to CSS pixels (1 ignores high-DPI scaling). */
    23:   scale: number;
    24:   ao: boolean;
    25:   shadows: boolean;
    26:   tier: Tier;
    27: }
    28: 
    29: export const DEFAULT_QUALITY: Quality = { scale: 1, ao: false, shadows: true, tier: 'high' };
    30: /** The low tier's resolution cap. */
    31: const LOW_SCALE = 0.6;
    32: 
    33: /** Clamp before the bloom: one infinite or NaN pixel would otherwise blur over the whole frame. */
    34: const Sanitize = {
    35:   uniforms: { tDiffuse: { value: null } },
    36:   vertexShader: 'varying vec2 vUv; void main() { vUv = uv; gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }',
    37:   fragmentShader: `
    38:     uniform sampler2D tDiffuse; varying vec2 vUv;
    39:     void main() {
    40:       vec4 c = texture2D(tDiffuse, vUv);
    41:       if (any(isnan(c)) || any(isinf(c))) c = vec4(0.0, 0.0, 0.0, 1.0);
    42:       gl_FragColor = vec4(min(c.rgb, vec3(48.0)), c.a);
    43:     }`,
    44: };
    45: 
    46: /**
    47:  * Frame order: the backdrop at infinity (stars, nebula, planet), the world, ambient occlusion on the
    48:  * world, then the cockpit in its own pass (it sits centimetres from the eye, the world runs to tens
    49:  * of kilometres, so they don't share a depth range), then bloom and filmic tone mapping.
    50:  */
    51: class ScenePass extends Pass {
    52:   private bc = new THREE.PerspectiveCamera(60, 1, 1, 1e7);
    53: 
    54:   constructor(
    55:     public scene: THREE.Scene,
    56:     public camera: THREE.PerspectiveCamera,
    57:     public backdrop: THREE.Scene | null,
    58:     private clearFirst: boolean,
    59:   ) {
    60:     super();
    61:     this.needsSwap = false;
    62:   }
    63: 
    64:   render(renderer: THREE.WebGLRenderer, _write: THREE.WebGLRenderTarget, read: THREE.WebGLRenderTarget) {
    65:     renderer.setRenderTarget(read);
    66:     if (this.clearFirst) {
    67:       renderer.setClearColor(0x000000, 1);
    68:       renderer.clear();
    69:     } else renderer.clearDepth();
    70:     if (this.backdrop) {
    71:       const bc = this.bc;
    72:       bc.fov = this.camera.fov;
    73:       bc.aspect = this.camera.aspect;
    74:       bc.updateProjectionMatrix();
    75:       this.camera.getWorldQuaternion(bc.quaternion);
    76:       bc.updateMatrixWorld();
    77:       renderer.render(this.backdrop, bc);
    78:       renderer.clearDepth();
    79:     }
    80:     renderer.render(this.scene, this.camera);
    81:   }
    82: }
    83: 
    84: /** Size the composer's buffers for `w` x `h` CSS pixels at the renderer's pixel ratio. The composer
    85:  *  keeps its own copy of the ratio from construction, so a tier change has to hand it the new one. */
    86: export function fitComposer(composer: Pick<EffectComposer, 'setPixelRatio' | 'setSize'>, w: number, h: number, pr: number) {
    87:   composer.setPixelRatio(pr);
    88:   composer.setSize(w, h);
    89: }
    90: 
    91: export class Pipeline {
    92:   readonly renderer: THREE.WebGLRenderer;
    93:   readonly composer: EffectComposer;
    94:   readonly bloom: UnrealBloomPass;
    95:   readonly ao: GTAOPass;
    96:   private detail: ShaderPass;
    97:   private grade: ShaderPass;
    98:   private sanitize: ShaderPass;
    99:   /** The look's own choice for the detail pass, before the tier. */
    100:   private detailWanted = true;
    101:   private sun: THREE.DirectionalLight | null = null;
    102:   private normals: THREE.WebGLRenderTarget;
    103:   private normalMat = new THREE.MeshNormalMaterial();
    104:   private world: ScenePass;
    105:   private overlay: ScenePass | null = null;
    106: 
    107:   quality: Quality;
    108: 
    109:   constructor(canvas: HTMLCanvasElement, world: THREE.Scene, camera: THREE.PerspectiveCamera, backdrop: THREE.Scene | null,
    110:     quality: Quality = DEFAULT_QUALITY) {
    111:     this.quality = { ...quality };
    112:     const renderer = new THREE.WebGLRenderer({ canvas, antialias: false, powerPreference: 'high-performance' });
    113:     renderer.setPixelRatio(this.quality.scale);
    114:     renderer.toneMapping = THREE.AgXToneMapping;
    115:     renderer.toneMappingExposure = 1.15;
    116:     renderer.shadowMap.enabled = true;
    117:     renderer.shadowMap.type = THREE.PCFShadowMap;
    118:     renderer.autoClear = false;
    119:     this.renderer = renderer;
    120: 
    121:     const target = new THREE.WebGLRenderTarget(1, 1, { type: THREE.HalfFloatType, samples: 4 });
    122:     this.composer = new EffectComposer(renderer, target);
    123:     this.world = new ScenePass(world, camera, backdrop, true);
    124:     this.composer.addPass(this.world);
    125:     this.ao = new GTAOPass(world, camera, 1, 1);
    126:     this.ao.blendIntensity = 0.9;
    127:     this.ao.updateGtaoMaterial({ radius: 1.6, distanceExponent: 1.4, thickness: 2, scale: 1.2, samples: 8 });
    128:     this.composer.addPass(this.ao);
    129:     this.normals = new THREE.WebGLRenderTarget(1, 1, { type: THREE.HalfFloatType });
    130:     this.normals.depthTexture = new THREE.DepthTexture(1, 1, THREE.FloatType);
    131:     this.detail = new ShaderPass(DetailShader);
    132:     this.detail.uniforms.tNormal.value = this.normals.texture;
    133:     this.detail.uniforms.tDepth.value = this.normals.depthTexture;
    134:     this.composer.addPass(this.detail);
    135:     this.sanitize = new ShaderPass(Sanitize);
    136:     this.composer.addPass(this.sanitize);
    137:     this.bloom = new UnrealBloomPass(new THREE.Vector2(256, 256), 0.32, 0.22, 1.6);
    138:     this.composer.addPass(this.bloom);
    139:     this.composer.addPass(new OutputPass());
    140:     this.grade = new ShaderPass(GradeShader);
    141:     this.composer.addPass(this.grade);
    142:     this.applyLook(look());
    143:     this.setQuality({});
    144:   }
    145: 
    146:   /** The GPU the browser gave us, and whether it's a software rasteriser (very slow). */
    147:   gpu(): { name: string; software: boolean } {
    148:     const gl = this.renderer.getContext();
    149:     const ext = gl.getExtension('WEBGL_debug_renderer_info');
    150:     const name = String(ext ? gl.getParameter(ext.UNMASKED_RENDERER_WEBGL) : gl.getParameter(gl.RENDERER));
    151:     return { name, software: /swiftshader|llvmpipe|softpipe|software|basic render/i.test(name) };
    152:   }
    153: 
    154:   setQuality(q: Partial<Quality>) {
    155:     Object.assign(this.quality, q);
    156:     const { tier } = this.quality;
    157:     const low = tier === 'low';
    158:     this.renderer.setPixelRatio(low ? Math.min(LOW_SCALE, this.quality.scale) : this.quality.scale);
    159:     this.ao.enabled = this.quality.ao && !low;
    160:     this.renderer.shadowMap.enabled = this.quality.shadows && !low;
    161:     const samples = tier === 'high' ? 4 : 0;
    162:     for (const t of [this.composer.renderTarget1, this.composer.renderTarget2]) {
    163:       if (t.samples === samples) continue;
    164:       t.samples = samples;
    165:       t.dispose();
    166:     }
    167:     this.detail.enabled = this.detailWanted && !low;
    168:     this.bloom.enabled = this.sanitize.enabled = this.grade.enabled = !low;
    169:     this.shadowSize();
    170:     this.resize();
    171:   }
    172: 
    173:   /** The sun whose shadow map follows the tier. */
    174:   set shadowLight(sun: THREE.DirectionalLight) {
    175:     this.sun = sun;
    176:     this.shadowSize();
    177:   }
    178: 
    179:   private shadowSize() {
    180:     const s = this.quality.tier === 'high' ? 2048 : 1024;
    181:     const sh = this.sun?.shadow;
    182:     if (!sh || sh.mapSize.x === s) return;
    183:     sh.mapSize.set(s, s);
    184:     sh.map?.dispose();
    185:     sh.map = null;
    186:   }
    187: 
    188:   applyLook(l: Look) {
    189:     const u = this.detail.uniforms;
    190:     u.ridgeK.value = l.ridge;
    191:     u.valleyK.value = l.valley;
    192:     u.inkK.value = l.ink;
    193:     u.chipped.value = l.chipped ? 1 : 0;
    194:     u.hatch.value = l.hatch ?? 0;
    195:     this.grade.uniforms.paper.value = l.paper ?? 0;
    196:     this.detailWanted = l.ridge + l.valley + l.ink > 0;
    197:     this.detail.enabled = this.detailWanted && this.quality?.tier !== 'low';
    198:     this.grade.uniforms.grain.value = l.grain;
    199:     this.grade.uniforms.vignette.value = l.vignette;
    200:   }
    201: 
    202:   /** A scene drawn over the world with its own depth range (the cockpit), after the world's detail pass. */
    203:   setOverlay(scene: THREE.Scene, camera: THREE.PerspectiveCamera) {
    204:     this.overlay = new ScenePass(scene, camera, null, false);
    205:     this.composer.insertPass(this.overlay, this.composer.passes.indexOf(this.detail) + 1);
    206:     this.resize();
    207:   }
    208: 
    209:   set backdrop(scene: THREE.Scene | null) {
    210:     this.world.backdrop = scene;
    211:   }
    212: 
    213:   set overlayVisible(v: boolean) {
    214:     if (this.overlay) this.overlay.enabled = v;
    215:   }
    216: 
    217:   get camera() {
    218:     return this.world.camera;
    219:   }
    220: 
    221:   resize(w = window.innerWidth, h = window.innerHeight) {
    222:     this.renderer.setSize(w, h, false);
    223:     const pr = this.renderer.getPixelRatio();
    224:     fitComposer(this.composer, w, h, pr);
    225:     this.normals?.setSize(Math.round(w * pr), Math.round(h * pr));
    226:     this.detail?.uniforms.px.value.set(1 / (w * pr), 1 / (h * pr));
    227:     for (const c of [this.world.camera, this.overlay?.camera]) {
    228:       if (!c) continue;
    229:       c.aspect = w / h;
    230:       c.updateProjectionMatrix();
    231:     }
    232:   }
    233: 
    234:   render() {
    235:     if (this.detail.enabled) {
    236:       // normals and depth of detailed meshes only, for the detail pass
    237:       const { renderer } = this;
    238:       const scene = this.world.scene, camera = this.world.camera;
    239:       camera.layers.set(DETAIL_LAYER);
    240:       const bg = scene.background;
    241:       scene.background = null;
    242:       scene.overrideMaterial = this.normalMat;
    243:       renderer.setRenderTarget(this.normals);
    244:       renderer.setClearColor(0x000000, 0);
    245:       renderer.clear();
    246:       renderer.render(scene, camera);
    247:       scene.overrideMaterial = null;
    248:       scene.background = bg;
    249:       camera.layers.set(0);
    250:       this.detail.uniforms.near.value = camera.near;
    251:       this.detail.uniforms.far.value = camera.far;
    252:       this.detail.uniforms.projInv.value.copy(camera.projectionMatrixInverse);
    253:       this.detail.uniforms.viewInv.value.copy(camera.matrixWorld);
    254:     }
    255:     this.grade.uniforms.time.value = (performance.now() % 10000) / 1000;
    256:     this.composer.render();
    257:   }
    258: }

agent

+2:17
reasoning

The code snippet in pipeline.ts sets the camera layer to DETAIL_LAYER and then overrides the material. This might be a clue. Also in the same file there's this material call: this.normalMat;. Maybe normalMat isn't initialized correctly or is the wrong material type? Need to investigate the material type and initialization and the layer setting.

MeshNormalMaterial in Three.js renders vertex normals, likely the source of the issue. The Blender Python script applies a 1-segment bevel for non-smooth plates, creating flat-shaded faces and a sharp 45-degree chamfer. This chamfer's edge effect might be influencing the rendering. The DetailShader seems to be designed to detect these sharp edges.

The critical insight is the bevel's impact on the DetailShader. A 1-segment bevel creates 45-degree edges. The shader's smoothstep function is designed to detect sharp edges based on the angle between face normals. The dot product of the normals from the 45 degree faces evaluates to 0.7071. This leads to a turn value of 0.2929, resulting in a zero ink lining for beveled corners unless a depth jump exists. The field look's curvature calculation will potentially fire for the beveled edges.

  • run_command{"CommandLine":"git -C ~/work/sortie log -n 20 --oneline && ~/.local/bin/blender --version | head -n 3 && ffmpeg -version | head -n 2 && nproc && free -h","WaitMsBeforeAsync":5000,"toolSummary":"Check git log, blender, ffmpeg, CPU and RAM"}

    input

    {
      "CommandLine": "git -C ~/work/sortie log -n 20 --oneline && ~/.local/bin/blender --version | head -n 3 && ffmpeg -version | head -n 2 && nproc && free -h",
      "WaitMsBeforeAsync": 5000,
      "toolSummary": "Check git log, blender, ffmpeg, CPU and RAM"
    }

    result, 32 lines

    Command exited with code 0.
    
    Command output:
    c257287 (HEAD -> carbon, main) Merge the handbook and first-session tools
    b4a8486 Add the handbook, housekeeping notes and first-session tools
    2ba9dc7 Merge the atelier house lines, joint covers and grades
    731f6e0 Make the atelier four house lines in three grades, with joint covers
    7c98ce2 Merge the atelier grade study: plates step up by grade
    fc698b9 Step the C grades up by plate count, not only bulk
    7b2cd85 Merge the atelier direction board
    f7276b1 Add the atelier direction board: four directions and grades in C
    8bac90c Merge the houses' atelier maker, first pass
    7402e6e Add the houses' atelier maker and its lab
    6310a47 Merge the wider assault boost plume
    29ed4a4 Make the assault boost a wider, heavier burn
    7f37c55 Merge the common pattern colour blocking and shape pass
    f4ef135 Colour block the common pattern and fix its weak points
    c204cb0 Merge the proportion study and common pattern retune
    814be8d Add the line mech proportion study
    1bd6402 Refine the common pattern after the proportion critique
    6f970b8 Retune the common pattern to line mech proportions
    2b6b31b Merge volumetric thruster plumes and the thruster bench
    3d9b80c Rework quick and assault boost plumes after review, add the findings note
    Blender 5.2.3 LTS
    	build date: 2026-10-22
    	build time: 01:35:05
    ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers
    built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)
    10
                   total        used        free      shared  buff/cache   available
    Mem:            49Gi        17Gi       5.4Gi       102Mi        26Gi        31Gi
    Swap:          8.0Gi       201Mi       7.8Gi