Native WebGPU renderer for leaflet #9207
Replies: 2 comments 14 replies
-
I've spent an awful lot of time in https://gitlab.com/IvanSanchez/leaflet.gleo , so... I'm wary of what you're attempting. The most basic problems to solve in a WebGL/WebGPU renderer are the floating point precision issues (how are you going to deal with millimeter-precision geographical coordinates in float32 numbers?) and memory allocation issues (in Leaflet you can add any number of things to a map and then delete any one arbitrary thing). I recommend you read through https://webgpufundamentals.org/ and ponder about the issues I pointed out. |
Beta Was this translation helpful? Give feedback.
-
I have made some progress. I started with a WebGPU tile layer plugin, in which I now have ability to load tile images as textures to create a basemap. I used Gridlayer as a starting point to enable support for existing features as much as possible and of course to have already existing features available. Few things to note: To enable usage of cross-origin images as textures, I used WGSL 'loadExternalTexture' feature which has limited ability to access its data (have not really looked much into that yet). Another thing is that 'loadExternalTexture' takes currently, to my knowledge, only VideoFrame or video as uniform value. That might sound odd but that actually gives more flexibility because with VideoFrame it is possible to use zero-copy approach and videoframe also has convenient "close"-method which cleans up that from memory. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I would like to hear your opinion of this idea/proposal.
I'm up for the challenge on implementing lightweight native WebGPU renderer for the leaflet.
I have few years of experience working with WebGL solutions and shaders and as the WebGPU is slowly maturing, I would like to begin development with it as personal learning experience to achieve deep understanding of the native WebGPU development process. Goal is to achieve best possible performance with little-to-no library usage and keep things minimal while supporting existing features.
I'm probably going to do this "learning experience" anyways with something but the best motivation for me would be to have the work eventually on actual use and let the results benefit others aswell.
As the WebGPU still has no support in many browsers, I could make a fallback option to WebGL.
I'm aware that there are many forks and plugins that may already do this but I would really like to get hands-on with this and dive to the deep end so to speak.
So, let me know what you think of this and of course any tips and guidance are welcome!
Br. Matias
Slava Ukraini!
Beta Was this translation helpful? Give feedback.
All reactions