Skip to content

docs: shadow/SSAO fix post-mortem; keep F5-F8 render-pass debug toggles#6

Merged
proggeramlug merged 1 commit into
mainfrom
docs/shadow-ssao-fix-writeup
Jul 9, 2026
Merged

docs: shadow/SSAO fix post-mortem; keep F5-F8 render-pass debug toggles#6
proggeramlug merged 1 commit into
mainfrom
docs/shadow-ssao-fix-writeup

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What

  • docs/shadow-cascade-and-ssao-fixes.md — full post-mortem of the 2026-07 "moving dark patch" + SSAO flicker investigation: symptoms, false trails, root causes, fixes, and the diagnostic tooling (F5–F8 toggles, native F12 capture, runtime-loaded shader debug viz, engine stderr probes).
  • src/main.ts — keeps the F5–F8 live render-pass toggle bar + top-left status line as a standing debug aid (relabeled from the temporary "flicker-hunt" wording).
  • .gitignore — ignores screenshot_*.png (F12 native captures).

The actual engine code fixes are in Bloom-Engine/engine#85 (collapsed shadow-cascade fit + SSAO contact-shadow/radius). This PR is docs + the shooter-side debug bar only.

Summary by CodeRabbit

  • New Features

    • Added in-game toggle shortcuts for the major rendering effects, with an on-screen status indicator showing whether each is enabled.
  • Bug Fixes

    • Improved visual stability for shadows and ambient occlusion, reducing flicker and dark pixel artifacts in some scenes.
    • Adjusted shadow and ambient occlusion settings to produce more consistent results and better match their documented behavior.
  • Documentation

    • Added a detailed post-mortem explaining the issue, the investigation process, and the fixes applied.

Adds docs/shadow-cascade-and-ssao-fixes.md -- a full write-up of the 2026-07
investigation into the "moving dark patch" (a collapsed shadow-cascade fit) and
the two SSAO flicker/over-darkening bugs. Root causes, false trails, fixes, and
the diagnostic tooling used. The code fixes live in the engine repo
(Bloom-Engine/engine#85).

Keeps the F5-F8 live render-pass toggle bar + status line in main.ts as a
standing debug aid (relabeled from the temporary "flicker-hunt" wording), and
gitignores F12 native screenshots.
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 14a21c7d-27b7-45f4-b3bb-d2f455a5cd68

📥 Commits

Reviewing files that changed from the base of the PR and between 7d8cd05 and 2e28585.

📒 Files selected for processing (3)
  • .gitignore
  • docs/shadow-cascade-and-ssao-fixes.md
  • src/main.ts

📝 Walkthrough

Walkthrough

Added persistent render-pass debug toggle variables (SSGI, SSAO, SSR, shadows) in src/main.ts, bound to F5–F8 keys with a HUD status line. Added a .gitignore entry for screenshot captures. Added a documentation file describing SSAO and shadow-cascade fix post-mortem.

Changes

Debug toggles and documentation

Layer / File(s) Summary
Render-pass debug toggle state and input handling
src/main.ts
Adds persistent SSGI/SSAO/SSR/shadow toggle variables defaulting to true, F5–F8 key bindings that flip each and call corresponding engine set*Enabled functions, and a HUD status line showing ON/off state per effect.
Screenshot ignore rule
.gitignore
Appends a comment and ignore pattern for screenshot_*.png capture files.
Shadow-cascade and SSAO post-mortem documentation
docs/shadow-cascade-and-ssao-fixes.md
Adds a document describing the diagnostic workflow, SSAO contact-shadow and radius/strength fixes, a rewritten shadow-cascade frustum-fit computation, and a files-touched list referencing the debug toggle bar.

Estimated code review effort: 2 (Simple) | ~10 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/shadow-ssao-fix-writeup

Comment @coderabbitai help to get the list of available commands.

@proggeramlug proggeramlug merged commit 8d0cca0 into main Jul 9, 2026
1 check was pending
@proggeramlug proggeramlug deleted the docs/shadow-ssao-fix-writeup branch July 9, 2026 14:47
proggeramlug pushed a commit that referenced this pull request Jul 13, 2026
…pawn is a no-op)

#6 is the one that matters. JSON.stringify CORRUPTS a large object graph that came
from JSON.parse -- 5,296 characters above U+00FF in a document whose source is almost
pure ASCII -- and the corruption is invisible from TypeScript. It only shows up at the
FFI, where the string fails its UTF-8 check, gets replaced with "", and writeFile
wrote a zero-byte file and returned success.

That is how the editor destroyed every world it ever saved.

The rule that falls out of it: never JSON.stringify anything you are going to
PERSIST. Hand-serialise by literal key. settings.ts already did this and now
engine/src/world/serialize.ts does too.

Also adds the shooter's `--world <path>` override, which is what play-in-editor
launches the game with.

Claude-Session: https://claude.ai/code/session_01V3MihNxaRwMR8GjMPvMkRb
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