Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decompiler: add texture merging feature #3083

Merged
merged 2 commits into from Oct 12, 2023

Conversation

xTVaser
Copy link
Member

@xTVaser xTVaser commented Oct 11, 2023

This adds a new feature to the decompiler to complement texture replacement with what I'm calling texture merging.

Instead of taking a PNG and using it's data to fully replace an existing texture, we instead only replace the pixels that are non-transparent from the merge image.

This might be useful in a few other situations, but what I'm interested in using it for is expanding the game's font without having to commit any of the existing texture assets, just merging in individual new characters.

For Jak 1, there isn't much empty room available and I'm not sure how easy it would be to support larger font-textures. But in Jak 2, across all font.24* textures, there are over 200 unused character slots.

In some ways, this is an interim workaround because adding brand new textures to the game is non-trivial (ie. adding entire new font textures would allow for unlimited characters!).

Comment on lines +301 to +307
// Merge textures before replacing them, in other words, replacements take priority
auto texture_merge_path = file_util::get_jak_project_dir() / "game" / "assets" /
game_version_names[config.game_version] / "texture_merges";
if (fs::exists(texture_merge_path)) {
tex_db.merge_textures(texture_merge_path);
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you might need to add this to the extractor too

@xTVaser xTVaser merged commit 60eaac8 into open-goal:master Oct 12, 2023
10 checks passed
@xTVaser xTVaser deleted the v/texture-merges branch October 12, 2023 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants