Re:Show HN: CandyGraph, a flexible, fast-by-default WebGL pl...
by c-smile on Sunday May 23, 2021 @01:28PM
(#27256804)
> It renders everything on the GPU, even axes and text.
Yeah, DOM needs immediate mode graphics. Like the one I've added to Sciter, this for example:
element.paintForeground = function(gfx) {
...
}
allows to custom draw a) on top of default element's content (note: any element, not just <canvas>), b) with the paint frequency (60 FPS) and c) on GPU directly - gfx there is the same graphics that HTML content uses.
So you can still use Context2D for GPU drawing without the need for WebGL.
Even you can push vertices on WebGL fast enough there are other problems, text measurement and rendering for example.
WebGL simply have no means for drawing texts.
So I've added Graphics.Text - attributed text layout that caches chars-to-glyphs and layout calculations...
Yeah, DOM needs immediate mode graphics. Like the one I've added to Sciter, this for example:
allows to custom draw a) on top of default element's content (note: any element, not just <canvas>), b) with the paint frequency (60 FPS) and c) on GPU directly - gfx there is the same graphics that HTML content uses.So you can still use Context2D for GPU drawing without the need for WebGL.
Even you can push vertices on WebGL fast enough there are other problems, text measurement and rendering for example. WebGL simply have no means for drawing texts.
So I've added Graphics.Text - attributed text layout that caches chars-to-glyphs and layout calculations...