D.A.P.S. GAMING MAGAZINE

Features

How a 3D game runs inside your browser

From WebGL in 2011 to Three.js: the technology that lets a 3D game open with one click and no installation.

A wireframe cube and sphere on a perspective grid against a blue background
Image: Original D.A.P.S. illustration

Not long ago, playing a demanding 3D game usually meant downloading a program. Today a link is enough. A 3D pinball table or a billiards table opening inside a Chrome tab is possible thanks to two technologies: WebGL and a library such as Three.js.

What WebGL is

WebGL (Web Graphics Library) is a JavaScript API for interactive 2D and 3D graphics in any compatible browser, with no plug-ins. It works with the rest of the page: a WebGL element can be combined with ordinary HTML elements. A program consists of control code in JavaScript and shaders, small programs in the GLSL ES language that are executed by the graphics card (GPU) rather than the main processor. That is where the real drawing work happens: every vertex and every pixel passes through a shader.

The history in three steps

  • 2006-2007: Mozilla's Vladimir Vukićević demonstrates a “Canvas 3D” prototype. By the end of 2007, Mozilla and Opera each have their own implementation.
  • 2009-2011: in 2009 the non-profit Khronos Group starts the WebGL Working Group, with participation from Apple, Google, Mozilla, Opera and others. Version 1.0 of the specification is released in March 2011.
  • 2017-2022: the WebGL 2 specification, based on OpenGL ES 3.0, is finished in January 2017. On 9 February 2022 the Khronos Group announces WebGL 2.0 support from all major browsers.

Since 2024 a newer API, WebGPU, has been in development to succeed it, with a more modern interface and direct GPU access.

So why Three.js?

WebGL is low-level: to draw a cube you need dozens of lines of code for buffers and shaders. Three.js is a JavaScript library that hides that complexity and offers ready-made concepts: scene, camera, lights, materials, models. It was first released on GitHub in April 2010 by Ricardo Cabello. Its roots lie in the demoscene of the 2000s: the code was originally written in ActionScript for Flash and ported to JavaScript in 2009. It is available under the MIT licence and runs in every browser that supports WebGL 2.0.

How we use it at D.A.P.S.

The 3D Originals from D.A.P.S. Game Studio, such as 3D Pinball Arcade and 3D Billiards & Snooker Pro, are written with Three.js and use models made in Blender. That is why they need a computer with a keyboard and mouse and a browser with WebGL2 (Chrome or Edge). There is no installation, sign-up or account. Progress is stored only in your own browser.

What it means for the future

WebGL does not replace big console games, and does not try to. But it makes a whole genre possible: games that open instantly, are shared with a link and run anywhere there is a browser. With WebGPU on the horizon, the room for more demanding graphics inside the browser will keep growing.

D.A.P.S. 3D ORIGINALS

Play in the Games Room

Free 3D games from D.A.P.S. Game Studio, made for PC, no sign-up. The games themselves are in Greek.

Games Room

Keep reading