Dev.to WebDev πŸ›  Dev πŸ‘ 0 πŸ“– 2 min read

How 3D Games Run in a Browser Tab With No Download

If you stopped paying attention to browser games around the time Flash died, you may be surprised by what a tab can do now. Full 3D worlds can load from a link, run on a Chromebook and work on a phone. Here's how it work

How 3D Games Run in a Browser Tab With No Download

If you stopped paying attention to browser games around the time Flash died, you may be surprised by what a tab can do now. Full 3D worlds can load from a link, run on a Chromebook and work on a phone. Here's how it works, in plain language.

The old way: plugins

For years, browsers couldn't really do games by themselves. They relied on plugins such as Adobe Flash, which you installed separately. When browsers and Adobe dropped Flash at the end of 2020, games built on it stopped working. TechRadar covered how the Internet Archive stepped in to save Flash games using an emulator.

The new way: built into the browser

Modern browsers have graphics support built in. The key piece is WebGL, a standard that lets a web page use your computer's graphics card directly, with no plugin. MDN has a WebGL tutorial if you're curious what the code looks like.

In simple terms:

  1. The page sends the graphics card a list of shapes, mostly tiny triangles.
  2. Small programs called shaders work out where each point goes on screen and what colour each pixel should be.
  3. This repeats many times a second, and that's your moving 3D world.

Most developers don't write all of this by hand. Libraries such as Three.js, or engines that can export to the web, take care of the low-level work.

Why there's "no download"

There's still a download. You just don't notice it. Your browser fetches the models, textures, sounds and code in the background, then stores them in its cache, so the next visit is much quicker.

That's why size matters so much. A game might be tens of megabytes where a console title takes up tens of gigabytes. Developers shrink everything: fewer triangles, smaller textures, compressed audio. One example is 3D Purble Place, which lists about 17 MB for the first load and then caches it.

A low-poly candy town running in a browser, from 3D Purble Place

Why it's safer than an installer

A web page runs in a sandbox. It can't read your files or change your system settings. It needs your permission for things like your camera. A downloaded program from an unknown site gets far more access, which is why a browser game is usually the lower-risk choice. It isn't risk free, because dodgy sites can still have bad ads and scam pop-ups.

Where it still falls short

Performance. A browser adds overhead. A big open-world game still needs a native app.

Memory limits. Browsers can only use so much, and phones have even less.

Old hardware. A very old graphics chip might not support the required features.

Saving. Progress is usually kept in browser storage, so clearing your data can wipe it.

What's next

WebGPU is the newer standard. It gives developers more direct access to modern graphics hardware and should make browser games even more capable. It's already available in the major browsers to varying degrees.

For players, all you really need to know is this: a link is now enough. There's no installer, no plugin and no account, just a game on whatever device you have. In a way, it's the Flash era's easy access coming back, this time built into the browser itself.

πŸ“° Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.