Skip to content

Shadows under anti-aliasing: the marks moved toward the camera - #51

Merged
boubou666 merged 2 commits into
mainfrom
dc/msaa-shadows
Nov 24, 2026
Merged

boubou666 merged 2 commits into
mainfrom
dc/msaa-shadows

Conversation

@boubou666

@boubou666 boubou666 commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Character shadows vanished with the engine's anti-aliasing on (Video tab; seen at 4x in Norune). They show again at 2x, 4x and 8x.

Engine pin: d04e9d8, BozoEngine master with TheBozos/BozoEngine#135 merged (and #136, a reference-checker change for the log host only). On it: build, 137/137 suites, save states load back identically, and the end-of-run RAM is byte-identical to 36991be.

Cause: DC draws its shadow marks into a work target that shares the frame's depth, depth-tested against the ground. With anti-aliasing, that depth is resolved from one sample point off each pixel's centre. On sloping ground it lies nearer than the mark's centre depth, so every mark failed.

Change: while anti-aliasing is on (Renderer::antiAliasing() >= 2), the marks take the engine's new Material::depthOffsetSlope / depthOffsetUnits (1, 1), which moves them toward the camera by up to a pixel's depth slope. Without anti-aliasing nothing changes, as on the GS.

Checked:

  • The water route, hidden, at 2x / 4x / 8x: the shadow is back. Screenshots are within 0.5–0.8 of the no-anti-aliasing picture (2x 5.3 at one frame, where Toan stands a step further along).
  • DC suites: 137/137 pass.
  • The engine's GPU suites (render targets with the new decal case, image processing) pass.

🤖 Generated with Claude Code

boubou666 and others added 2 commits November 24, 2026 10:51
With anti-aliasing the shadow work target's shared depth is resolved from one sample point off each
pixel's centre; on sloping ground that lies nearer than the mark's centre depth and every mark failed
the depth test, so the character shadows vanished (4x). Under anti-aliasing the marks now take
Material::depthOffset (slope 1, units 1); without it nothing changes.

BozoEngine: local branch dc/msaa-decal-offset (8ee365b), not pushed yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@boubou666
boubou666 merged commit 3716693 into main Nov 24, 2026
2 checks passed
@boubou666
boubou666 deleted the dc/msaa-shadows branch November 24, 2026 10:23
@boubou666 boubou666 mentioned this pull request Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant