Open AdamsLair opened 10 years ago
I've just committed some code to my fork of Duality to add premulitplied alpha support. You can check it out here - https://github.com/BraveSirAndrew/duality/commit/c9833ed4314e34301bcfe0f18af84111f29a9cab. If this approach works for you, I can submit a pull request, or if you had a better way in mind to do it, I'd be happy to change this.
Huh.. introducing a second Pixmap Layer is actually pretty clever. A nice thought indeed. Not sure about adopting it into the main branch though, I'd like to spend some more thought on the topic in general.
Cool, thanks:) This is working well for us now, but I'm interested to see how it can be improved upon. Incidentally, this also optimizes the loading of textures, as colouring transparent pixels or premultiplying only needs to happen once, and then it's stored in the pixmap, at the expense of double the storage, but that seems like a good trade off, especially as the load time of our levels increases. When we package for a platform, we can strip out the first layer from pixmaps automatically or per specific texture, so it doesn't increase the download size.
Note: This has to be revisited and re-conceptualized now that a lot of import functionality has been shifted out of Resource classes and into importers using the new AssetManagement API. Also, in the develop-3.0
branch, automatic atlas generation for Pixmaps has been moved into the import step, leading the way to potentially adding options for pre-multiplied alpha preprocessing.