Room photo render
One 3D view in, one real-estate photograph out. The 3D render fixes the geometry; Codex image generation supplies light, materials and life. Each image takes about one minute.
When to use
- The user has a 3D view (screenshot, render, canvas capture) and wants it to look like a real photo.
- A walkthrough or tour needs a photo per room (the reel pattern: every view generated from a fixed reference so the house stays the same building).
- Do not use it to invent a room with no reference. Without a render, the layout drifts.
Steps
- Capture clean reference views.
- One view per room, from the room's start point. Hide the HUD; the canvas alone is best.
- Use a 3:2 canvas (for example 1200×800 CSS px) for landscape photos.
- For a three.js page,
scripts/capture_server.pyreceives canvas PNGs from the page. Run it, then postcanvas.toDataURL()from the page for each room. See the header of that script. - The page needs
preserveDrawingBuffer: truefor the capture build only.
- Write one line of room facts per view. Name what is in the frame, left to right, with materials and colours. The model keeps what you name and drifts on what you don't.
- Generate. Run:
The script adds the camera-lock rules, the photography brief and the design rules fromscripts/codex_photo.sh <reference.jpg> <out.png> "<room facts>" [extra direction]references/design-rules.md. Run up to 3 at once; Codex handles them in parallel. - Check every result against its reference. Reject and re-run when walls, windows, doors or big furniture moved, appeared or vanished. Small dressing (plants, cushions, books, curtains) is allowed and wanted.
- Ship small files. Convert to WebP at about 1600 px wide, quality 80 (for example with
sharp), about 150–300 KB each. Label them as AI photos in the product.
Rules that matter
- Lock the camera first in the prompt, then list the objects, then the style. Order changes the result.
- Allowed changes: light, materials, textures, small soft furnishings, plants, books, art. Not allowed: moving walls, windows, doors, built-ins, or big furniture.
- Design rules come from the video "the neuroscience behind homes that feel 10x better than others" (Five By Nine). They are summarised in
references/design-rules.md. Apply them as dressing, never as layout changes, so the photo still matches the 3D model. - No people, no text, no watermarks, no brand names.
- Keep the reference and the result side by side in the project (
renders/<room>_3d.jpg,renders/<room>_photo.png).
Known problems
See references/gotchas.md before you start. It lists the failures already met: Codex -i eating the prompt, WebGL blocked after GPU resets, artifact hosts that refuse .glb, and why a live in-browser path tracer was dropped.