I want to premise this not so much as a feature request, but as a discussion about how I might approach a potential PR presenting this feature. In large part this is also a Starling discussion, as these features impact it too.
Adding basic support for KTX1 wasn't all that difficult, and I have a working proof-of-concept parsing the KTX1 container with DXT1 and DXT5 encoded textures. KTX1 as a container type seems like an ideal first step, as it naturally supports all formats ATF currently supports, with the addition of newer formats like BC7 and ASTC.
My goal is three fold:
- Firstly and broadly speaking, efforts to help OpenFL / Starling remain up-to-date with modern standards.
- Implement support for a standard open file format, such as KTX, as support for ATF was dropped more than two years ago by tools such as TexturePacker. The baseline goal here is to at least support the same texture compression options as ATF. In effect, introduce KTX1 parsing, but then use existing GPU texture pipelines.
- Then, open the door to adding support for modern GPU texture compressions, such as BC7, ASTC, KTX2 (Basis-U), etc.
Here's the issue
I've hit a road-block with how to best approach a PR, and I wonder it may be better to provide a proof-of-concept before a PR is even considered (let me know please).
I believe there are two ways of approaching this. The issue stems from OpenFL and Starling codewise assuming only a single GPU texture format exists: ATF. It's not currently designed for the possibility of another (or even many more). I'm mindful Starling is designed to be lean, and I hope to keep it that way.
With that in mind, the options are:
- Leave existing ATF classes and methods untouched and implement additional classes and handlers for each new format (beginning with KTX1).
- Refactor to a unified GPU texture pipeline that is no longer ATF focused and has scope to evolve as newer standards become available.
- Do both. Leave ATF groundwork in place, but all new GPU texture formats and codecs use a unified pipeline.
Option 2 and to a degree 3, would avoid a lot of duplication which would have introduced maintenance overhead. It also avoids turning classes like starling.textures.Texture into the kitchen sink, having to parse and conditionally identify and manage multiple formats.
The changes in an option 2 unified approach would be fairly wide-sweeping. I want to check first if the team has an appetite for such a thing, whether it be KTX1 support at all, or refactoring to a unified GPU texture pipeline.
~ Bink
I want to premise this not so much as a feature request, but as a discussion about how I might approach a potential PR presenting this feature. In large part this is also a Starling discussion, as these features impact it too.
Adding basic support for KTX1 wasn't all that difficult, and I have a working proof-of-concept parsing the KTX1 container with DXT1 and DXT5 encoded textures. KTX1 as a container type seems like an ideal first step, as it naturally supports all formats ATF currently supports, with the addition of newer formats like BC7 and ASTC.
My goal is three fold:
Here's the issue
I've hit a road-block with how to best approach a PR, and I wonder it may be better to provide a proof-of-concept before a PR is even considered (let me know please).
I believe there are two ways of approaching this. The issue stems from OpenFL and Starling codewise assuming only a single GPU texture format exists: ATF. It's not currently designed for the possibility of another (or even many more). I'm mindful Starling is designed to be lean, and I hope to keep it that way.
With that in mind, the options are:
Option 2 and to a degree 3, would avoid a lot of duplication which would have introduced maintenance overhead. It also avoids turning classes like starling.textures.Texture into the kitchen sink, having to parse and conditionally identify and manage multiple formats.
The changes in an option 2 unified approach would be fairly wide-sweeping. I want to check first if the team has an appetite for such a thing, whether it be KTX1 support at all, or refactoring to a unified GPU texture pipeline.
~ Bink