-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Save preview images are always black — framebuffer empty at capture time #5321
Description
AI-assisted issue. Filed by agent driven by @Cervator via GDD.
Context
During the DI migration review (#5299), the black save preview screenshot was identified as a known issue. Investigation found two contributing causes — one now fixed, one remaining.
Problem / Current State
Save game preview images are always black. Two issues were involved:
-
ScreenGrabber not visible from CoreRegistry (fixed):
ScreenGrabberwas registered only inWorldRendererImpl's private child context.ReadWriteStorageManager.saveGamePreviewImage()resolves it viaCoreRegistry.get(ScreenGrabber.class), which returned null. Fixed by propagating the instance to CoreRegistry inWorldRendererImpl.init(). -
Framebuffer empty at capture time (remaining): The save and screenshot capture happen during
StateIngame.dispose()(line 133), after the game's render loop has stopped updating the framebuffer.ScreenGrabber.saveScreenshot()readssceneFinalFbo.getColorBufferRawData()which returns stale or cleared data. The screenshot file IS written to disk but contains a black image.
Acceptance Criteria
- Save preview images show an actual in-game screenshot when loading a saved game
Technical Notes
StateIngame.dispose()callsstorageManager.waitForCompletionOfPreviousSaveAndStartSaving()at line 133startSaving()callssaveGamePreviewImage()at line 432ScreenGrabber.saveScreenshot()reads the FBO at line 101 — the buffer is empty because no render pass has occurred since the game loop stopped- The world renderer is still alive at save time (disposed at line 146-149, after save) but is no longer actively rendering
- Likely fix: trigger a final render pass before the dispose/save sequence, or capture the screenshot earlier (e.g., on the last frame before exit)
- This issue predates the DI migration — listed as a known issue in feat!: gestalt-di migration #5299
Related
- feat!: gestalt-di migration #5299 (gestalt-di migration — listed black screenshots as known issue)
- Phase 5 review PR (ScreenGrabber visibility fix)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Status