Bin Navara ground corridors set-wide and give corridors glow, pulse and dash

Navara's ground pass cut each corridor into chunks and tested them per
screen cell, so dense corridor sets were slow (10,000 cost about 150 ms a
frame). A corridor set is now cut into pieces along its great circles,
sorted into lon/lat tiles, each with a pyramid of bins listing the
segment runs within its margin; a pixel takes its tile and the finest
bin that covers its reach and tests only those runs. At 10,000 corridors
a frame now takes 11.8 ms still (Cesium 23 ms), at 15,000 17.9 ms. A
pixel corridor's width is measured across the line, so diagonal lines no
longer draw up to 1.4 times wider.

Pixel corridors take three looks, evaluated on the GPU from a time
uniform: Cesium's PolylineGlow falloff (glow), an alpha pulse and the
annotation route's flowing dash. While a shown set pulses or flows the
engine draws continuously, as Cesium did. Traffic's jam lines take the
glow and pulse again and the Directions route its flowing dash and render
hold, so on Cesium both match the drawing before they moved to the
contract pixel for pixel. The contract suite passes on both engines
(Cesium 69/69, Navara 72/72).
This commit is contained in:
German Khokhlov committed 2026-11-07 09:50:49 +04:00
1 parent 48885d9e61
commit 47d63128ff
30 files changed
+2501 -391

No files matched your search

+22
View File
@@ -903,6 +903,9 @@ export function createDirectionsLayer({
const _stepAnchors = new Map();
let _selectedStep = null;
let _listening = false;
/** Whether a route is on the display, and the continuous render it holds. */
let _routeDrawn = false;
let _renderHeld = false;
let _removeClick = null;
let _rowControlsListener = null;
let _dataManager = null;
@@ -987,13 +990,28 @@ export function createDirectionsLayer({
);
}
/**
* The route's dashes flow toward B: the scene renders continuously while
* it is drawn and the layer is on, as it did under Cesium's route flow
* material.
*/
function syncRenderHold() {
const shouldHold = _enabled && _routeDrawn;
if (shouldHold === _renderHeld) return;
_renderHeld = shouldHold;
if (shouldHold) services.render.holdContinuousRender?.('directions');
else services.render.releaseContinuousRender?.('directions');
}
function clearRouteGraphics() {
services.credits?.hideOsmCredit?.(_engine, 'directions');
_clearStepSelection();
stopStepAnchoring();
_display?.setRoute(null);
_routeDrawn = false;
_stepAnchors.clear();
_display?.setSteps([]);
syncRenderHold();
}
function stopStepAnchoring() {
@@ -1055,6 +1073,8 @@ export function createDirectionsLayer({
clearRouteGraphics();
if (!_display) return;
_display.setRoute(route.geometry);
_routeDrawn = true;
syncRenderHold();
// One dot per decision; A and B already mark departure and arrival. The dots
// start hidden and appear as anchorStepPoints resolves each ground cell.
const cells = [];
@@ -1535,6 +1555,7 @@ export function createDirectionsLayer({
(pickedId) =>
typeof pickedId === 'string' && pickedId.startsWith('directions:'),
);
syncRenderHold();
},
/** Remove the route, markers and listeners. */
@@ -1545,6 +1566,7 @@ export function createDirectionsLayer({
_removeClickHandler();
services.picking.unregisterPickOwner('directions');
_display?.show(false);
syncRenderHold();
},
/** Nothing to poll: routes are requested on placement and mode change. */