Hangar Valley
DevlogTech · 2 of 3

Clothes cut from real patterns

Henk the mechanic, a bald older man, in a blue button-up shirt, dark trousers and brown ankle boots, standing in an A-pose on a light grey background.Henk, dressed layer by layer
A T-shirt sewing pattern on a 5 cm grid: front, back and sleeve pieces with grain arrows, and the body measures underneath.The T-shirt pattern, drafted from the body's measures

The people of the valley need clothes, and I did not want clothes that are sculpted as one stiff shell. So a garment here is made the way a tailor makes it: measure, draft a pattern, cut, sew, press.

This is part two of three behind-the-scenes devlogs. Part one was about running the game inside Blender.


Seven steps, like a tailor

  1. Measure. Bust, waist, hip, shoulder, neck and lengths come from the character's own body, never from a fixed size.
  2. Draft. Flat pattern pieces in centimetres. Darts are not cut out but closed in the cloth's rest shape, so the flat piece wants to take the body's curve.
  3. Cut. Each piece becomes a mesh of 0.75 cm cells, with an even ring of points along the outline so the edge is smooth.
  4. Pre-sew. The pieces are laid round the body, and the seams are pulled shut in 1,500 quick rounds before the real simulation starts.
  5. Sew. A cloth simulation lets it all fall and settle on the body.
  6. Press. Seams are welded, small holes filled, the seam line straightened and the cloth beside it smoothed, as an iron would.
  7. Finish. Stitches, buttons and zips go on.

The first garments were made in Blender: Python builds the pattern and the mesh, Blender's cloth simulation sews, and Cycles renders the result. Every try is kept, so you can see how it went.

Try 1, try 21

A coral T-shirt on a grey mannequin, crumpled up round the chest with twisted sleeves.T-shirt, try 1: crumpled and twisted
The same coral T-shirt on the grey mannequin, now whole, with short sleeves and a round neck, hanging naturally.T-shirt, try 21
A grey sleeveless dress on a grey mannequin, puckered and lumpy over the chest.Dress, try 5: puckered
A grey sleeveless knee-length dress on the grey mannequin, hanging smoothly.Dress, try 23

What went wrong, and what fixed it

Four close-ups of the same coral armhole seam: in the first ones the seam line is jagged like a saw, in the last one it runs smooth.
The saw-tooth armhole, and the smooth one

Stitches, buttons and zips

Close-up of a teal knit shirt at the armhole: a double row of topstitching follows the seam, and the fabric shows a fine knit rib.
Topstitching round an armhole
Three close-ups side by side: a brass zip with its slider on dark tape beside stitched seams, a white shirt placket with buttons and buttonholes, and plied cream thread stitched across a blue denim weave.
Zip, buttons and thread
A grid of fabric swatches with stitched seams: white, grey, blue, beige, orange and red cloths, a gingham check and a houndstooth.
A swatch book: poplin, denim, gingham, satin, leather and more

From Blender to my own solver

Blender's cloth simulation is good, but slow for trying things: one T-shirt took minutes, and six simulations at once filled the Mac's memory until it had to be force-quit. So I wrote a cloth solver of my own that runs on the graphics card (Rust and wgpu, position-based, 60 small steps per frame, with the body as a 2 mm distance field). It sews a T-shirt in about 5 seconds on an old GTX 1080.

A live sewing tool: on the left the pattern pieces of a T-shirt with coloured seam lines between them and sliders for length, width, sleeve length and neck depth; on the right a white T-shirt being simulated on a test figure.
The live sewing table: drag a slider, the cloth settles in seconds

Dressing the men of chapter 1

Henk, the old mechanic from chapter 1, is the first to be dressed this way: trousers, a shirt and ankle boots, sewn on his own body. A work jacket over the shirt is what I am fighting with now.

Henk in a grey work jacket over a blue shirt: the jacket's panels and collar stick out wide like wings, unsewn.The work jacket: seams too far apart to sew
Henk in a grey hoodie over a blue shirt, with blue patches of the shirt showing through the hoodie.A hoodie, with the shirt poking through

The jacket's cause is found: its front and back started 507 mm apart, just over the 500 mm the pre-sewing allows, so its side seams were never sewn. With that fixed the body of the jacket hangs; the sleeves are next.

Clothes are not in the game yet. They come with the people of the valley, Mac and PC first, then the Quest.

Feedback welcome

Behind the scenes, in three parts: 1. The game runs inside Blender · 2. Clothes cut from real patterns · 3. Hair, from a comb to a game

Come say hi on Discord. The game also streams live on Twitch, every night at 20:00 CET.

All devlog posts