/unity-dev:unity-lightingfrom unity-dev
Diagnoses and fixes 3D lighting issues in Unity URP: flat scenes, black characters, broken bakes, missing shadows, and probe problems. Includes a lighting audit tool.
Ships in unity-dev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Most lighting reports are not a value to tune. "The bake did nothing" and "the character is black" are a light's Mode, a static flag or a missing probe: a Baked light does not exist at runtime, a lightmap lights only the surface it is painted on, and nothing warns when either leaves an object dark. Read the scene first; change one switch; read it again.
URP on Unity 6, 3D scenes. Worked example: the gate room — baked walls, a Mixed sun through the doorway, the runner and a sentry on probes.
| Symptom | Go to |
|---|---|
| Any lighting complaint, before touching a setting | §0 |
| Generate Lighting finishes and the scene looks the same | §1 |
| Lightmaps are blotchy, seamed, or black on one mesh | §1 steps 4–5 |
| The runner is black, flat or the wrong colour beside baked walls | §2 |
| A light affects the walls and not the character, or the reverse | §2 |
| A fifth light, or its shadows, flicker or drop out as the camera turns | §2 — the per-object limit |
| Metal is black; a floor reflects the sky indoors; reflections slide | §3 |
| No shadow; stripes; a shadow detached from its caster; crawling edges | §4 |
| Shadows end a few metres from the camera | §4 — Max Distance |
| A point or spot light casts no shadow | §4 — additional-light shadows |
| "The scene looks flat", or too dark with the lights right | §5 |
| Changing the skybox changed nothing | §5 — ambient is baked |
| Right in the Editor, wrong on the phone | §6 |
| Lighting costs too much on the phone | §6 — the order to cut in |
Drop resources/Editor/LightingAudit.cs into an Editor folder and run
Tools/Unity Dev/Lighting/Audit Open Scene, or return LightingAudit.Audit(); from an eval
(unity-debug → reference/editor-control.md). It changes nothing and prints one JSON object:
| Block | Holds |
|---|---|
pipeline | The URP asset in force and its tier, the renderer and its rendering path, light modes and limits, the probe system, the reflection-probe toggles, every shadow field |
settings | The Lighting Settings asset (or defaults), lightmapper, Lighting Mode |
lights | Each light's type, mode, bakedAs, shadows |
static | Renderers that contribute GI, receive lightmaps or probes, lack a second UV set |
bake, probes | Lightmap count and size, shadowmask, baked probe count, Adaptive Probe Volume state |
reflectionProbes, environment | Each probe's mode and box projection; sky, sun, ambient, fog |
findings | Named candidates: baked-light-never-baked, dynamic-without-probes, … |
pipeline.active is not-urp: stop. unity-render-urp →
reference/resolve-active-pipeline.md.A bake needs a light that asks, a renderer that contributes, a UV set and texels. Work down.
Light.lightmapBakeType). Set the lights
that never change to Baked and the sun to Mixed.StaticEditorFlags.ContributeGI): nothing-contributes-gi. Flag the walls and floor —
never the gate or anything else that moves.mode and bakedAs differ, or the Lighting Mode does:
light-mode-changed-since-bake. A Mixed light with no bake renders as Realtime; a Baked one
lights nothing. Bake again.MeshRenderer.receiveGI), or Scale In Lightmap is 0. Large surfaces want
ReceiveGI.Lightmaps.contributes-gi-without-uv2: tick Generate Lightmap UVs on the model
importer and Apply; a mesh built in code needs Unwrapping.GenerateSecondaryUVSet.Bake with evidence: Tools/Unity Dev/Lighting/Bake And Read Back
(resources/Editor/BakeAndReadBack.cs) reports the plan, waits for confirmation, bakes
asynchronously and prints lightmap count, probe count and bake time before and after.
"status":"baked-empty" means it ran and wrote nothing, with the missing input in detail. A
GPU bake needs a graphics device: under -nographics the CPU lightmapper is the path, and the
report says which ran.
Settings assets, UV failures, texel density, a draft and a final pair, batch baking:
reference/bake-setup.md.
| The runner is | Cause |
|---|---|
| Black or flat everywhere | No baked probes: dynamic-without-probes. A lightmap lights only its own surface |
| Right at spawn, wrong by the gate | No probe pair at the lighting change |
| Unlit by one particular light | That light is Baked. Make it Mixed, or accept probes |
| Lit differently per body part | Several renderers, several sample points: one Anchor Override (Renderer.probeAnchor) |
| One flat colour along a long moving object | One sample per renderer. Adaptive Probe Volumes sample per pixel; URP has no proxy volume |
| Unlit, with Light Probe Groups in the scene | The URP asset's Light Probe System is Adaptive Probe Volumes: probe-groups-ignored |
LightmapSettings.lightProbes.count after the bake.LightingSettings.mixedBakeMode): Baked Indirect
keeps direct light and shadows realtime; Shadowmask bakes static shadows; Subtractive bakes
direct light too and keeps one sun's shadow. Mixed Lighting must also be ticked on the URP
asset (mixed-lighting-off).Modes, the receive table and the limits: reference/light-modes.md.
Placement, anchors and Adaptive Probe Volumes: reference/probes.md.
baked-probe-without-texture is one never baked at all.box-projection-off-in-asset). Lighting → Reflection Probes on the asset.probe-blending-off-in-asset); Forward blends two probes per object.no-environment-reflection) — §5.EveryFrame renders the scene six more times. Use
ViaScripting and RenderProbe() when the gate finishes opening.Modes, the asset's three toggles, sizing and blending: reference/probes.md.
Realtime shadows are one texture stretched over Max Distance. Settings live on the URP asset the active tier uses, not in Quality settings.
| You see | Cause | First move |
|---|---|---|
| No shadow | A switch | The eight-step list in the reference: light type and mode, the asset, distance, the renderer, the material, the camera |
| Stripes on lit surfaces (acne) | Bias under one texel | Normal Bias 1 → 1.5, then Depth Bias |
| Shadow detached from the feet | Bias too high | Depth Bias 1 → 0.5; give thin casters thickness |
| Edges crawl when the camera turns | Texels too large | Max Distance down (default 50), then a cascade, then resolution |
| Shadows end at a distance | Max Distance, faded by Last Border | Raise it, or bake far shadows with Shadowmask |
| A point or spot light casts none | Additional Lights → Cast Shadows is off by default | additional-shadows-off; Per Pixel or Forward+ as well |
| The far player has no shadow under a fixed long view; split screen doubles the shadow cost | Distance too short for the view; one shadow map per camera | Per-tier table in the reference, "A long fixed view" |
| A second directional casts none | Only the main light has cascades | Assign the sun as Sun Source |
All point and spot shadows share one atlas (2048); a point light takes six slices. When they do not fit URP shrinks them and logs it — read the Console before raising anything.
Every field with its default, per-light settings, the atlas, the Screen Space Shadows feature and
the artefact table: reference/shadows.md.
Ambient light and the environment reflection come from the sky, are scene state in
RenderSettings, and are baked: a new skybox changes neither until lighting is generated.
RenderSettings.ambientIntensity to 0.5–0.8,
bake bounce light, turn shadows on — before adding lights.AmbientMode.Flat with a dark colour; let the bake and the
probes carry the room.DynamicGI.UpdateEnvironment() afterwards.unity-render-urp.Every field, the sun source, fog and the ten-row checklist:
reference/environment.md.
Start a phone from: one Mixed directional, Shadowmask (Subtractive on the lowest tier), Max
Distance 25–40 with one cascade, everything static baked, probes for the runner, no additional
shadows. When over budget, cut additional shadows, then distance and cascades, then realtime
lights — measuring each cut with unity-profiling.
The whole set, the cut order and a worked gate room:
reference/mobile-subset.md.
Lights, shadows and normal maps for sprites are unity-2d-rendering. Post-processing Volumes,
exposure, tonemapping, renderer features and whether URP is the pipeline in force are
unity-render-urp; moving a Built-in project to URP and the stale bake it leaves behind are
unity-urp-migration. HDRP and shader authoring are out. What a light or shadow pass costs is
unity-profiling; LOD, occlusion, batching and culling are unity-scene-optimisation. Building
the room is unity-3d-level; importing its meshes is unity-3d-models; reading the result on a
real device is unity-device-testing.
reference/bake-setup.md (opens in a new tab)reference/environment.md (opens in a new tab)reference/light-modes.md (opens in a new tab)reference/mobile-subset.md (opens in a new tab)reference/probes.md (opens in a new tab)reference/shadows.md (opens in a new tab)resources/Editor/BakeAndReadBack.cs (opens in a new tab)resources/Editor/LightingAudit.cs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub tipoli5890/game-studio --plugin unity-dev51 skills in this plugin
/unity-2d-animationSkeletal 2D characters: PSB rig, bones and weights, sprite swaps, 2D IK (2D Animation package)./unity-2d-controllerMove a 2D character: platformer jump, slopes, coyote time, moving platforms, top-down movement./unity-2d-gridGrid tactics and tile puzzles, hex or square: move range, A* paths, line of sight, turns, undo./unity-2d-level2D level layout as data: Tiled/LDtk import, rooms, endless chunks, seeded levels, jump reachability.