Paint a gray blockout level or environment (spends the user's OpenRouter key)
texture_project_paintPaint a gray blockout level by generating camera-view textures, projecting them into the UV atlas, and writing a baked GLB under assets/.
Instructions
SPENDS PROVIDER CREDITS. Texture a gray blockout level or environment: plan camera views, ask an OpenRouter image model (FLUX 3 Klein by default) to paint each view from the clay render, project the images into the level's UV atlas, and write the baked GLB atomically under the project's assets/. Every prompt keeps the clay image's edges, openings and silhouette and forbids invented doors, windows, arches and volumes; a view that invents geometry, or whose surface is almost all grazing, is rejected and left to the fill pass. You judge the views yourself: inspect returns the contact sheet, and any view that invents an arch, doorway, passage, opening, slab, coping or decorative floor is rejected with {"resumeRunId": ..., "rejectViews": [..]}, which buys no image and re-bakes from the stored ones. An embedded vision check is an opt-in (verify: true) that costs one chat request per view; it is off by default. Fails closed and stops spending: TEXTURE_PROJECT_STRUCTURE_REJECTED once the first three painted views all invent geometry, TEXTURE_PROJECT_NO_COVERAGE when no view reaches the atlas. Requires OPENROUTER_API_KEY when an image actually has to be bought; a resume that only reuses stored images needs none. Reusing resumeRunId re-judges every stored generation and requests only views that have none, so a view is never paid for twice; viewsPainted counts what reached the atlas, bought or reused. promptTestView buys exactly one image. fill: "debug" paints never-painted texels hot pink (#FF69B4) so a capture can count bake gaps; use it for verification, never ship it. The atlas stays opaque RGB with the fill's own colour, so it keeps its UASTC cook; "a view painted this texel" ships as its own file, .painted.png beside the GLB: an 8-bit grayscale PNG at a quarter of the atlas' side, 255 where an accepted view painted, 0 where the fill made the colour up, feathered and bled into the UV gutters, named by the GLB's extras.threenative.textureProjection.paintedMask and returned as paintedMask. A game samples it as a linear data texture at the atlas' uv and swaps the atlas for the paint's swatch exactly where no view painted. It also cuts true-scale, tileable material swatches from the stored paint — one wall and one floor patch, rectified onto their own planes and written beside the GLB as .swatch_wall.png, .swatch_floor.png and .swatches.json — because the atlas is macro variation and at arm's length its texels read as blotches: a game tiles these in world space for close-range detail.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"levelPath": "<levelPath>",
"outputPath": "<outputPath>"
},
"name": "texture_project_paint"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fill | No | What the exported atlas writes in a texel no accepted view painted: "detail" (default) continues the material around the gap; "debug" writes it hot pink (#FF69B4) so a capture can count the bake gaps. Use "debug" for verification, never ship it. | |
| atlas | No | Atlas size in pixels, or "auto" (default) for the smallest power of two that matches what the planned views resolve. | auto |
| holes | No | Extra views over the largest unpainted texels players can see, painted until visible coverage reaches 95% (default 12). | |
| model | No | Image model alias: "or-klein" (default), "flux-3", "qwen-2.1-turbo", "qwen-2.1-pro", "muse-image", "or-seedream-lite" or "or:<model id>". | or-klein |
| roofs | No | Close roof passes painted with the roof prompt (default 0). | |
| style | No | Material style for the level, e.g. its architecture and wear. | |
| views | No | Maximum number of camera views to plan (default 36). | |
| aerial | No | Aerial ring cameras around the level (default 0). | |
| verify | No | Opt-in vision check: one OpenRouter chat call per painted view, priced separately in the quote (default false). A rejected view is repainted once, then left to the fill pass. You review inspect's contact sheet instead. | |
| lighting | No | Light the clay render is painted under; "overcast" (default) keeps albedo free of baked sun. | overcast |
| viewSize | No | Pixels per view image sent to the model (default 1024). | |
| fillModel | No | Model alias for fill and hole views (defaults to model); the first views always use model. | |
| levelPath | Yes | Gray blockout level or environment GLB, project-relative; it must carry TEXCOORD_0 (unwrapped). | |
| atlasPages | No | Multi-page UV atlas count (1-4), or "auto" (default) to split large levels across up to 4 atlases for higher texel density. | auto |
| outputPath | Yes | Painted GLB to write, project-relative and under the project's assets/ directory (atomically replaced). | |
| rejectViews | No | Views you judged wrong in inspect's contact sheet: each is stored as rejected by the caller, projected nowhere, and buys no image. Requires resumeRunId and indices the run stores. | |
| resumeRunId | No | Continue a stored run: its paid views are replayed and only the missing ones are requested. | |
| verifyModel | No | OpenRouter chat model id with image input for the opt-in vision check (default google/gemini-2.5-flash-lite). | |
| promptTestView | No | Paint only this planned view, for one image: a prompt test that leaves the run incomplete. | |
| styleImagePath | No | Reference image whose materials and palette ride along, project-relative. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| atlas | Yes | ||
| runId | Yes | ||
| swatches | Yes | True-scale, tileable material swatches cut from the stored paint: a game tiles them in world space for close range and keeps the atlas for macro variation. Null for a prompt test; a class no accepted view could give a patch for is null and named in warnings. | |
| warnings | Yes | What the run wants read before the bake is used (a visible-coverage shortfall). | |
| atlasPages | Yes | ||
| outputPath | Yes | ||
| paintedMask | Yes | The painted-coverage mask written beside the GLB: an 8-bit grayscale PNG at a quarter of the atlas' side, 255 where an accepted view painted the texel and 0 where the fill made the colour up, feathered and bled into the UV gutters. A game samples it as a linear data texture at the atlas' uv to swap the atlas for the paint's swatch exactly where no view painted. The atlas itself stays opaque RGB with the fill's own colour, so it cooks UASTC. Null for the debug fill, which writes no mask. | |
| verifyModel | Yes | ||
| viewsBanded | Yes | Views whose vision check listed an edge band (a coping, a plinth): projected, and recorded in run.json. | |
| estimatedUsd | Yes | ||
| viewsPainted | Yes | ||
| viewsRejected | Yes | ||
| cookConfigHint | Yes | ||
| texelsPerMetre | No | ||
| viewsRepainted | Yes | ||
| coveragePercent | Yes | ||
| blurredTexelPercent | Yes | ||
| visibleCoveragePercent | Yes | Share of the texels player-height cameras see that the bake painted (B). | |
| magnificationSkippedPercent | Yes |