11 ms·
WebGL 2.0 Achieves Pervasive Support from All Major Web Browsers
- tgflynn 5y agoWhat would be a major example of something that can be done with WebGL 2.0 but not 1.0 ?
- brrrrrm 5y agoI was curious about the same thing, here's a list I found: https://webgl2fundamentals.org/webgl/lessons/webgl2-whats-new.html https://webgl2fundamentals.org/webgl/lessons/webgl2-whats-ne... I guess a big one outside of graphics is integer textures and bit manipulations. The rest seems like general built-in additions.
- The_rationalist 5y ago
- moth-fuzz 5y agoAs someone who’s worked with many different OpenGL versions the big things I noticed were ‘missing’ from WebGL 1.0 are the following (some were available as extensions, but they are now standard): - uniform buffer objects. OpenGL is limited to how many uniforms you can pass to each shader via glUniform* calls, making things that use a lot of uniforms (such as skeletal animation or instancing) effectively a no-go. Uniform buffers enable uniforms to use much much more memory. - vertex array objects. Previously, you had to rebuild and respecify vertex attributes, in addition to actually pointing them to the right data, dynamically every frame. Vertex array objects capture all that state into one structure, which is usually built at the start of the program, so that it’s nothing more than a single pointer swap per-frame to render different kinds of models. It can be faster or slower depending on the hardware and driver but it’s faster for developers, at least. - depth textures. Previously the depth buffer was pretty much write-only, making things like shadow mapping impossible without hacks like writing the z-coordinate to an extra color buffer off-screen. - instancing. Now you can render many copies (‘instances’) of a model in just one draw call by passing a ‘count’ parameter, rather than making N draw calls. This is almost universally faster, where applicable.
- pjmlp 5y agoAnd still SpectorJS as the only debugging tool available, far behind native GPGPU debugging tools.
- royjacobs 5y agoDoes this diminish the results of all browsers shipping decent WebGL 2.0 support, though?
- fsloth 5y agoIt implies industry has little interest in actually supporting it. A GPU debugger is a critical tool in modern GPU development. Maybe they are holding on webgpu. People are carefully optimistic in it becoming the one API to be actually cross-platform.
- royjacobs 5y agoMaybe. It's not like the market for native graphical debugging tools is overflowing with options either, which is why I didn't understand OP's point that well. Additionally, with some careful coding you can already run WASM+WebGPU applications both natively (e.g. via wgpu-rs) and in the browser, so you can pick and choose the best tooling depending on your use case, so ultimately I guess that's going to be the way forward.
- jcelerier 5y ago> People are carefully optimistic in it becoming the one API to be actually cross-platform. idk I'm shipping code that uses the Qt RHI which works on D3D, GL, Metal, Vk ... cross-platform enough for me.
- pjmlp 5y agoBesides what fsloth replied, it is also 10 years too late, WebGL 2.0 is a subset of GL ES 3.0, released in 2010. So in 10 years, no browser vendor ever thought it was worthwhile improving their developer tools to support 3D developers. Firefox did have a toy debugger that they eventually killed and that was it.
- teddyh 5y agoSeems legit: https://caniuse.com/webgl2 https://caniuse.com/webgl2
- grenoire 5y ago87-88%, what's your point?
- teddyh 5y agoI was not being sarcastic.
- dvh 5y agohttps://en.wikipedia.org/wiki/Poe%27s_law https://en.wikipedia.org/wiki/Poe%27s_law
- stingraycharles 5y agoNow I’m confused, is this comment “I was not being sarcastic” actually sarcastic, and as such the original post as well?
- teddyh 5y agoNo.
- rwmj 5y agoSeems like an attack vector that I don't need. I turned it off in Firefox (about:config -> webgl.disabled == true)
- deleted 5y ago[deleted]
- deleted 5y ago[deleted]
- deleted 5y ago[deleted]
- baxuz 5y agoMight as well disable JS. It's also an attack vector.
- rwmj 5y agoI do that too, only enabling it on sites that need it. Finer-grained controls would be nice though. (I miss uMatrix ...)
- aidanlister 5y ago“How do you know if someone has disabled JavaScript? Don’t worry” the joke goes … “they’ll tell you”. There’s always someone in a browser tech thread that has to proclaim their security high ground to the unwashed masses. In my opinion, these comments do not add value to the discussion and should avoided.
- danielvaughn 5y agoWhy though? WebGL is already getting left behind for WebGPU.
- andybak 5y agohttps://caniuse.com/webgpu https://caniuse.com/webgpu
- danielvaughn 5y agoThat doesn’t matter at all, I’m talking about investment. Why continue to develop the older API while a new one is already underway? Sorry I just think it’s a waste of time and resources. What is WebGL 2 going to give us that WebGPU isn’t promising to deliver?
- stingraycharles 5y agoThey are not mutually exclusive, and organization can invest in developing both. WebGL also has the advantage that it’s immediately useful (lots of sites already using it).
- fizzynut 5y agoSomething that works now and will continue to work for years without changing any code. To turn this on its head, if I'm creating a new product now, why invest time into an API where by the time the product would be ready with WebGL, instead I chose WebGPU, so now have the risks: - The API is still years away from mainstream. - Doesn't solve anything for my use case that wouldn't be solved with WebGL. - Is too buggy to use on most configurations. - Isn't supported by X hardware or Y OS. - Has security issues that make browsers disable it for years. - The code has to be regularly updated/maintained/fixed when browsers update. - Performance could be lower for low end systems. - Even if everything worked, it's a lot more work to do everything (e.g. VULKAN). - To beat webGL, you have to optimise specifically for mobile/desktop/amd/nvidia/etc - The documentation is poor. - It's impossible to hire an expert in webGPU. - It's very expensive to test every combination of GPU/OS/driver so you have no confidence it is working correctly. Most rendering code should abstract to many APIs anyway, so not starting with a webgl version would be quite insane.
- marginalia_nu 5y agoSo how long until someone starts mining bitcoin on my GPU whenever I visit their site?
- cookiengineer 5y agoLots of scammy ad providers already mine monero in the background.
- easrng 5y agoThat's not true anymore. It isn't possible to mine with RandomX (The current Monero algorithm) in browsers and make much of any profit.
- account42 5y agoThey don't need to make much of any profit since they are not paying for the compute.
- seanw444 5y agoTrue. The "much of" part can be striked-out. "Any profit" is more than "no profit", hence the incentive still exists.
- easrng 5y agoNope, they still have to not heat up the user's device too much or whatever so they don't get suspicious. Ad (fraud?) would be vastly more profitable.
- zamadatix 5y agoProfit not revenue. Costs (or lackthereof) are irrelevant as the amount of profit is the amount of profit regardless of what factors led to that final profit number. The point is you'll never make more than a couple dollars even doing it at massive scale so nobody bothers whereas before there was enough incentive to actually do it.
- skywal_l 5y agoTo be clear, this article is triggered by the fact that Safari, the only major browser that did not support WebGL2, has landed support a few months ago. This was the major roadblock for WebGL2 acceptance of developpers looking to support all major browsers.
- deleted 5y ago[deleted]
- eole666 5y agoThis is excellent news. For years it was the only major browser with no WebGL 2 support : Chrome and Firefox support WebGl 2 since 2017 ... Most WebGL libraries have WebGL 1 fallbacks only to make apps run on Safari.
- mrspeaker 5y agoI can't believe it's actually happening - I was resigned to the fact it was dead. I once (4 years ago, sheesh) made a "Pure-JS, no-build-step-required Minecraft Thing": https://github.com/mrspeaker/webgl2-voxels https://github.com/mrspeaker/webgl2-voxels When I made it I needed to specify it "Requires ES6 modules and WebGL2 support." At the time I was sure WebGL2 was going to be widely available soon and that ES6 modules would probably never be supported!
- isodev 5y agoIt's cool that the work Safari team did will also help Chrome improve their implementation in the future. WebGL 2 enables a lot of great experiences (especially with AR and XR now becoming more of a thing). "Apple adopted ANGLE as the basis for Safari’s WebGL implementation, and as a result, their engineering team spent over a year making dramatic contributions to ANGLE’s Metal backend. Safari now runs WebGL on top of Metal on recent iOS and macOS devices. Collaborative work continues among the Apple and Google engineering teams, including adopting top-of-tree ANGLE into WebKit, creating a common codebase for development going forward, and switching Chrome to use ANGLE’s Metal backend as well."
- wffurr 5y agoANGLE has a bunch of great names for backends: MANGLE: ANGLE on Metal VANGLE: ANGLE on Vulkan SwANGLE: ANGLE on SwiftShader DANGLE?: ANGLE on Direct3D - dunno if anyone's ever called it that
- AshleysBrain 5y agoI think Le Hoang Quyen[1] deserves a shout-out for writing the initial implementation of ANGLE's Metal backend, which is now used to power WebGL in Safari. Impressive work! It looks like they got some recognition from Google already[2], which is nice to see. [1] https://github.com/kakashidinho https://github.com/kakashidinho [2] https://lehoangquyenblog.wordpress.com/2020/09/30/google-open-source-peer-bonus/ https://lehoangquyenblog.wordpress.com/2020/09/30/google-ope...
- ksec 5y agoDoes anyone know how far away is WebGPU from finalising? Are we even half way yet?
- solarmist 5y agoIt seems like trial implementations are in progress. But do you mean the spec or a released system? https://github.com/gpuweb/gpuweb/wiki/Implementation-Status https://github.com/gpuweb/gpuweb/wiki/Implementation-Status
- dezmou 5y agoI hope if apple took all this time it's for implement the specs correctly this time.
- truted2 5y agoLet me guess: premultiplyAlpha?