-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When you set blendMode equal to DST_OUT for sprite, you need to set filters for the parent Container. Is this a bug? #20
Comments
You want to erase something without touching background color, right? You need a extra renderTexture, yours or from a filter, on your big container. You dont have to add it to all containers, just the top one. Lets take only one pixel, that was colored orange, then drawn red. You want to erase red to get orange back, but where exactly do you want this info about past "orange" to be stored? Also in your demo you use main bundle "pixi.js", not "pixi-legacy.js", so "forceCanvas:true" wont work there. |
welcome to webgl. You cant have antialiasing not in main framebuffer. https://github.com/pixijs/graphics-smooth partially saves the problem (please read README and dont just apply it), or you can just enable MSAA in that filter (msaaQuality or some other field? we added it), but that's memory, or you can just generateCanvasTexture() brushes if you have "pixi-legacy"
The best way so far is to store renderTexture or better grid of renderTextures, and do all drawing operations there. Put many brush sprites in the same drawcall to save performance, like your curve from last frame to current one is approximated with 10 brush sprites - do them in same container. If you develop something |
I am using pixi (6.1.2) to implement a drawing board. My current approach is to use Graphic to implement the brush, and then convert it to Sprite. The eraser also converts Graphic to Sprite and then sets blendMode=PIXI.BLEND_MODES.DST_OUT, but now I encounter One question, I must set a filter on the Container to make DST_OUT take effect. When there are many Containers on the page with filters set, the FPS of the page will drop significantly. I want to ask if there is a way to avoid using filters to make blendMode take effect. Hope to get your help, thank you very much.
Here is a demo I wrote about setting blendMode: https://codepen.io/shenfusheng/pen/bGRLzWz
The text was updated successfully, but these errors were encountered: