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

Commit

Permalink
fix: pma textures are requested to be loaded as already premultiplied (
Browse files Browse the repository at this point in the history
  • Loading branch information
davidetan authored Aug 1, 2024
1 parent 0bdbab1 commit 6cca188
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/assets/atlasLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,15 @@ const spineTextureAtlasLoader: AssetExtension<RawAtlas | TextureAtlas, ISpineAtl
// eslint-disable-next-line max-len
const url: string = providedPage ?? path.normalize([...basePath.split(path.sep), pageName].join(path.sep));

const pixiPromise = loader.load<Texture>({ src: url, data: metadata.imageMetadata }).then((texture) =>
const assetsToLoadIn = {
src: url,
data: {
...metadata.imageMetadata,
alphaMode: page.pma ? 'premultiplied-alpha' : 'premultiply-alpha-on-upload'
}
};

const pixiPromise = loader.load<Texture>(assetsToLoadIn).then((texture) =>
{
page.setTexture(SpineTexture.from(texture.source));
});
Expand Down

0 comments on commit 6cca188

Please sign in to comment.