Skip to content
Back to skills

Lightmap Allocation

ASecurity

Decide which renderers get lightmap texels and how many, and catch broken allocation before and after a bake, for VRChat worlds (Unity 2022.3 Built-in RP; Bakery first, GLIM or Progressive as fallbacks; VRC Light Volumes light everything that isn't lightmapped). Covers the per-class reception table (lightmapped / Light-Volume-lit but still casting / dynamic on an LV shader), texel-density targets, Scale In Lightmap and chart-share maths, lightmap groups, UV2 quality (import margin, Blender-au...

  • 4 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 29, 2026
ai-agentspythongoshellapi

Works with

  • api

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned December 5, 2026

npx -y skills add tsuseki/Agentic-VRChat-World-Development-Kit --skill lightmap-allocation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Lightmap Allocation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Lightmap Allocation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tsuseki-lightmap-allocation/badge)](https://www.skillsdirectory.com/skills/tsuseki-lightmap-allocation)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: lightmap-allocation
description: "Decide which renderers get lightmap texels and how many, and catch broken allocation before and after a bake, for VRChat worlds (Unity 2022.3 Built-in RP; Bakery first, GLIM or Progressive as fallbacks; VRC Light Volumes light everything that isn't lightmapped). Covers the per-class reception table (lightmapped / Light-Volume-lit but still casting / dynamic on an LV shader), texel-density targets, Scale In Lightmap and chart-share maths, lightmap groups, UV2 quality (import margin, Blender-authored UV2, per-material share, overlap, organic meshes), the measured pre-bake audit with thresholds and the post-bake binding and visual checks. Use when: preparing any lightmap bake or a C.1 piece for baking, setting receiveGI / ContributeGI / Scale In Lightmap / lightmap groups, importing or unwrapping models for lightmapping, glass or transparent meshes take atlas space, pillows, cushions, bedding or sculptures bake faceted or torn, parts of one object (trunk vs branches) bake different colours, one object eats an atlas, too many lightmaps, overlapping-UV warnings, or reviewing bake quality object by object."
---

# Lightmap allocation

A bake can only be as good as the texels each surface receives. Most "bad bake" reports in this
workspace were allocation faults, not sample counts:
- thin glass ate the atlas;
- fragmented UV2 tore pillows into dark facets;
- one material got 3 % of its mesh's UV2;
- a hidden envelope took 68 % of an atlas;
- the importer's margin left UV2 90 % empty.

This skill decides, **before** baking, what is lightmapped and how densely, and it proves the
allocation by measurement and near-reach renders afterwards. Bake settings, emitters, probes and
artifact diagnosis stay in `.omp/skills/bakery-light-baking/SKILL.md`.

## 1. Reception: who gets texels

Three modes per renderer:

| Mode | Settings | Gets |
|---|---|---|
| **L** lightmapped | static `ContributeGI`, `receiveGI = Lightmaps`, valid UV2, a lightmap group | baked direct + GI, contact shadows, its own chart |
| **P** Light-Volume lit (`receiveGI = LightProbes`, LV shader), still casting | `ContributeGI`, `receiveGI = LightProbes`, `BlendProbes`, LV-compatible shader (`<name>_LV.mat` copy); no group selector, no storage row | casts and occludes in the bake, lit by Light Volumes, no atlas space |
| **D** dynamic, LV shader | not static, `BlendProbes`, LV-compatible shader (`<name>_LV.mat` copy) | nothing baked; moves; lit by Light Volumes |

Every world ships VRC Light Volumes, so everything that isn't L is lit by them: `Light Volume
Samples/Light Volume PBR`, or a listed LV-compatible shader (lilToon, Poiyomi and similar) for
stylised assets. A Standard-shader P or D renderer is a finding. Light probes stay only as a coarse
fallback grid (legacy avatars, outside the volumes); `receiveGI = LightProbes` is just the Unity
setting that makes a static renderer non-lightmapped. Legacy world without Light Volumes: P and D
are probe-lit on their own materials.

Workspace default (the user's rules). A world may change any row; record it with the user's words
in that world's `WORLD.md` Decisions log, and then `WORLD.md` wins.

| Class | Mode | Key rule |
|---|---|---|
| Walls, floors, ceilings, shell, built-ins | L | hero area group; hidden backs and exterior envelopes demoted (§2) |
| Large furniture (> ~0.4 m): sofas, beds, tables, cabinets, lamp bodies, rugs, big plants and pots, statues | L | UV2 must pass the audit; otherwise re-unwrap, never move to Light Volumes to dodge it |
| Small hard decor (≤ ~0.4 m): taps, bottles, fruit, souvenirs, small figurines, books on shelves | L if its UV2 passes the audit and its short side gets ≥ 8 texels; otherwise P | user: "only small props can go with lightvolumes", "small objects should move to light volumes if [the lightmap is] broken" |
| Soft or organic small pieces: pillows, cushions, throws (≤ ~0.6 m), small sculptures | same rule; their auto UV2 almost always fails the audit, so expect P | incident: about 800 of 2,379 small renderers had fragmented auto UV2 |
| Anything under ~0.12 m in its middle dimension | P | no margin rescues a 1–2 texel chart |
| Flush wall fittings < ~20 cm (switches, outlets, vents) | P | 4 × 3 texel charts bake half-black smears |
| Glass, transparent, glazing | P, `ReflectionProbeStatic` off; where it is lit, an LV-compatible shader | thin panes demand huge charts and gutter-bleed onto the view |
| Cutout foliage: hero trees | L with hand-built Lightmap UV (bark budget) | auto unwrap gives bark ~3 % of the UV2 |
| Cutout foliage: scatter, small plants | P | grass under baked tree shadows: L or ground-lightmap sampling |
| Light meshes and emitters (`BakeryLightMesh`) | never L (Bakery skips them); no selector | split emitter child from a lightmapped body when the body must be lit |
| SSS shades | L in their own `computeSSS` group, generous scale (~6) | closed volume, shadows On |
| Pickups (plushies included), Udon-moved and animated parts | D, LV shader | ambient sway: keep L and move vertices in the shader |
| Mirrors, video screens | not `ContributeGI`, not L | they bake as coloured area lights or hang Progressive |
| Far scenery, skyline, backdrops | L in one small shared group, or P/off outside the probe hull | never in a hero group |
| LOD levels | L per LOD level group (Bakery `sceneLodLevel`), LOD1/2 discounted; or P | GLIM bakes hand-authored LOD0 only |
| Merged / batched meshes | bake the originals; merges reuse each source's UV2 and scale-offset | merged-only defects block the merge chain |
| Terrain | L, every tile in a group | hero tiles need full-range UV2 |
| Pack furniture without UV2 | P until given UV2, then L | P still casts contact shadows |

Full table with reasons and settings: [references/reception-and-density.md](references/reception-and-density.md) §1.

### Lightmap or Light Volume: decide by look, measured by texels per chart

Light Volumes win on **look**, not memory: for small props both cost ~0.1 MB in total, and anything
inside an existing room volume adds no Light Volume memory at all. The predictor of a scuffed bake is
**lightmap texels per UV2 chart** at the density the bake actually gives the object (a chart under
~4 × 4 texels cannot hold a gradient).

Move a static object to P only when all hold:
1. small: largest side ≤ ~0.5 m;
2. complex UV2: ≥ 8 charts or mostly curved charts;
3. botched at its baked density: < 16 texels per chart with ≥ half its charts under 4 texels across,
   or broken UV2 (fill < 0.05, or > 10 % of charts overlapping).

Never move: objects whose look depends on their own shadowing (slats, shelves and cavities, tree
crowns: volumes leak light through them at 0.25–0.5 m), soft goods, furniture and fixture bodies,
books in shelves; fix their UV2 or raise their scale instead. Leafy plants are exempt from the
chart test (they bake fine on the lightmap despite tiny charts). Fine on the lightmap: < 8 flat
charts, or ≥ 50 texels per chart with < 25 % of charts under 4 texels. Objects that move look as
clean at 0.25–0.5 m voxels as at 0.1 m. A new volume of its own needs the memory sum: lightmap
share A·d²·b/fill against voxels × 24 B; at 0.1 m almost nothing has enough surface per m³ to win.
Grey zone → same-camera play-mode look test.

## 2. Budget and density

- **Density targets** (effective texels/m, 1 unit = 1 m):
  - hero interior shell 20–40;
  - furniture players sit or lie on 30–60;
  - exterior play ground and garden furniture 10–30;
  - background terrain and far facades 1–5;
  - hidden backs at Scale In Lightmap 0.1, or 0 (occluder only).
- **Short-side minimum:** every lightmapped piece gets **≥ 8 texels across the short side of its
  main face**. Below that, raise Scale In Lightmap (usually ≤ 8; past that, fix the UV2 or change
  reception).
- **Chart share** of a renderer = `lightmapScaleOffset.x × .y` of its atlas. It grows with
  `scaleInLightmap²`, so doubling a scale quadruples the share. Inside one group Scale In Lightmap is
  a relative share: raising one renderer thins all the others in a fixed-resolution group.
- **Groups:**
  - a few explicit groups, zero ungrouped renderers;
  - a fixed-resolution group (e.g. 2048) per hero area;
  - one small shared fixed group (e.g. 512) for background and terrain;
  - SSS in its own group;
  - one group per LOD level;
  - P renderers carry no selector.
- **Padding:** gutters measured in texels at the final resolution ≥ padding + 1. Bakery texel
  padding 8 on hero groups.
- **Atlas size from need:** sum the chart texels a fixed group needs before picking its resolution; an
  oversized atlas is upload size for nothing (an 8192² group holding 17.1 M needed texels cost ~47 MB of bundle
  against 4096²). Shared LOD UVs leave atlas size as the only density lever.
- **First-bake floor for small props:** `SIL_min = ((target + 6) / (tpu × √(2A)))²`, so no chart rect falls under
  Bakery's padding.

Maths, per-class table and VRAM: [references/reception-and-density.md](references/reception-and-density.md) §2–§4.

## 3. UV2 quality

- **Import:** *Generate Lightmap UVs* with margin method **Manual** (pack margin ~6), never
  Calculate at a low minimum resolution.
- **Blender-authored UV2** for hero furniture, trees, organic and multi-material pieces: few large
  flat charts, area shares set by allocation, not raw surface area. Import with *Generate Lightmap
  UVs* off and keep Bakery's UV processing from overriding it.
  Tool option (trial): xatlas in Blender's Python, reference script and notes in
  `.omp/docs/mesh-tools.md`.
- **Per-material parity:** each submesh's UV2 share should be near its surface-area share.
- UV2 inside 0–1, finite, non-overlapping. Charts ÷ triangles well below 1.0.
- **Organic meshes:** flat-chart unwrap with few charts, or don't lightmap them.

Details: [references/uv2-quality.md](references/uv2-quality.md).

## 4. Pre-bake audit (measured)

Run it on every lightmapped renderer of the baked area. Flag a renderer when:

| # | Check | Flag |
|---|---|---|
| 1 | Tiny triangles | > 30 % of UV2 triangles under 0.01 texel² |
| 2 | Fragmented charts | > 50 % of charts under 4 texels (√ chart area) |
| 3 | Per-material starvation | a submesh with ≥ 10 % of the surface area and < 5 % of the UV2 area |
| 4 | Atlas hogs | top 10 renderers by chart share per atlas; any hidden, exterior-back or far renderer > 2 %; any renderer > 10 % without a reason |
| 5 | Transparent still lightmapped | render queue ≥ 2500, Transparent/Fade mode, or a glass/window/glazing material |
| 6 | Too small to lightmap | largest bounds < 0.12 m, or middle < 0.12 m with fewer than 12 texels across it |
| 7 | Short side | < 8 texels across the main face's short side |
| 8 | UV2 validity | missing, outside 0–1, NaN; charts ÷ triangles ≥ 0.9 |
| 9 | Groups | ungrouped lightmapped renderers; P renderers with a selector; LOD renderers without a per-level group |
| 10 | Gutters | < padding + 1 texels at final resolution |

Each flag gets a fix:
- change reception (§1);
- re-unwrap (§3);
- change scale or group (§2);
- or a written reason in the bake report.

**Tooling:** use the `com.awdk.agenttools` lightmap UV2 audit when the package has one. Otherwise use
the project's own editor script with a static `Run(rootPath, outTsv)` that writes one row per
renderer with the metrics above. Metric definitions and the time-budgeted loop:
[references/audit.md](references/audit.md) §1.

## 5. Post-bake checks

- **Bindings:**
  - every lightmapped renderer has a valid index and a finite scale-offset;
  - nothing sits on a 16×16 map;
  - the storage `maps` count equals the live count;
  - clones and renderers placed since the bake count as unbaked;
  - never hard-code lightmap ids, which shift when a group is added or emptied;
  - prefab families re-imported since the bake are unbound (new LOD child IDs) until a re-bake: count
    `lightmapIndex < 0` under them.
- **Visual** (after the normal bake; a QUICK bake's density cannot show them):
  - a lightmap-only render of each room;
  - near-reach shots (≤ 0.6 m, eye height) of every soft or organic piece and every audit-flagged
    renderer;
  - merged vs unmerged originals from the same views;
  - comparing two bakes: lightmap-only renders and % of pixels > 24/255 off, never beauty renders.
- **Positive control:** the same rig on one known-bad piece (an unfixed flagged renderer, or a copy
  at Scale In Lightmap 0.1) must show the defect. Quote both results.
- **Gate:** the final-reviewer is the gate.

Procedure: [references/audit.md](references/audit.md) §2–§3.

## Stage hooks

- **C.1 Build-out:** set reception and scale per §1–§2 as each piece is placed. Fix UV2 at import.
- **D.1 before the first QUICK bake of an area,** and again before the normal bake when anything
  was re-unwrapped, rescaled or regrouped since: run the §4 audit and attach the TSV and flag
  counts to the bake report.
- **D.1 after every bake, QUICK or normal:** first the post-bake sequence of `bakery-light-baking`
  (reflection probes are never left for later), then the §5 binding checks. The §5 visual checks
  follow the normal bake. Looking at every surface kind after every bake is the bake loop's job
  (`bakery-light-baking` "Bake loop" step 4), not this section's.
- **final-reviewer criterion F2** reruns §4 and §5 on the area.

Lessons checklist (one rule per note): [references/lessons-lightmap-allocation.md](references/lessons-lightmap-allocation.md).
Sources: `SOURCES.md` (not needed to use the skill).

Files in this skill

  • SKILL.md12.9 KB
  • SOURCES.md2.7 KB
  • references/audit.md8.8 KB
  • references/lessons-lightmap-allocation.md10.8 KB
  • references/reception-and-density.md12.1 KB
  • references/uv2-quality.md7.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.