Merge main into denis/iss-live-telemetry

Conflicts: the locale catalogs and package boundaries are three-way merges
(no message changed differently on both sides); zh-Hant is regenerated
from zh-CN. bhoteKoshiEmbeddedMedia.js keeps main's card counter and the
branch's shared YouTube loader (youtubeApi.js), so the media file builds
one script element fewer. The Cockpit briefing's LIVE tab and the orbital
NADIR/RESET button are main's UiButton.
This commit is contained in:
Denis Groshev committed 2026-11-20 10:50:16 +01:00
commit edbf3a234d
244 files changed
+11747 -1273

No files matched your search

+16 -9
View File
@@ -92,6 +92,7 @@ out vec2 v_uv;
out vec4 v_color;
out vec4 v_pickColor;
out float v_proxy;
out float v_overDepth; // 1 for a row drawn over depth, on the near plane
// The row's anchor in clip space before screen offsets, for effects that wrap
// main() (sonar) and must not change geometry or picks.
@@ -125,6 +126,7 @@ void main() {
v_uv = vec2(0.0);
v_color = vec4(0.0);
v_proxy = 0.0;
v_overDepth = 0.0;
gl_Position = vec4(0.0, 0.0, 2.0, 1.0); // outside the clip volume: not drawn
float flags = style1.z;
@@ -260,14 +262,9 @@ void main() {
distanceSq < style3.w * style3.w;
if (overDepth && zclip >= -1.0 && zclip <= 1.0) {
gl_Position.z = -gl_Position.w;
#ifdef LOG_DEPTH
// Just past the near plane, not on it: czm_writeLogDepth discards a
// fragment at or below 0.9999999, and 1.0 interpolated across the quad
// can arrive a rounding step or two under that, dropping the icon for a
// frame as it moves (flicker). 1e-4 m past the near plane is still in
// front of everything the scene draws.
v_depthFromNearPlusOne = 1.0001;
#endif
// With a log depth buffer the fragment shader writes the near plane's
// depth itself.
v_overDepth = 1.0;
}
v_uv = mix(rect.xy, rect.zw, vec2(corner.x * 0.5 + 0.5, 0.5 - corner.y * 0.5));
@@ -282,6 +279,7 @@ in vec2 v_uv;
in vec4 v_color;
in vec4 v_pickColor;
in float v_proxy;
in float v_overDepth;
void main() {
vec4 color = czm_gammaCorrect(texture(u_atlas, v_uv));
@@ -296,7 +294,16 @@ void main() {
#endif
out_FragColor = color;
#ifdef LOG_DEPTH
czm_writeLogDepth(v_depthFromNearPlusOne);
// Over depth: exactly the near plane's depth, written here and not through
// czm_writeLogDepth. That function discards a fragment whose interpolated
// depth arrives a rounding step under the near plane (the icon drops for a
// frame as it moves), and any depth past the near plane is a surface to
// Cesium's depth pick: the camera controller then sizes a zoom step from an
// icon under the canvas centre, a near plane's distance away, and the wheel
// stops zooming. The pick reads a depth of 0 as nothing drawn, and keeps
// the depth of the ground under the icon.
if (v_overDepth > 0.5) gl_FragDepth = 0.0;
else czm_writeLogDepth(v_depthFromNearPlusOne);
#endif
}
`;
@@ -1,5 +1,6 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import fs from 'node:fs';
import * as Cesium from 'cesium';
import { createIconSet } from '../../data/iconSet.js';
import { IconSetPrimitive } from './iconSetPrimitive.js';
@@ -58,3 +59,29 @@ test('by default the set draws an opaque pass and a translucent one, and draws n
assert.equal(translucent.renderState.depthMask, false);
assert.equal(primitive.drawsBlend('translucent'), false);
});
test('an over-depth row writes a depth of exactly 0, which a depth pick ignores', () => {
// Shaders do not compile under node: this reads the fragment shader's
// source. A depth past the near plane (as 1.0001 through
// czm_writeLogDepth was) is a surface to Cesium's depth pick, a near
// plane's distance from the camera, and the wheel stops zooming with an
// icon under the canvas centre (scripts/qa-zoom-under-icon.mjs).
const source = fs.readFileSync(
new URL('./iconSetPrimitive.js', import.meta.url),
'utf8',
);
const [vertex, fragment] = source
.slice(source.indexOf('const VERTEX_SHADER'))
.split('const FRAGMENT_SHADER')
.map((shader) => shader.replace(/\/\/.*$/gm, '')); // comments out
assert.match(
fragment,
/if \(v_overDepth > 0\.5\) gl_FragDepth = 0\.0;\s+else czm_writeLogDepth\(v_depthFromNearPlusOne\);/,
);
// The vertex shader flags the row and leaves its log depth alone.
assert.match(
vertex,
/gl_Position\.z = -gl_Position\.w;[^}]*v_overDepth = 1\.0;/,
);
assert.doesNotMatch(vertex, /v_depthFromNearPlusOne\s*=/);
});
+6 -2
View File
@@ -5421,10 +5421,14 @@ export function portChecks() {
const chunks = [];
recorder.ondataavailable = (e) => chunks.push(e.data);
let colour = '#ff0000';
const paint = setInterval(() => {
const fill = () => {
g.fillStyle = colour;
g.fillRect(0, 0, 32, 32);
}, 20);
};
// Red from the first recorded frame: a blank canvas until the first
// tick read dark early in the segment on a loaded runner.
fill();
const paint = setInterval(fill, 20);
const wait = (ms) => new Promise((done) => setTimeout(done, ms));
recorder.start();
await wait(1000);
+2
View File
@@ -593,6 +593,8 @@ export type FieldSpec =
*/
detail?: { image: ImageRef; rectangle: GeoRect } | null;
alpha?: number;
/** What the raster shows, as imagery's `shows`. */
shows?: string;
};
export interface FieldHandle extends Handle {
+5
View File
@@ -122,6 +122,11 @@ export interface ImagerySpec {
) => Promise<unknown> | undefined;
/** Draw order among imagery layers; higher draws on top. */
zOrder?: number;
/**
* What the imagery shows, such as `'clouds'` or `'radar'`. Drawing never
* depends on it; a renderer may use it to tell such a layer apart.
*/
shows?: string;
}
export interface TimedUrl {