jgayfer / bevy_light_2d

General purpose 2D lighting for the Bevy game engine.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WebGL2 Support

jgayfer opened this issue · comments

Right now we only support wgpu, as we're using a storage buffer in our shader, which WebGL2 doesn't support.

If we swap this to a uniform buffer (ideally with a feature flag), we should be able to get things running with WebGL2.

From #5

Turns out that passing in a runtime sized array into a uniform buffer isn't a supported operation. Sounds like we'd need to get tricky with storing the array of point lights in a texture, and reading the data from there.

There's also the consideration that to support WebGL2, we wouldn't be able to use compute shaders, which I've been hoping to take advantage of for light occlusion.

I'd love to support WebGL2, but I don't currently have a strong understanding on how to reasonably sidestep the limitations.

TL;DR - There's ways to get WebGL2 support, but they're trickier than anticipated given our current implementation.