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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading