set_lightmap_scale
Sets lightmap scale on selected VMF faces by solid, material, facing, or area, reporting luxel counts before and after writing. Warns when faces exceed 32 luxels per axis, which makes vbsp split them.
Instructions
Sets lightmapscale on selected faces of a .vmf. The value is units per luxel, so it runs backwards from intuition: smaller is finer and more expensive, and the cost is an area -- halving the scale quadruples the luxels on that face. Select by solid, by material, by which way a face points, by minimum area, or a combination. Reports the luxel count before and after, per face and in total, before writing. Warns when a face would cross MAX_BRUSH_LIGHTMAP_DIM_WITHOUT_BORDER (32 luxels per texture axis, read from bspfile.h): vbsp does not refuse that, it splits the face until each piece fits, so the bill includes extra faces and not only extra luxels. Verify with read_lightmap_budget on the recompiled map.
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": {
"path": "<path>",
"scale": "<scale>"
},
"name": "set_lightmap_scale"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| all | No | Required to act on every face of the map when no other selector is given. | |
| path | Yes | Path to the .vmf, absolute or relative to the repo root. | |
| scale | Yes | Units per luxel. Hammer's default is 16; powers of two are the convention. | |
| backup | No | Copy the file to <file>.bak before writing. Nothing is copied on a no-op. | |
| dryRun | No | Check and report without writing. Every verification runs either way. | |
| facing | No | Only faces pointing this way: up is a floor, down a ceiling, side a wall. | |
| confirm | No | Required (true) to run this tool: it writes or executes. | |
| minArea | No | Only faces of at least this many square units. | |
| material | No | Only faces whose material contains this text. | |
| solidIds | No | Only faces of these solids. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| changed | Yes | ||
| written | Yes | ||
| nextStep | Yes | ||
| warnings | Yes | ||
| truncated | Yes | ||
| unchanged | Yes | ||
| backupPath | Yes | ||
| luxelsAfter | Yes | ||
| facesChanged | Yes | ||
| facesOverCap | Yes | ||
| luxelsBefore | Yes | ||
| alreadyAtScale | Yes |