Re:Show HN: ChartGPU – WebGPU-powered charting library (1M p...
by akomtu on Thursday January 22, 2026 @04:08PM
(#46725151)
That's what EXT_float_blend does. It's true, though, that you can't find the global min/max in webgl2. This could be done, theoretically, with mipmaps if only those mipmaps supported the max function.
[ Parent
| on HN ]
Re:Show HN: ChartGPU – WebGPU-powered charting library (1M p...
by vanderZwan on Friday January 23, 2026 @07:23AM
(#46731654)
Couldn't you do that manually with a simple downscaling filter? I'd be very shocked if fragment shaders did not have a min or max function.
Repeatedly shrinking by a factor of two means log2(max(width, height)) passes, each pass is a quarter of the pixels of the previous pass so that's a total of 4/3 times the pixels of the original image. Should be low enough overhead, right?
Re:Show HN: ChartGPU – WebGPU-powered charting library (1M p...
by akomtu on Friday January 23, 2026 @02:24PM
(#46736631)
Sure, that will work, but it's log2 passes + temp framebuffers. As for overhead, I'm afraid it will eat a couple fps if you run it on every frame. In practice, though, I'm not sure that finding the exact maximum is that valuable for rendering: a good guess based on the dataset type will do. For example, if you need to render N points that tend to congregate in the center, using sqrt(N) as the heuristic for the maximum works very well.