liajoy Posted February 21, 2019 Share Posted February 21, 2019 Hello! i've found that a graphics have more than 300 graphicsData will be slow performance. But if seperate it to 3 graphics( a graphics have 100 grapchisData), it will be good. But why? Quote yeah, batches, add into container. Just assume that every Graphics is an extra drawcalls, and for PC i recommend 200 drawcalls max. At the same time, each update uploads whole graphics, so 1 Graphics is as bad as 10000. seems it explain why, but i didn't get it. Quote Link to comment Share on other sites More sharing options...
liajoy Posted February 21, 2019 Author Share Posted February 21, 2019 I wrote a POC of this. https://jsfiddle.net/zygujhb6/2/ there are four ways to do this: 1. just draw circle every times 2. convert graphics to sprite every times 3. separate graphics to many segment if graphicsData too larger 4. convert graphics to sprite if graphicsData too larger which way is the best? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 21, 2019 Share Posted February 21, 2019 We balance drawcalls, buffer binds, texture binds, shader binds, framebuffer binds that way webgl does not become clogged. I cant say more because it will start hours long lecture, try to find someone else Also it might be different for v5, especially if you change "PIXI.GraphicsGeometry.BATCHABLE_SIZE." to be bigger than circle points. It probably is bigger by default, if circle circumference is more less than 10 pixels per edge * 100 max points.... = 1000 pixels . Batched graphics has different balance. Quote Link to comment Share on other sites More sharing options...
liajoy Posted February 21, 2019 Author Share Posted February 21, 2019 Thanks a lot! Another question is sprite and graphics which has the better performance? For example, 1000 sprites vs a graphics with 1000 shapes vs 10 graphics with 100 shapes? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted February 21, 2019 Share Posted February 21, 2019 Are they moving? Quote Link to comment Share on other sites More sharing options...
liajoy Posted February 22, 2019 Author Share Posted February 22, 2019 yes they can move 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.