Draw the map with WebGL2 by default, with the 2D canvas as fallback
- Sea, land, waves, clouds, cables, tubes and packets are drawn by the graphics card; the land is geometry built once, so panning and zooming repaint nothing. - Cities, labels and markers are painted once into a sprite atlas and drawn in one call (with drawImage in 2D, which speeds up the 2D map too). - Settings > Map drawing: Auto or Always 2D, per device. Browsers without WebGL2, a lost context and puzzles keep the 2D map. - npm run bench:gpu compares 2D and WebGL in a real browser on a real GPU; ?fps shows a frame meter.
This commit is contained in:
parent
7aa6506e70
commit
cf9ab5e774
36 changed files with 862 additions and 83 deletions
|
|
@ -17,6 +17,8 @@ body{margin:0}
|
|||
body{background:var(--sea);color:var(--ink);font-family:var(--body);overflow:hidden;font-size:14px;-webkit-font-smoothing:antialiased}
|
||||
#map{position:fixed;inset:0;width:100%;height:100%;touch-action:none;display:block;cursor:grab}
|
||||
#map.linking{cursor:crosshair}
|
||||
/* The WebGL tubes and the 2D overlay above them (58-webgl-links.js): pictures only, the map underneath takes the pointer. */
|
||||
#mapgl,#mapfx{position:fixed;inset:0;width:100%;height:100%;pointer-events:none}
|
||||
.num{font-variant-numeric:tabular-nums}
|
||||
h2,h3,h4{font-family:var(--display);margin:0;text-wrap:balance;line-height:1.1}
|
||||
button{font:inherit;color:inherit}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue