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

renderer: Implement texture replacement #3009

Merged
merged 2 commits into from
Oct 22, 2023
Merged

Conversation

Macdu
Copy link
Contributor

@Macdu Macdu commented Oct 20, 2023

Allows textures to be exported and imported on the fly using Vita3K. This allows texture packs to be created for games running using Vita3K.
There are two formats available for dumping textures:

  • png, easier to handle because any image viewer/editor can view/edit it. However it has a few drawbacks: loosing texture quality because of compression and conversion to 8-bit per component format. This format also does not support mipmaps and cubemaps.
  • dds, contains the raw texture (but if the raw texture was compressed, it will still be compressed in the dds file). it also supports mipmaps and cubemaps and more formats. But is harder to use (I basically need to use Gimp to look at the dumped textures).

It is possible to import textures using both the dds and png formats. In case both are present, the dds one will be preferred.

Texture exportation does not use any renderer (OpenGL/Vulkan) code and is completely rendering API agnostic. Texture importation works on both OpenGL and Vulkan (and most of the code is rendering API agnostic too).

textures are dumped to the shared folder / textures / export / game_id / hash.dds|png
Any texture in shared folder / textures / import / game_id / hash.dds|png will be imported provided the option is checked in the settings.

The options to enable importation/exportation and choose the export format are in the GPU tab of the settings.

@Macdu Macdu force-pushed the texture-replacement branch 3 times, most recently from f580733 to 4407a2c Compare October 20, 2023 14:29
Zangetsu38
Zangetsu38 previously approved these changes Oct 21, 2023
@Macdu
Copy link
Contributor Author

Macdu commented Oct 21, 2023

I improved the hashing function for texture dumping to never look at unsused pixels and corrected the streaming hash algorithm to use XXH3 instead of XXH64. The PR should be ready now.

@Macdu Macdu merged commit bfec3f6 into Vita3K:master Oct 22, 2023
7 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.

3 participants