🧊WebGL
Also known as Web Graphics Library, WebGL 2
A web standard that lets pages draw 3D with the graphics card. No plug-in is needed.
Think of it like
It is like a back door from a web page straight to the graphics card.
Example
A car maker's site lets visitors spin a 3D car and change its paint. WebGL draws each frame in the browser.
Why it matters
It is why 3D product viewers, maps and games can run inside a normal web page.
Definition
Example code
javascript
const canvas = document.querySelector("canvas");
const gl = canvas.getContext("webgl");
console.log(gl ? "WebGL is ready" : "No WebGL here");Common mistake
Key takeaways
- 1Graphics card from the web. No plug-in.
- 2Draws into a canvas. Part of the page.
- 3Low level. Usually used through a library.