Skip to content

Assets baking - #114

Merged
wagrenier merged 7 commits into
mainfrom
AssetsBaking
Oct 29, 2026
Merged

wagrenier merged 7 commits into
mainfrom
AssetsBaking

Conversation

@wagrenier

Copy link
Copy Markdown
Contributor

Removes the last of the PS2 GS emulation from the renderer, fixes the stalls from framebuffer readbacks, and rebuilds the RmlUi options screen with an explicit aspect ratio setting.

Textures without the GS

  • Model textures are baked. On first launch MikuPan bakes the model textures from the player's own data into IMG_TEX.BIN (src/mikupan/bake), and every mesh names its texture by a direct id. tools/sgdstitch stitches meshes together and can bake offline as well.
  • 2D textures without the GS. TIM2 pictures are stamped with ids in header bytes the game never reads, and decoded through mikupan_tim2 into texture slots (mikupan_texture_slots). The GS runtime and the per-frame texture hashing are gone.
  • Framebuffer readbacks scale on the GPU and read back only the result, instead of pulling the whole render target through a fresh allocation every frame (the photo screen asked for one each frame).

Options screen

  • Rebuilt as one table-driven column, laid out like MioPan-Mikompilation's RmlUi menus. Sections: Display, Graphics, Audio, Game, Controls, Keyboard, Controller.
    • Choices step with left/right, sliders show their default, and the selected row's help and device-aware button prompts sit at the bottom.
    • Keyboard: Q/E or Tab switch sections, Delete clears a binding. Controller: L1/R1 switch sections, Square/X clears a binding. Mouse: hover, click, drag sliders, right-click to unbind.
    • Changes apply at once and save when the screen is left.
  • Fatal Frame look. The header is the PS2 options screen's own roll of film (the mode select's strip and canister, read from the disc at run time and shared with the Load screen), with the title in Chancery. The palette is sepia, gold rules and the title menu's umber cursor bar, with film grain over it all. The decorative art is generated by tools/rml_art.py; nothing from the game is shipped.
  • Kept flows:
    • Window mode, window size and render resolution wait for Confirm, then revert by themselves after 15 s unless kept.
    • Image calibration (with the grey ramp) and the CRT filter open a side panel over the room; Back there undoes everything.
    • Binding capture works as before.
  • Translations: FR/DE/ES/IT have every new string, and the old all-caps labels are now sentence case.
  • The menu has one look now: the theme setting is "Overlay Theme" and only affects the ImGui overlay.

Aspect ratio

  • New Aspect Ratio setting in the options screen and the ImGui Display menu: Auto, Original (PS2 640x448), 4:3, 16:10, 16:9, 21:9, Custom. It is stored as renderer.aspect_mode / aspect_custom in mikupan.ini.
  • The render target takes the chosen shape; the existing Hor+ projection and letterboxing do the rest.
  • Default behaviour changes: under Auto the PS2 render sizes (640x448 and its multiples) keep their height and take the window's shape. Players who never touched the render resolution now get widescreen by default; Original restores the old frame.
  • The legacy mouse mapping now accounts for the bars.

HDR

RmlUi is drawn after the postprocess pass, straight onto the extended-linear swapchain, so with HDR on its sRGB colours came out washed out. The sprite shader now converts them to linear at the game's paper white when RmlUi draws (MikuPan_GPUSetUiHdrOutput, uFlags3.y). The menu backdrop's black measured (43, 37, 25) before and (5, 3, 2) after.

Notes for review

  • The four Claude skill files committed by mistake in earlier commits are no longer tracked (they are ignored by /.claude). They remain in those commits' history.
  • An <img> given its src while its RmlUi document is hidden is never drawn in this backend; the options screen sets the film's source only once it is shown.
  • The title side no longer draws ModeSlctDspFlm under the RmlUi options screen, which now draws the film itself.

Testing

PAL debug build (MSVC) on a 5120x1440 HDR display:

  • Scripted runs through every options section from the title.
  • Aspect ratio Auto and 16:9 (pillarboxed correctly).
  • Calibration and CRT panels.
  • The display keep/revert countdown.
  • Binding capture.
  • The in-game variant (opened from a test hook).

Not tested: controller navigation, the real in-game pause-menu path, other languages on screen, and whether the ImGui overlay has the same HDR issue.

🤖 Generated with Claude Code

wagrenier and others added 7 commits October 3, 2026 12:56
* Remove 99% of GS usage
* Stitch meshes together
FINALLY!!!!!!
They were committed before .gitignore ignored /.claude; they stay local.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wagrenier
wagrenier merged commit 5aeda8a into main Oct 29, 2026
4 checks passed
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