Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

fix: pma textures are requested to be loaded as already premultiplied #30

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

davidetan
Copy link
Contributor

A Spine atlas txt files that are generate in conjunction with the respective atlas textures contains a pma option that holds the information regarding the textures beinga premultiplied or not.
This information can be used to inform the texture loader to premultiply or not the texture on load.

This PR allows to use the pma information and to request to the pixi texture loader to premultiply the texture or not.

When webgpu is used, this is sufficient.
However, when webgl is used, it is necessary to set on PIXI.Assets the preferWorkers to false when Spine premultiplied textures are loaded because currently when createImageBitmap is used, the given alphaMode is ignored. This can be avoided if this other PR is merged: pixijs/pixijs#10803

If this PRs are merged, it would be cool if the blog news examples would be regenerated to use this fix. Currently, all textures have the problem of using pma textures, but are loaded without taking this in consideration.

Copy link
Member

@GoodBoyDigital GoodBoyDigital left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @davidetan 👍

@GoodBoyDigital GoodBoyDigital merged commit 6cca188 into pixijs:main Aug 1, 2024
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants