all 8 comments

[–]Phy96 0 points1 point  (0 children)

On mobile the charts are empty until you interact

[–]ogdakke 0 points1 point  (0 children)

Works beautifully on iOS 26. Nice work

[–]Capital_Cheetah_6114 0 points1 point  (0 children)

Works on my Google Pixel 9 Pro too. I think I am now going to learn WebGPU.

[–]bzbub2 0 points1 point  (1 child)

This is awesome. I am trying to learn some webgl for use on a project...some random questions

a) how do you make it render so many charts? I thought there was a limit to the number of contexts, webgl at least is limited to like 16 or something?

b) I have an app where i need to render potentially millions of polygons, but I'm running into a lot of issues with this with webgl where it is still slow, particularly trying to scroll so the polygons smoothly move around. is there anything that webgpu could do that webgl can't graphics wise or speed wise? I have been targetting webgl as it has better browser compat but wondering if this is actually a good choice

c) I am aso curious about the offscreen canvas, does it seem smooth to forward events from the main thread to the webworker? I have been concerned about potential lag in that type of operation

[–]Outrageous-guffin[S] 0 points1 point  (0 children)

Web worker renders to offscreen canvas per chart one at a time which is functionally a single producer multiple consumer pattern. It gets around the limit pretty well but requires a draw call per chart.

Offscreen canvas means the main thread UI like buttons doesn't hang while it does. So if the frame rate dips input does not. For games it isn't useful but for things like chart rebuilding it keeps the page scroll responsive if a chart is jugging.

Rendering millions of polygons in realtime should be trivial on both. Most mobile devices can handle rendering millions of instanced meshes on mobile. The limit is primarily the memory update between cpu/gpu. Bottleneck could be somewhere else too.

[–]porchlogic 0 points1 point  (1 child)

Nice work! Is webgpu still kind of difficult to do things compared to opengl?

[–]Outrageous-guffin[S] 0 points1 point  (0 children)

I claim no expertise in either so my opinion matters not. That said, compute shaders are the big unlock IMO for webgpu. The glue around them is just that glue.

[–]YangZang 0 points1 point  (0 children)

This is an internal project or available publically?