4 ms·
This article is sort of rambly but I agree with it. WebGL is the best way to talk directly to the GPU not through CSS3 transforms. Any experienced developer w
by bhouston 13y ago
This article is sort of rambly but I agree with it.
WebGL is the best way to talk directly to the GPU not through CSS3 transforms. Any experienced developer would be pretty insane to try to supplant a 20 year old community effort (OpenGL) for efficient GPU communication, especially one that has involved deeply all the GPU vendors.
NOTE: My company has bet big on WebGL and Three.JS so I am biased in this regards: http://clara.io http://clara.io
- harwoodleon 13y agoI would argue that the DOM is broken for current requirements and their approach is actually quite sensible - circumvent it. What I would have like to have seen is a proper, UX designer led update to hardware accelerated UIML language that is not 3D and is not HTML. This project takes a good step in that direction, in the same vein that Bootstrap and others have. Lots of programming and design hours are wasted because the DOM is intended for Documents and not user interfaces.
- acjohnson55 13y agoTrue, but I think it's crucial to be able to embed these Documents efficiently in the user interface, with all the text interaction people are used to, and vice versa. Perhaps that's the future of webapps.
- lhnz 13y agoWhat I don't understand is why we don't just skip the DOM. And by that I mean, currently people are using virtual DOMs like that provided by React.js however this still has to access the DOM when it wants to render, but couldn't we rewrite a DOM/CSS renderer with WebGL (or canvas)? Or perhaps just skip that step and come up with something nicer for specific use cases. Why aren't we leaving all of this float/clear stuff behind us?
- bhouston 13y ago> couldn't we rewrite a DOM/CSS renderer with WebGL (or canvas)? Of course we can. :) But writing full UIs are tons of work. Why are there no OpenGL UI libraries in wide use on desktops? The same argument should apply to a degree? Or is it just that HTML5 is way less efficient that GUI+, Swing, etc.
- potatolicious 13y agoThere are "OpenGL UI libraries" :P It's called OSX. The main reason why we haven't seen more is because OpenGL up until now has been largely in the sphere of gaming, where standardized UIs aren't a priority. That being said, even in gaming there are a large number of libraries available that help you implement UIs.
- bhouston 13y agoAh, cool. I'm not an OSX developer. The OpenGL UI libraries I've seen on Windows are pretty horrible/limited. Those in games are usually based on Scaleform and are also relatively limited in terms of built-in functionality, although it has wide freedom of design: http://gameware.autodesk.com/scaleform http://gameware.autodesk.com/scaleform
- United857 13y agoThere is an experimental "render DOM content to texture" extension supported by Mozilla called drawWindow that should solve a lot of this. https://blog.mozilla.org/tilt/ https://blog.mozilla.org/tilt/ https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D#drawWindow() https://developer.mozilla.org/en-US/docs/Web/API/CanvasRende... Unfortunately it is not yet available for web content (browser extensions only).
- bgarbiak 13y agoIt's an open question if Apps are more like documents, or more like raster (canvas), vector (SVG) or 3D (WebGL) graphics? I could argue that in most cases the former is the right answer. Calculating DOM is (well, I'm just guessing here) no more resource intensive than calculating word wrapping and text justification in retina quality canvas.
- jkrems 13y agoI can only speak from early teen years looking at computer game UIs. It's way harder to make a UI work in "native" ways than it appears at first sight. Especially if you do very manual rendering instead of relying on float/clear stuff. There are reasons that many people are going more and more into the embed HTML-controls into native UIs direction. One example: Your own renderer will have to handle text selection, cursor movement, and mouse interaction in exactly the way the surrounding platform does. Including things like "I'd expect Ctrl+A to jump the the beginning of this textbox".