Sara Posted July 10, 2021 Share Posted July 10, 2021 Hello I want to upload the svg file to pixi and then when I zoom-in or zoom-out the quality does not change, I used pixi-svg5 but it slows down the system a lot And I use the use tag in svg Can you please guide me? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 10, 2021 Share Posted July 10, 2021 Point me to webgl renderer that does have good SVG performance. There isnt one. Switch off antialias - get bad quality. You can probably clone "pixi5-svg" and use with "pixi-smooth-graphics" and it'll allow to render it without default webgl anti-aliasing. Of course default way - how people usually do it - is to.. re-render SVG in canvas each time with different sifce and update the texture:) Copy SVGResource sources, make your own scaler there - its possible, but its not newbie material. I know that people made many solution for SVG but they mostly didnt share them, so, if you dont like pixi5-svg, and pixi-svg and other stuff available - please, share your solution when you solve it! Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 10, 2021 Share Posted July 10, 2021 Simplest solution: have your own canvas, resize it, re-draw svg each time, use "Texture.from(canvaS)" on pixi, call "texture.update()" each time you have to re-render it. Also, maybe, you dont need pixi in that case - did you look at Skia PathKit? Quote Link to comment Share on other sites More sharing options...
Sara Posted July 11, 2021 Author Share Posted July 11, 2021 thank you very much I use the use tag in svg which pixi-svg did not support, so I had to make some changes to this library. Maybe it's because of the slow changes I made to using the use tag If so, what do you suggest for rendering svg with the use tag? 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.