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

Add support for PVRZ files #1099

Closed
lynxlynxlynx opened this issue Dec 12, 2020 · 1 comment · Fixed by #1767
Closed

Add support for PVRZ files #1099

lynxlynxlynx opened this issue Dec 12, 2020 · 1 comment · Fixed by #1767
Labels
feature feature request game: demo game: ees ee-specific bits and pieces system: animations

Comments

@lynxlynxlynx
Copy link
Member

lynxlynxlynx commented Dec 12, 2020

It's a format in use in EEs to avoid the limits of global image palettes. It would be useful already for our demo, since it's really annoying to have to deal with BAMv1 and degraded assets. Once PVRZ is supported, BAMv2 is trivial to implement, since it just uses the new data format, the rest is the same.

So far the data is using only DXT1 and DXT5 compression formats.

Useful links:
PVRZ on IESDP, discussions: PVR and PVRZ formats
And from Beamdog themselves in go (pvr, dxt): https://github.com/Beamdog/bgfileformats

@lynxlynxlynx
Copy link
Member Author

lynxlynxlynx commented Dec 12, 2020

The official docs are a hard to navigate maze and kinda useless:
https://github.com/powervr-graphics/Native_SDK
https://powervr-graphics.github.io/Documentation/SDKBrowser/Framework.html

Finally I did manage to find existing clean implementations for the texture decompression, just no standalone p'n'p libraries:
https://github.com/Benjamin-Dobell/s3tc-dxt-decompression (old, base for ffmpeg)
https://github.com/SoLaRGit/openS3TC (optimized + a few fixes)
https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/texturedsp.c (ffmpeg)

Doesn't look like ffmpeg supports whole pvr(z) files, but the two forum posts describe them well enough. We should just lift one implementation of decompression and write the little boilerplate ourselves.

edit: another implementation and list of resources: https://github.com/Sampsca/PS-BAM/blob/master/lib/PS_PVR.ahk
and another one, also for IE specifically: https://github.com/InfinityTools/go-ietools/blob/master/pvrz/pvrz.go
... which is using c++ libsquish for dxt decompression https://sourceforge.net/projects/libsquish/

@fizzet fizzet unpinned this issue Jan 31, 2022
@lynxlynxlynx lynxlynxlynx pinned this issue Mar 13, 2022
MarcelHB added a commit to MarcelHB/gemrb that referenced this issue Jan 7, 2023
MarcelHB added a commit to MarcelHB/gemrb that referenced this issue Jan 7, 2023
MarcelHB added a commit to MarcelHB/gemrb that referenced this issue Jan 7, 2023
@lynxlynxlynx lynxlynxlynx added this to the 0.9.2 - TBN milestone Jan 7, 2023
@lynxlynxlynx lynxlynxlynx unpinned this issue Jan 7, 2023
@lynxlynxlynx lynxlynxlynx linked a pull request Jan 7, 2023 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature feature request game: demo game: ees ee-specific bits and pieces system: animations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant