Skip to content

KH1 fixed custom face patches turning gray, due to kh1's fixed scale - #1308

Open
Kite2810 wants to merge 1 commit into
OpenKH:masterfrom
Kite2810:master
Open

Kite2810 wants to merge 1 commit into
OpenKH:masterfrom
Kite2810:master

Conversation

@Kite2810

Copy link
Copy Markdown
Contributor

Problem is, on PC, the top byte of KH1 remastered asset original offset is NOT part of the offset. It's an index into the games table of ps2 texture sizes. The game uses this size to work then out each HD textures scale. (HD width ÷ PS2 width)

A face patch frame is now only copied onto it's Texture when both have the same scale, if the scale should differ, then the frame is skipped and the face will blink gray on every frame it will be picked. (similar to KH2)

Panacea kept the retail indexes when it replaced a dds texture, so a custom models texture inherited the original characters PS2 size.

So for example: Sora's face Texture uses index 7 (256x256, HD 1024x1024 texture times x4) A 512x256 replacement keeps index 7 and counts then as x2, so every patch frame was skipped.

So the new fix is that panacea reads it's width and height from the dds header and finds the table entry and if it's a multiple of 4, then 2, 8 or 1, then writes that index into the top byte of origOffset;. the offset itself, the low 24 bits will be unchanged.

oh yeah tested on Steam AND Epic. Tested with my Custom Ventus at different scale and frames. Completely custom. tested with 32x32, 128x64, 80x40 resolutions, via debug log, to check what the game actually holded and why it skipped.

PS: Hopefully my last fix, I can't stand kh1 :s0wa:

Problem is, on PC, the top byte of KH1 remastered asset original offset is NOT part of the offset. It's an index into the games table of ps2 texture sizes. The game uses this size to work then out each HD textures scale. (HD width ÷ PS2 width)

A face patch frame is now only copied onto it's Texture when both have the same scale, if the scale should differ, then the frame is skipped and the face will blink gray on every frame it will be picked. (similar to KH2)

Panacea kept the retail indexes when it replaced a dds texture, so a custom models texture inherited the original characters PS2 size.

So for example: Sora's face Texture uses index 7 (256x256, HD 1024x1024 texture times x4) A 512x256 replacement keeps index 7 and counts then as x2, so every patch frame was skipped.

So the new fix is that panacea reads it's width and height from the dds header and finds the table entry and if it's a multiple of 4, then 2, 8 or 1, then writes that index into the top byte of origOffset;. the offset itself, the low 24 bits will be unchanged.

oh yeah tested on Steam AND Epic. Tested with my Custom Ventus at different scale and frames. Completely custom. tested with 32x32, 128x64, 80x40.
@coderabbitai

coderabbitai Bot commented Nov 15, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f7c09a0f-710a-49f0-b593-a6fc08c74e65

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch has not been deployed

No deployments
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