Skip to content

Engine patches: clears cover every layer of a layered target (Little Nightmares point lights) - #329

Closed
keanu-stitch8 wants to merge 1 commit into
LNPANDY:mainfrom
keanu-stitch8:layered-clears
Closed

keanu-stitch8 wants to merge 1 commit into
LNPANDY:mainfrom
keanu-stitch8:layered-clears

Conversation

@keanu-stitch8

Copy link
Copy Markdown

Fix or feature

  • Fix
  • Feature

What and why

In Little Nightmares (01002FC00412C000), the lantern and the lighter lit only one side of a room, with straight edges. Each point light's one-pass cube shadow is cleared in a pass that is not layered, and the host's load-action clear covered face 0 only. Faces 1-5 kept zero depth and read as fully shadowed. NVN clears every layer of the bound view. Details are in the issue and in the upstream PR.

Fixes #328

The patches:

  • patches/0039-dm-ctl-texraw-every-slice.patch: DM_CTL texraw saves every slice, the dump that showed the problem.
  • patches/0040-layered-target-clears.patch: a cleared attachment whose view has more layers than a pass that is not layered is cleared in a pass of its own with renderTargetArrayLength. It adds the new test t_clear_layers and the docs/reference/rendering.md entry.

Both are Upstream-Status: forwarded seedds/nxnative#808. docs/agents/symptoms.md is left to sync. They are numbered after the open #325 (0038) to avoid a name clash.

Checked

  • python3 tools/engine.py check: ok, 26 patches apply cleanly to upstream.
  • make -C dm/gfx/tests GAME=010015100B514000 run passes on the engine with these changes (and Engine patch: SDK 3 signals the audio renderer event through its kernel binding (Little Nightmares) #325's patch). t_clear_layers: 30 checks, 0 failed; without the fix, 4 of its 6 cases fail.
  • Run on the Mac: Little Nightmares 01002FC00412C000 1.0.4 (v262144) from the provisional profile, on an M2 Pro with macOS 27.2.
    • Before the fix, texraw showed faces 1-5 of the shadow cube all zero.
    • After the fix, all six faces hold depth, and the lantern room is lit all around with Six's shadow on the floor.
  • Not run on an iPhone. scripts/regress.py was not run, because no other local game has the harness's NSP folder layout.

Screenshots

Before: the light covers one side only, with sharp edges. After: a round lit area around the lantern, with Six's shadow on the floor. (Screenshots not attached: game content.)

Scope

  • No engine file (dm/, scripts/, docs/, ref/) is added to the repository: a change there is a patch in patches/ (a commit in engine/, then tools/engine.py export, and tools/engine.py check passes), with its Upstream-Status
  • A fix to the engine or a game profile also goes to seedds/nxnative as a PR in parallel: this PR's patch says forwarded seedds/nxnative#..., or pending until that PR is open
  • A change to a launcher view has before and after screenshots above (n/a)
  • No keys, game files or data extracted from a game in the change or the attachments

🤖 Generated with Claude Code

…saves every slice

Little Nightmares' point lights lit only one side of a room: each light's
one-pass cube shadow is cleared in a pass that is not layered, and the
host's load-action clear covered face 0 alone, so faces 1-5 kept zero depth
and read as fully shadowed. 0040 clears such an attachment, every layer of
its view, in a pass of its own; 0039 makes DM_CTL texraw save every slice,
the dump that showed it. Forwarded as seedds/nxnative#808.

Fixes LNPANDY#328

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the patch-queue Changes the patch queue or the upstream pin label Oct 31, 2026
@v0lumehi v0lumehi added the nice-to-have Goes into the next release if it is ready in time label Nov 1, 2026
@v0lumehi v0lumehi modified the milestones: v1.1.1, v1.1.2 Nov 1, 2026
@v0lumehi

v0lumehi commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the patch and the clear Reason. It is in v1.1.2. Engine changes go to seedds/nxnative first, as CONTRIBUTING.md and patches/README.md describe. Could you open the matching pull request there and put its number in the patch header (Upstream-Status: forwarded seedds/nxnative#N)? If you cannot, tell me and a maintainer sends it. The patch number is given out when the pull request merges, so you do not need to chase it.

@keanu-stitch8

Copy link
Copy Markdown
Author

Thanks! The matching upstream PR is seedds/nxnative#808. It landed on main as ffdf67d, and both patch headers already reference #808. NX2Apple’s current upstream pin includes that commit, so this patch PR appears redundant now. Could you confirm whether #329 can be closed?

@v0lumehi v0lumehi added the bug Something isn't working label Nov 5, 2026
@v0lumehi v0lumehi modified the milestones: v1.2.1, v1.2.2, v1.2.4 Nov 6, 2026
@thehobbit85

Copy link
Copy Markdown
Contributor

Closing as superseded. The upstream engine now clears every layer of a bound render target. I verified that NX2Apple’s engine pin 88c7e03f includes that fix. Thanks for tracing the Little Nightmares lighting issue and contributing the fix upstream. Upstream fix · NX2Apple engine pin

@thehobbit85 thehobbit85 closed this Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working nice-to-have Goes into the next release if it is ready in time patch-queue Changes the patch queue or the upstream pin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Little Nightmares (01002FC00412C000): point lights light only one side of the room (cube shadow faces 1-5 never cleared)

3 participants