Files
gods-eye-view/public/sprites/aircraft-views.json
T
Mazeyar Moeini FeizabadiandClaude Fable 5.2 efdac0ba70 feat(aircraft): draw far-away aircraft as shaded sprites seen from the camera's angle
Aircraft on the map were flat, top-down SVG silhouettes turned along
their course: from an oblique camera they read as paper cut-outs lying
on the ground.

Each aircraft class (and each helicopter rotor frame) is now rendered in
Blender from a sphere of directions into one sheet of shaded sprites
(public/sprites/aircraft-views.webp: 302 views a class, 7.5 degrees
apart from straight above to 30 degrees below the horizon, 4096 x 3648,
grey, 3.1 MB). The renderer lays a contact flat on the ground along its
course, works out where the eye is in that frame and draws the nearest
view, mirrored for the port side. The view is a card standing at the
contact, square to the direction it was rendered from, so between views
the sprite is tilted (foreshortened and turned) as the aircraft would
be; views are not blended. Sprites are neutral, so the fleet, tracked
and military tints still apply.

Renderer: a new `viewSheets` capability, `DrawPort.views(id, sheet)` and
an image `{views, first, fallback}` for icon items (src/data/viewSheet.js
holds the layout and maths, in JS and GLSL). A view row draws from the
sheet's own texture, kept as luminance and alpha; until the sheet has
loaded, and if it cannot load, it draws its flat `fallback` along its
course as before. View sheets are offered on WebGL 2 only, and on
WebGL 1 the icon shader is as it was.

Layers: Flights, Military Flights (fleet and tracked contact) and Local
ADS-B draw views; the TR-3B, airport vehicles, ground stations and
Cockpit's far pips stay flat, as does any renderer without the
capability.

Tools: `npm run build:aircraft-views` bakes the sheet from the repo's
own fleet models (about 7 minutes); scripts/qa-aircraft-view-sheet.mjs
writes contact sheets of a bake and scripts/qa-aircraft-views.mjs
photographs a grid of every class in the app from above, tilted, from
below and round an orbit.

With 5,000 contacts on an M3 Max the frame takes 5.9-6.1 ms against
5.9 ms with the flat glyphs.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-23 01:21:39 +01:00

91 lines
1.4 KiB
JSON

{
"image": "aircraft-views.webp",
"cellPx": 64,
"columns": 64,
"rows": 57,
"ringStepDeg": 7.5,
"rings": [
1,
4,
7,
10,
13,
16,
18,
20,
22,
23,
24,
25,
25,
25,
24,
23,
22
],
"fill": 0.92,
"grey": true,
"subjects": {
"airliner": {
"first": 0,
"model": "aircraft/a320.glb",
"radiusM": 18.883
},
"widebody": {
"first": 302,
"model": "aircraft/b789.glb",
"radiusM": 32.121
},
"quadjet": {
"first": 604,
"model": "aircraft/b744.glb",
"radiusM": 37.959
},
"turboprop": {
"first": 906,
"model": "aircraft/at72.glb",
"radiusM": 14.14
},
"light": {
"first": 1208,
"model": "aircraft/c172.glb",
"radiusM": 5.825
},
"glider": {
"first": 1510,
"model": "aircraft/glider.glb",
"radiusM": 7.506
},
"fastjet": {
"first": 1812,
"model": "aircraft/t38.glb",
"radiusM": 7.408
},
"bizjet": {
"first": 2114,
"model": "aircraft/glf4.glb",
"radiusM": 17.211
},
"uav": {
"first": 2416,
"model": "aircraft/mq9.glb",
"radiusM": 9.811
},
"helicopter0": {
"first": 2718,
"model": "helicopters/generic_heli.glb",
"radiusM": 7.556
},
"helicopter1": {
"first": 3020,
"model": "helicopters/generic_heli.glb",
"radiusM": 7.556
},
"helicopter2": {
"first": 3322,
"model": "helicopters/generic_heli.glb",
"radiusM": 7.556
}
}
}