WebGL2 Fundamentals
webgl2fundamentals.org
webgl2fundamentals.org
This site was my bible for creating the 2D engine for Cat-Tastrophe: https://www.newgrounds.com/portal/view/861234
These are fantastic though: https://www.youtube.com/@osakaandrew/videos
(FTA, which contains no date.)
Please, authors, always, just put a date on your posts.
Why has this not triggered a revolution in browser games? It feels like the best browser games are still the ones from the Flash era.
Monetization.
So it was all obvious and encapsulated.
I would like a generally agreed upon encapsulated html standard. Single-file sites that can be served as simply as media.
You needed a recent gaming PC to run WebGL content. Why use it for that, when it could run vastly superior native games?
Initially we needed a young priest, an old priest and a lot of luck for the setup to work properly on anything except for specifically pinned versions of Chrome but these days you can just whip up any smartphone and all our models render just fine.
More advanced stuff that requires bleeding edge and to port old games, sure, but to relive the heydays of flash games every chance we had on the library computers?? Seems like we have had that possible for years now.
I was maybe 13 when I first used Flash (v3 in about 1999), way before I had much experience with "proper" coding. The fact that I could use it, the same tool professionals were using was what made it so special.
I'm sure it's coming.
I also built a lot of stuff in Flash/AS back in the day, and even rode the wave into AIR for a while.
The OOP system, event handling with spaghetti code, and high level graphics abstractions just never bothered me. Things worked, and the nature of the beast is I didn't have to worry about maintainability so much.
Nowadays it would be different. I don't think Flash or Actionscript would be quite as fun. For out of the box engines, Unity->WebGL is far more powerful imho.
PIXI.js and any compatible spritesheet animation package gets you more than halfway there, using the same OOP scene graph paradigm, for people who really miss the Flash approach. Not the same level of IDE integration, but, still..
At least least I looked at it, which was years ago, and successfully ported over some old flash apps.
In comparison the web of that time lacked tooling, robust support and easy routes to discovery and making comparable money. Web portals paid/pay pretty poorly.
I see an awesome opportunity for a minamalist immediate mode rendering library in the vein of Kha/XNA/Mono Game to deliver blistering 2D performance on WebGL, that an ecosystem can form around and build upon. Libraries like Phaser and Pixi attempt to give Flash like functionality but don’t offer the Flash like API stability, so as an ecosystem foundation they kinda suck. A library that merely implements a subset of the 2D canvas API, but performant and easily portable, would serve as the best foundation IMO.
https://github.com/BabylonJS/Babylon.js
In general, the tradeoffs are:
* WebGL is not always available and enabled in all browsers
* Spacial Audio effects and formats are inconsistent across platforms
* mouse/keyboard/game-pad support is tricky (browser security is messy)
* Rigging a mesh for animation gets computationally expensive
* Basic collision detection and snapping to surfaces is always computationally expensive, so to make it performant people use 90's style sphere/cube assumptions
* mutable textures are supported, but basic animated effects still bloat into video memory
* all game assets and runtime code are exposed to end users
Thus, most conclude JS+WebGL are incompatible with most commercial settings, and basic anti-cheat enforcement. Note, WebAssembly+webGL is marginally improved, but again further reduces the number of supported platforms.
People tend to prefer native App binaries, as unity3D/OpenGL can allow better content experiences without the added resource overhead. One could try to fight this trend, but Apple/Google/Microsoft want their cut... and will continually do things that enforce their bottom line.
Have a wonderful day... =)
So we’re mostly waiting on WebGPU support so we can use a more modern-feeling API. But by the time WebGPU becomes both itself standardized and then widely supported, well, who knows if it will still be relevant…
The web just unfortunately lags behind while still emulating desktop. It would be fine if it did it’s own thing entirely so we wouldn’t have anything to compare to but writing 3D for web just feels like writing 3D for desktop 10 years ago. Plus performance and security… it’s way easier to just drop a .exe on itch.io or whatever.
Don't expect mesh shaders, RT or something like nanite in the next 10 years after WebGPU 1.0 gets released later this year.
I'd suggest that the reason is monetization. People are used to buying phone apps and console games, but expect web pages to be free. And open source is good at software but not games.
People are fine waiting the 10-30 minutes for a game to download on Steam or console. But they don't want to wait more than a few seconds for webpages.
Also, techies understand that there's ways of agressively caching,but I don't think average users register that it's just a first-load issue.
It's slow to load, and you'll get lag when you move around a bit, and this is due to slow shader compilation, which I wasn't able to avoid with stock Godot 3.5. You can't easily multithread your WebGL application (at least not without a bunch of caveats), so the audio glitches as well. Additionally, streaming a lot of content while providing a good user experience is an extra design and technical challenge compared to downloading a native app.
Every shipping game is a miracle - by doing WebGL instead of native, you are adding a bunch of additional challenges. And for what? Players are just as happy to download a native build.
document.querySelector('.background').remove()
in the browser console (or use Reader Mode).Other things run fine, including samples from webglsamples.org.
WebGL2 Fundamentals - https://news.ycombinator.com/item?id=25251916 - Nov 2020 (2 comments)
WebGL2 Fundamentals - https://news.ycombinator.com/item?id=16085360 - Jan 2018 (74 comments)
A simple showcase of how to warm up CPU/GPU and speed up cooling fans.