Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's even more offloaded in browsers as I expected.

I recently had to do a proof of concept displaying a huge gantt chart (I really mean huge!).

Normally, 2D drawing has some disadvantages with textures and scaling/rotating.

This proof of concept included testing out various methods on the <canvas>, including both using WebGL and standard 2D calls.

To my surprise, I was able to get the standard 2D calls way faster, even with texturing and rotations (which I did not expect). All browsers (Chrome, Firefox, Edge, IE) do GPU optimizations with standard 2D canvas drawings.

Only when I was putting a shitload of different things on there (gantt chart looked more like a barcode at this point), the WebGL implementation started to outperform the 2D calls.

Remark that I didn't go into programming shaders. In the end, it wasn't necesarry since the normal canvas calls already supported plenty of performance.

Also remark that I'm not just some random dude with no experience. I'm creating a game dev tool https://rpgplayground.com, which runs fully in the browser using Haxe and the Kha graphics library, and made plenty of games during my career.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: