You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all.
I'm working on a game in p5 using WebGL. I've noticed that current versions of P5 are laggy, especially in Safari, however, if I back up to version 0.10.2 the game runs much more smoothly.
Question: Is this just the way it is and WebGL 2 has more features but is slower, or is there a "better practices" way to work with WebGL 2 that I'm not using?
If looking at my code helps, here's a relatively recent build on my website. http://www.joemckaystudio.com/awfultreefarmer/
I'm running this on an older (2019) intel mac laptop.
Thanks,
The text was updated successfully, but these errors were encountered:
We've added some new features since then, such as stroke caps and joins, which increase the complexity of things like lines and per vertex colors. There are some performance updates coming in the next version (#6230) but we've also found it hard to make further optimizations for sketches in general, where some systems see big gains while others slow down (#6162).
As for what to do about it, we've found that the biggest bottleneck tends to be CPU to GPU transfer. When drawing shapes in immediate mode, a lot of repeated work gets done each frame and gets sent to the GPU. A way to cache shapes on the GPU is to use p5.Geometry. There are some tutorials about that, and the next p5 version will start to add easier ways to build these (#6287), and in the mean time you can maybe try using this library for similar functionality: https://github.com/davepagurek/p5.buildgeometry
I'm going to close this for now for organizational purposes, but feel free to open new issues for optimizations that you can think of, or carry on the discussion in issues like #5975!
Topic
Hi all.
I'm working on a game in p5 using WebGL. I've noticed that current versions of P5 are laggy, especially in Safari, however, if I back up to version 0.10.2 the game runs much more smoothly.
Question: Is this just the way it is and WebGL 2 has more features but is slower, or is there a "better practices" way to work with WebGL 2 that I'm not using?
If looking at my code helps, here's a relatively recent build on my website. http://www.joemckaystudio.com/awfultreefarmer/
I'm running this on an older (2019) intel mac laptop.
Thanks,
The text was updated successfully, but these errors were encountered: