JoeMGomes Posted February 16, 2023 Share Posted February 16, 2023 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. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 16, 2023 Share Posted February 16, 2023 (edited) 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 February 16, 2023 by ivan.popelyshev JoeMGomes 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.