jgayfer / bevy_light_2d

General purpose 2D lighting for the Bevy game engine.
MIT License
175 stars 7 forks source link

Webgl2 performance issues #40

Open msandin opened 1 month ago

msandin commented 1 month ago

When using the plugin with the WebGL2 fallback on weaker hardware, performance seems to fall off a cliff. The performance is completely fine when using WebGPU or running natively on the same hardware. Examples:

In all cases switching to the regular Windows build fixes the problem, and in the laptop case I tried with WebGPU build in Chrome and that worked nicely.

Not using any lights doesn't save the performance, the problem occurs as soon as the plugin is loaded, which means it can't be easily "fixed" by making it a setting in a menu or automatically turning lighting of if the numbers are too bad. Making it possible to dynamically turn the effects of the plugin on/off would be useful for implementing that kind of solution.

jgayfer commented 1 month ago

Thanks for the write up!

WebGL2 will inherently perform worse, as there are quite a few limitations we have to workaround. That being said, we should still aim for it to perform reasonably.