Jump to content

Switch between pma and straight in the same texture


JoeMGomes
 Share

Recommended Posts

Hello!
I want to pack my atlases as tightly as possible for my games and that unfortunately involves packing PMA and Straight sprites in the same image file. Is there a way to "switch" the blend state from one sprite draw to another? I come from a Monogame background and I know that this works there but could not find a way to do it in PIXI :(

The reason I need this also has to do with the use of pixi-spine and packing spine atlases with other sprites that do not use PMA.

Link to comment
Share on other sites

per-region switch is possible , you have to alter the renderer for it ) ask not "baseTexture.alphaMode" but "texture.alphaMode" , and put whatever you need there. its either PMA either NPM, not UPLOAD

If you dont have experience altering the renderer - here's one of my experiments: https://codesandbox.io/s/pixi7-custom-renderer-24nvhl

Though you dont need extra shader, you just have to copy interleave function from pixi itself and alter it. 

If you still have problems with this - I can make your case for $$$, because that's actual working time. Also I can help remove batches between those modes, because right now its handled in different drawcalls. 

Basically, you can pay for moving https://github.com/pixijs/pixi-heaven/tree/master/src to v7 and adding extra feature there for PMA/NPM auto-switch per-region

Edited by ivan.popelyshev
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...