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

Support Basis format files #69

Closed
jherico opened this issue Sep 28, 2019 · 5 comments
Closed

Support Basis format files #69

jherico opened this issue Sep 28, 2019 · 5 comments

Comments

@jherico
Copy link

jherico commented Sep 28, 2019

Basis universal is an open source GPU-oriented image format. Images are stored in a compressed format (with compressed sizes comparable to PNG) but can be transcoded to a variety of compressed GPU formats (ASTC, ETC2, BC3) or to RGBA.

This functionality allows developers to push a single asset to all platforms without worrying about which GPU compression formats are supported on the target.

The basis format itself can store multiple images and multiple mips, so it can be used comparably to DDS or KTX in functionality. In fact a single basis file can store an entire texture catalog of varying image sizes, although it would probably be reasonable to implement logic that just loads the first image in a file

@mosra mosra added this to the 2019.0b milestone Sep 28, 2019
@mosra
Copy link
Owner

mosra commented Sep 28, 2019

Hi, happy to see you here!

In case you haven't seen: #62 and #65 ... and for vcpkg at least, we're relying on your fork :)

I'm just now in process of integrating the first of those PRs (pushing to the next branch for a CI run soon -- in the next hour or so), the second one is waiting for review comments to be addressed. Next step after those is KTX2 support so these can be used inside glTFs in a standardized way (as last time I checked *.basis couldn't be put there directly, only via a "private extension").

In fact a single basis file can store an entire texture catalog of varying image sizes, although it would probably be reasonable to implement logic that just loads the first image in a file

That's done in these PRs already, however right now it's just the first mip for each (blocked by mosra/magnum#369).

@jherico
Copy link
Author

jherico commented Sep 28, 2019

Oh, cool. I didn't think to look in the PR tab since I assumed you'd have a tracking issue.

I brought it up because I'm working on a set of OpenXR examples. Since I want the code to be focused on the OpenXR API and not go too far into the weeds on how to render a scene I've been trying to sort out what to use as a rendering backend and Magnum seems like a good fit, but I also wanted to make sure I used basis and gltf for all assets, so good to hear work is in progress. Thanks.

@mosra
Copy link
Owner

mosra commented Sep 28, 2019

The web player has a support now, if you want to check it out on random files: https://twitter.com/czmosra/status/1178089815021178884 (issue reports very welcome!)

Current magnum master (last push from ~1h ago) has additional compressed texture formats and some scaffolding needed by Basis added, and the next branch of this repo has the plugin working (and CIs seem to be mostly happy). I still need to do a bunch of minor updates and commit the glTF support (which the web player has already), so ~ during tomorrow it could go to master.

There's one unresolved issue about Y flip on importer that I'm planning to PR to Basis itself but as long as you pre-Y-flip during encoding, it won't bother you -- it's more an issue for general viewers/players that can't control how the file was produced.

@mosra
Copy link
Owner

mosra commented Oct 2, 2019

#62 is merged now, docs for it are up as well.

The converter part from #65 not yet, plus there's some work left to be done on the Basis side (see #70). Keeping this open until those two are resolved.

@mosra
Copy link
Owner

mosra commented Oct 15, 2019

#65 is now merged, and since mosra/magnum@dac61f5, the magnum-imageconverter utility now supports passing options to it. So it can be used as a full replacement to the basisu tool, with support for many more input formats than just PNG.

What's left is #70 (and BinomialLLC/basis_universal#79), but those are just minor interoperability issues, not blockers. So with that I'd consider Basis support being ready. I'm preparing a stable release with all this in the next week or so, subscribe to mosra/magnum#340 for updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants