Commit Graph
101 Commits
Author SHA1 Message Date
Sameh Khamis a59f9b10b2 Draw Radio stations and their clusters through the draw port and take the Radio renderer off the Cesium list
The stations, the cluster dots and the selected station's dot and bracket
are draw-port point and icon sets. Stations drawn too close together on
screen are grouped by geo/screenCluster.js as the default renderer's
entity clustering grouped them: the same boxes and screen coordinates, the
same reuse of the last pass's clusters when the eye comes lower, a pass
whenever the camera moves enough or a station is shown or hidden, and
stations a pass passes over hidden until the next. A cluster dot names its
seed station, so a click plays it as before. The Radio QA script reads the
drawn sets; the unused cluster-collection internals helper is gone.
2026-11-08 11:11:50 -08:00
Sameh Khamis b2502d6f37 Draw FIRMS fire glows through the draw port and take the FIRMS renderer off the Cesium list
The fire glows are one draw-port icon set with horizon cull, drawn on the
renderer's moving-icon path with a hold motion, as the layer's own icon
primitive drew them. Only glows that are new or changed are written, after
the set accepts them; fires a refresh drops are removed. Clicks read the
renderer's hit and match the layer's own set id. The sprite order registers
the set by its id.
2026-11-08 10:29:40 -08:00
Sameh Khamis 393f1686f2 Draw quads and meshes through the Cesium draw port
The Cesium draw port now makes quads sets (a posed, textured plane with its
outline, drawn as a plane entity with a transparent image material draws it)
and meshes sets (triangles in the east-north-up frame at an origin, flat and
two-sided or lit and closed). Quads change in place as they move, resize,
fade or take a new canvas; a video quad keeps frames coming while it plays
and gets a new material when its size or source kind changes. Mesh vertices
are placed in the Earth-fixed frame, so Cesium can project them for its 2D
views. The capabilities list both kinds.
2026-11-08 07:23:54 -08:00
Sameh Khamis b6e94b8d93 Move the scene-reading icon orientation helpers into the Cesium adapter
screenProjectedRotation, perspectiveProjectedRotation, horizonOccluder and
cameraPoseSignature read a Cesium scene or camera, so they move unchanged
to src/render/cesium/iconOrientation.js, where the CCTV, radio and transit
rendering (still Cesium-bound) load them. src/data/iconOrientation.js keeps
the label backdrop test and the rotation deadband, and leaves the Cesium
allow-list. Local ADS-B computes its rotation from the camera port's axes
with courseScreenRotation directly, the same answer without a stand-in
scene.

The ./aircraft package entry re-exports src/data/iconOrientation.js, so it
no longer carries the four moved helpers or the PERSPECTIVE_* constants.
2026-11-08 05:49:05 -08:00
Sameh Khamis 09f2b88bf9 Move the instanced icon set primitive into the Cesium adapter
The primitive that draws icon sets in a Cesium scene now lives at
src/render/cesium/iconSetPrimitive.js beside the draw port's GPU icons,
and leaves the Cesium allow-list. Its importers (the draw port, CCTV,
FIRMS and the cyber sonar overlay) load it from there.
2026-11-08 05:19:53 -08:00
Sameh Khamis 17364d1eee Settle unchanging solid lines into static batches in the Cesium draw port
An undraped solid line (straight or geodesic, without a depth-fail colour,
not revealed, at least half a pixel wide) is drawn by the set's polyline
collection at once, as before. Once the set's lines have not changed for
30 drawn frames, every such line is built into static batches beside the
collection: a primitive of polyline geometries for opaque colours and one
for translucent ones, each line coloured and shown by its own instance
attributes under the pick id it had. A batch builds hidden, off the main
thread, and swaps in for the batch before it and the collection's
polylines once it is ready, each line showing as its item then asks. A
polyline collection works out every line's material every frame; a batch
costs nothing until it changes. The data centre stems (4,362 lines) cost
about 16 ms a frame in the collection and about 0.01 ms settled.

A batched line changes its show, colour and meta in place. One that moves,
or whose colour moves it between the opaque and translucent passes, leaves
its batch, hidden there, for the collection until the set settles again;
when a batch exists and fewer than 64 lines are left in the collection,
they settle after 300 frames, as rebuilding the batch for a few lines
costs more than drawing them. A line in the collection that moves or
changes colour drops a batch still building; a show change does not. A
colour-only change of such a line is now made in place in the collection
too, where it rebuilt the set. A batch whose build fails is reported once
and its lines stay in the collection. Glow, dash, arrow, flow, pattern,
revealed and depth-fail lines draw as they did.

The shared conformance suite checks solid lines left unchanged for many
frames still pick, hide, recolour and move in place.
2026-11-08 00:40:29 -08:00
Sameh Khamis 0d9b96badf Hide the sets a height sample sees through for that sample
A synchronous height sample saw through the draw sets item by item: each
item it hit cost another offscreen pass, and a hit line made its whole
line collection rebuild. The sets it sees through are now hidden whole
for the sample and shown again before anything draws, so it renders past
them in one pass with the same answer. A list read before the sets last
changed still sees through item by item, and a sample inside another
sees what the outer one hid unless it sees through it too.
2026-11-07 23:47:04 -08:00
Sameh Khamis 0584707436 Outline a raised polygon's holes as well as its outer ring
The Cesium draw port drew an unclamped polygon's outline as one closed
polyline around its outer ring. Each ring now gets its own, with the same
width, colour and pick id, as the entity polygons the GeoJSON loader made
outlined their holes. The local GeoJSON layers and submarine cables draw
their raised polygons this way.
2026-11-07 23:47:04 -08:00
Sameh Khamis 5715bf9df3 Draw the traffic heat-lines through the draw port, batching alike draped glow lines in the Cesium draw port 2026-11-07 23:16:11 -08:00
Sameh Khamis bbd6049e21 Draw the traffic dots through the draw port and read the road surface through renderer ports
The traffic layer's vehicle dots are now a points set on the draw port,
moved, added to and taken from in place each frame, instead of a Cesium
point collection. Road surface heights and readiness read the query,
camera, frame and globe ports and the heights service instead of the
scene; the surface identity and "any tileset drawn" checks, which the
contract cannot answer, move to rendering.js with the heat lines.

animation.js, style.js and surface.js leave the Cesium allow-list.

The Cesium draw port compares a moved point's look without allocating:
colours by index, and a frozen colour or curve of plain data by identity,
so a thousand dots moved every frame cost about what direct writes did.
The traffic QA scripts read the dots' draw items.
2026-11-07 23:16:11 -08:00
Sameh Khamis d9db5199ed Add and remove points in place, set only what changed, and recolour material lines in place in the Cesium draw port
A set of unclamped points drawn by one point collection now takes new
points and removals where it is, instead of building the collection
anew; its pick ids and horizon cull follow, and the draw port's version
changes only when pick ids do. A point moved or restyled in place sets
only the members of its look whose values changed, and writes its
position without allocating, so a set moved every frame makes nothing
new. A draped line drawn by a material of its own takes a colour-only
change on its material, and unmoved lines sent again compare their
positions without flattening them. The shared conformance suite checks
points joining and leaving a set one by one.
2026-11-07 23:16:11 -08:00
Sameh Khamis 6286bcfb07 Turn draped rectangles by an optional rotation, and drape image fills in the Cesium port
A rectangle shape gains an optional rotation: radians counter-clockwise,
turning it about its centre in longitude and latitude, as a KML ground
overlay turns; an image fill turns with it. A renderer that predates it
draws the rectangle unturned. The Cesium draw port passes it as the
rectangle's rotation and texture rotation, and now drapes image fills on
clamped shapes, each on a ground primitive of its own that owns its
material, where it refused them before. Hidden image fills are not built
until they show. The stub picks draped rectangles, turned and across the
antimeridian, and a conformance check picks a quarter-turned overlay on
both renderers. The KML importer still draws its overlays itself.
2026-11-07 21:49:34 -08:00
Sameh Khamis 7ad65b2e87 Dash a line's parts behind the surface, and the Draw tool's rubber band there
A line item gains an optional depthFailDash ({ length, pattern16? }): the
parts behind the surface are dashed in depthFailColor, as a dash style
dashes a line. Without a depthFailColor, and on draped lines, it is
ignored; a renderer that predates it draws those parts solid. The Cesium
draw port gives the depth-fail appearance a PolylineDash material, and a
change of dash is a new look. The Draw tool's rubber band uses
{ length: 16 }, the dash its old entity asked for (that entity, a dynamic
polyline, never drew its depth-fail material, so the parts behind the
surface were hidden before the tool moved onto the draw port).
2026-11-07 21:49:25 -08:00
Sameh Khamis 90e73f2ef2 Read the eye's follow frame through the camera port and take share-follow off the Cesium list
The camera port gains an optional followFrame() (capability followFrame):
the frame the eye is placed in now, as a column-major 4x4 matrix to ECEF.
Once a follow has framed the camera it is the follow's own frame
(east-north-up, or the orbit frame an autodetect follow chose), under
lookAt the target's east-north-up frame, otherwise the identity. setView
places a world pose and keeps that frame. The Cesium port reads it from
camera.transform, only when the capability is on; the stub from its own
eye frame. A conformance check covers the world, lookAt and enu-follow
frames, the offset in it, and setView keeping it.

src/ui/shareFollow.js now reads the pose, the frame and the follow offset
through the camera and frame ports: a shared offset is re-expressed in the
follow's own frame as before, satellites included, and the eye is placed
with setView at exact heading, pitch and roll, so a near-vertical view
keeps its roll. placeFollowEye returns false on a camera that cannot say
its frame. offsetFromHeadingPitchRange moves to src/geo/frames.js, shared
with the stub.
2026-11-07 21:49:25 -08:00
Sameh Khamis 333c9b39fe Keep the draw port's version when icons only change in place
The Cesium draw port's version tells height queries when the pick ids
they see through may have changed. Icons changed in place keep their
billboards and pick id objects (meta and LOD group are written into
them), so only icons added or removed change what queries see through.
An in-place icon update, such as the tracked aircraft's icon every
frame, no longer bumps the version, so the see-through cache is no
longer rebuilt each frame. Re-registering an atlas whose images change
in place keeps it too, and still rebuilds a set it cannot patch.
2026-11-07 20:25:15 -08:00
Sameh Khamis 5370feb825 Report model load failures to model sets, and bound the tracked model's retries again
The renderer contract gains an optional event on model draw sets,
`on('loadFailed', (id, message) => ...)`, beside `ready`: a model's url
failed to load, once per failed load. The item stays in the set drawing
what it drew before; removing it and adding it again tries at once. A
renderer that cannot tell a failure may never fire it.

The Cesium draw port fires it once Cesium is done with the frame it
raised the error in, and not for a load that was superseded or whose item
went. The stub fails urls under `stub-fail:`, telling each load once. A
conformance check (`draw.models.loadFailed`) runs on both, with a model
url the dev server does not serve for Cesium.

The flights and military layers use it in place of rewriting every
unloaded model every 5 s. A fleet model whose load failed is removed and
added again 5 s later. The tracked model gets back its per-selection
budget: a failed load is let go and tried again 1.5 s later, and after
three failures the contact stays 2D until another is selected, as
before the models moved onto the draw port. A good load retires the
budget, and a model that loads after all is kept.
2026-11-07 19:44:15 -08:00
Sameh Khamis 0f9bd23829 Change a clamped fill's show in place in the Cesium draw port
An upsert that only shows or hides clamped colour fills, or changes their
meta, now writes each fill's show attribute instead of rebuilding every
ground primitive of the set. Hidden fills are built too, hidden, as
Cesium's entity ground batches keep them; a show written while the ground
primitives build waits for their swap. A hidden fill the port could not
draw shown stays out, as before, and a set whose fills are all hidden no
longer keeps the old ones drawn while it builds. Anything else about a
fill, including a value changed in place, still rebuilds.
2026-11-07 19:44:15 -08:00
Sameh Khamis 2e91579f8f Add a globe visibility getter to the renderer contract
The globe port could show or hide the globe surface but not say whether it
is shown. It now has an optional isGlobeVisible(), gated by a new
globeVisibility capability, in the Cesium adapter, the stub and a
conformance check. A Cesium scene without a globe does not offer it, so
callers keep their own default for an unknown surface.

The OSM overlays, the CCTV ground regime and the submarine cable drape now
read the getter instead of the scene's globe. cableClassificationTypeForScene
takes the viewer rather than its scene.
2026-11-07 19:44:15 -08:00
Sameh Khamis abe9f97768 Draw Flights and Military 3D models through draw-port model sets
The two aircraft layers' fleet and tracked models are now draw-port
models sets made each layer lifetime, re-posed and restyled in place,
instead of Cesium models in a collection of their own. Model records are
plain data; picks name the set and the contact, readiness comes from the
set's ready event, the IR boost restyles in place (unlit, white tint,
full blend), and the drawn scale comes from the camera pose and pixel
floor. Fleet writes go out together at the end of each tick, before the
icons they replace, and a failed write hands the contacts back to their
icons. A model that has not loaded is rewritten every few seconds so the
renderer can retry it, which replaces the tracked model's load-failure
budget. Models load off the tile-contended job queue, as before.

aircraftModelLayer.js, modelRecord.js and the flights and military
lifecycle and testing files, plus flights rendering.js, come off the
Cesium allow-list.
2026-11-07 17:10:38 -08:00
Sameh Khamis 20fdfd492e Draw Local ADS-B aircraft models through the draw port
Local ADS-B's 3D aircraft are now one models set of the renderer's draw
port, re-posed in place each frame, instead of Cesium models of their own.
Ground placement samples heights through the query port and sees through
the layer's sets by id; clicks read the dispatcher's draw-set hit and the
query port's drill. A class change keeps the drawn model, at its own belly
offset, until the new asset is ready; a scale-only change applies at once.
The models file leaves the Cesium allow-list.

Cesium model sets retry a failed load when its item is next updated after
a short wait, and parse an item's tint only when it changes.
2026-11-07 15:43:33 -08:00
Sameh Khamis 20155ff3fa Change Cesium model sets in place, and check models on both renderers
A models set kept one primitive per build and loaded every model again on
any change. Each item now keeps its own Cesium model: an update re-poses it
(position and orientation), and changes its scale, pixel floor, maximum
scale, shading, tint, colour blend, environment map, display range and show
where it is. Only a new url loads again, and the model it draws stays until
the new one is ready. `ready` fires once per load. Each frame before the
scene draws, the set caps models at their maxPixelSize, scales and fades
them by distance, and hides them past the horizon in a horizonCull set. A
load that fails is let go after its update, and stays a failure for
whenSettled until its item changes.

The stub fires `ready` only for a new item or a new url, and draws models
into readPixels as tinted squares. Its harness has a model asset now, so the
model checks run on it. New checks: a model moves, turns and restyles
without loading again, and only a new url loads it; its tint and colour
blend change live.
2026-11-07 15:43:33 -08:00
Sameh Khamis e37349a061 Move the transit head across subdivisions in the frame, and keep segmented lines safe beside the draped rework
The transit trail's head is upserted where the vehicle crosses into the next
subdivision, so the Cesium draw port moves it there in the same frame
instead of building it anew; between crossings a frame changes only how far
it is revealed. A test runs the trail through the Cesium draw port across a
crossing and a second's fade, with nothing built anew.

A segmented line that was replaced by a plain one and moved while its set
rebuilds is hidden segment by segment where it was. A segmented line of no
length is patched as nothing to draw instead of rebuilt on every upsert,
and segmented lines are noted as rebuilt when they move.
2026-11-07 07:59:33 -08:00
Sameh Khamis e8872ab419 Colour and show draped line segments in place through the Cesium draw port
A draped solid line with segment colours or shows draws each segment as a
ground polyline instance of its own in the set's ground batch, under a
pick id that reads as the line's, so changing its colours or which
segments show writes their attributes without a rebuild; a change made
while the ground still builds is written as it swaps in. Undraped or
non-solid segmented lines are refused, and a segmented line of no length
builds no ground. The shared conformance suite changes a segmented
draped line every frame.
2026-11-07 07:41:00 -08:00
Sameh Khamis 8cefc8cc4a Draw contact trails through the draw port
The shared trail renderer draws a trail's history and its live head as
lines in a draw-port set, geodesic for the history and straight for the
head, each dimmed behind the surface in its depth-fail colour, and
leaves the Cesium allow-list. The flights and military trail heads are
drawn through the trail each frame from the frame port instead of
entity callbacks, and the local ADS-B head uses the same head line. A
head given while its trail is hidden waits until the trail shows.

Geodesic lines are cut a step a degree of arc, with at least 64 steps
over the line, so a long trail of short legs costs its positions rather
than 64 vertices a leg.
2026-11-07 07:39:58 -08:00
Sameh Khamis c145c63b4f Flatten each upserted draped line's positions once in the Cesium draw port
patchLines flattened a draped line's positions twice per upsert, once to
decide whether it could patch and once to apply it; it now flattens them
once and uses the result for both.
2026-11-07 07:02:41 -08:00
Sameh Khamis 10dcab837b Drape glow and dash lines, reveal lines by length, and move draped lines and clamped points every frame
The Cesium draw port now drapes glow and dash lines as well as solid and
flow ones, each with its own ground primitive.

revealFraction is the fraction of the line's length, measured along the
line. Both renderers cut there: Cesium discards fragments past the cut in
the line's material, so the hidden part neither draws nor picks; the stub
cuts the line before drawing and picking.

A draped line whose positions change is rebuilt the same frame, on a ground
primitive of its own, once terrain heights are loaded; until then it is
rebuilt as before. A clamped dot whose look is unchanged is moved in place.

The stub now picks lines. A new shared conformance check, draw.lines.drape,
covers draped glow and dash lines, the reveal cut, a draped line growing
every frame, and a clamped point moving every frame.
2026-11-07 06:52:46 -08:00
Sameh Khamis be5a6f0fe5 Draw local ADS-B through the draw port
The local receiver layer draws its aircraft, the 978 MHz rings and the
selected aircraft's trail head through draw-port sets, updates them on
the frame port each frame, rotates icons from the camera port's screen
axes, and leaves the Cesium allow-list. The trail head now dims behind
terrain instead of vanishing, as the rest of the trail does.
2026-11-07 06:04:12 -08:00
Sameh Khamis 84e6f13725 Keep points and icons past the horizon hidden when they move in place
An in-place update now applies the horizon cull at once, so a set moved
by a frame listener that runs after the draw port's own cull no longer
shows items through the globe until the next frame.
2026-11-07 06:04:12 -08:00
Sameh Khamis 9de93b8d31 Draw directions through the draw port
The directions layer draws its endpoint markers, its flowing route and
its maneuver dots through draw-port sets, takes clicks from the draw hit
and ground picks from the click's ground position, and leaves the Cesium
allow-list. The route keeps the annotation's flowing dashes, draped on
terrain and tiles; the maneuver dots keep their place in the sprite
order through the steps set.
2026-11-07 05:42:26 -08:00
Sameh Khamis d18fae43c2 Draw flow lines and depth-fail colours through the Cesium draw port
Lines take the flow style, draped or not: the route annotation's flowing
dashes as a material whose clock the port runs each frame, asking for
frames while a shown set shows flow lines. Undraped lines with a
depth-fail colour draw it where the surface hides them, and one that moves
is built anew in place under the same pick id, so a line updated every
frame neither rebuilds its set nor blinks. A draped style the port cannot
drape is refused before the set changes. The shared conformance suite
draws both kinds and moves a depth-fail line frame by frame.
2026-11-07 05:42:17 -08:00
Sameh Khamis adedd51551 Move points in place and show them by display range through the Cesium draw port
Unclamped points that move on an upsert now move on the point they have,
keeping their pick id and horizon cull, instead of rebuilding the set.
Points and clamped dots honour displayRange as icons do. The shared
conformance suite checks moved points and point display ranges, and the
lodGroup check now passes on the Cesium renderer too.
2026-11-07 05:42:06 -08:00
Sameh Khamis b9248bfce5 Keep the scene command trim in the Cesium adapter and take its installer off the Cesium list
The private-field trim of Cesium's reused per-pass command arrays moves to
src/render/cesium/sceneCommandRelease.js. The installer waits for the
renderer frame port's postRender after each layer disable and calls a trim
the application scene hands over, so it no longer touches the Cesium scene.
2026-11-07 05:29:57 -08:00
Sameh Khamis 71ff682c7f Draw scene data packs through the draw port and take their geometry and presentation off the Cesium list
Pack points, lines, polygons, image overlays and media markers are draw
sets now, one per pack resource and kind. Feature picks match the click's
draw hit by set and item id, and item ids are namespaced so code that reads
a bare pick id never takes a pack feature for a live contact. An image pack
draws its decoded pixels from a canvas: the Cesium draw port now fills
unclamped shapes with images, as the contract's fills allow, and frees
their materials with the set. The ./scenes export joins the entries whose
caller loads the unbound renderer factories.
2026-11-07 05:29:57 -08:00
Sameh Khamis dbd6363e43 Draw the aircraft fleet icons through the draw port
The civil flights and military layers now draw their contacts as one GPU
icon set each from the renderer's draw port instead of a custom primitive.
Each contact is an icon item whose motion is the dead reckoning the layer
plans (interpolation between fixes, warm-up and coast arcs, or a hold),
with its nose gliding onto a new course at the fleet's slew cap. A
contact's item is replanned when its motion runs out, grounded contacts
are pinned with held motion, and focus de-emphasis is written per item.
The near/far image switch follows the renderer's pixel ratio, and writes
made during a fleet tick reach the set before that frame draws.

The aircraft icon layer and the flights icon part no longer touch Cesium
and leave the allow-list. Clicks resolve the draw port's pick ids as well
as the ones the tracked model and entities still carry, so selection,
follow and share-follow work as before.
2026-11-07 04:25:24 -08:00
Sameh Khamis 8d586e5ff9 Project the annotation whiteboard through the renderer's ports
The screen annotation renderer no longer imports Cesium. Each projection
pass reads the eye from the camera port's pose and projects through the
query port: behind-camera and horizon rejection, then project. It
repaints on the frame port's postRender, and asks for ground heights
through the height gateway, which now sees through draw sets not drawn as
ground. It sizes the board from the renderer's canvas. It leaves the
Cesium allow-list.

The Cesium query port's project reuses a scratch point and window
position, as the renderer's own projection did.

Its tests bind fake camera, query and frame ports over their viewer
doubles. The hybrid renderer's shared fixture binds them too, so its
screen marks are projected and checked to be on screen.
2026-11-07 04:13:18 -08:00
Sameh Khamis dd4f19967d Draw the screen-space label overlay through the renderer's ports
The world overlay no longer imports Cesium. It reads the eye from the
camera port's pose, builds its view-projection from the camera port's
matrices, asks the query port whether a point is behind the globe, paints
on the frame port's postRender and asks it for renders, and invalidates
on the camera port's moveEnd. It still reads the viewer's container and
canvas, which are DOM. It leaves the Cesium allow-list.

The Cesium query port now keeps one horizon occluder per eye and a
scratch point, so the overlay's per-label horizon test allocates nothing,
as it did when the overlay held the occluder itself. The overlay tests
bind camera, frame and query ports over their viewer doubles, the
allocation probe using the Cesium port's own horizon test.
2026-11-07 04:13:18 -08:00
Sameh Khamis e34e923ddd Ask the renderer's query port for heights through the queries gateway
The Cesium scene's height service moves into the Cesium adapter
(src/render/cesium/heights.js), where the Cesium query port answers its
height members through it; the files still bound to the Cesium scene
import it from there.

src/queries/heights.js becomes the height gateway over the renderer's
query port: heightsOf(viewer) answers now, clampNow, batch, clampBatch and
supported as before, a miss is null, a failed or destroyed query rejects,
and exclusions are draw set ids. The source scan that keeps height queries
in one place still holds: outside the renderer, only the gateway asks for
streamed heights. The bikeshare layer samples its station heights through
it.

Heights leaves the allow-list.
2026-11-07 04:13:18 -08:00
Sameh Khamis 7ab969599c Fly to places, landmarks and imported files through the camera and query ports
The camera ground guard reads the eye from the camera port's pose, the
flight state from the port, and the surface under it from the query port's
heights, and lifts through the port. Place and landmark flights read the
terrain height from the query port and build their targets with geo.
Framing ranges read the field of view from the pose (the frustum's
wider-side angle, as it read before). An imported file's flight frames its
footprint, plain lon/lat/height points, with geo's bounding sphere and the
port's flyToBounds; walking the file's Cesium data source for those points
moves into the file importer, which stays on the Cesium allow-list.

The Cesium query port answers terrain heights without depth textures, as
the height service always has: only the drawn surface needs them.

cameraGroundGuard, locations, cameraFraming and flyToDataSource leave the
allow-list. The annotation resolver, still listed, loads the camera
factory for the application operations entry, which reached it through
locations before.
2026-11-07 03:11:51 -08:00
Sameh Khamis 3484bfa56d Run the shared motion check against the Cesium renderer too
draw.motion.shared was only in the stub run. Cesium advertises
motionSegments, and the check passes there on the scene clock.
2026-11-07 02:47:23 -08:00
Sameh Khamis 1c8cf240c4 Tidy the vessels layer on the draw port: shared pose key, lazy pose, frame reasons, sprite order
The camera pose key moves to render/camera/poseSignature.js, Cesium-free, and
iconOrientation's cameraPoseSignature builds the same key through it. The
vessels frame hook reads the pose only when a pass runs or a moved camera
could still need its trailing pass, and the unused focus scratch point goes.

The draw port takes the frame port's requestRender, so a GPU icon set's own
frames (its images packed into the atlas) are asked for under the reason
icons:<set id> in the frame diagnostics, where the vessels layer's own
ais-vessels-icons reason used to be. Other draw requests are unchanged.

A host with no registerSpriteSet still draws the ships and warns once. The
vessels draw test now checks the sprite order finds the set's host, and that
a torn-down layer draws a new set registered in the old one's place. The new
motion, icon book and pose key tests join the format check.
2026-11-07 02:36:39 -08:00
Sameh Khamis 7a9c7b4d96 Hold up to 176 icon images in the shared atlas, addressed by the context's uniform room
The GPU icon shader sizes its slot array to what the context can address:
the vertex uniform vectors it has, less 80 kept for the shader's other
uniforms, between 64 and 176. A WebGL 2 context addresses all 176; a context
with little room keeps the old 64, refuses sets that would need more, and
warns once if the atlas outgrows it. Slots past the array are never read.
2026-11-07 02:36:39 -08:00
Sameh Khamis 2cc226c1f9 Name the aircraft icons' 76 device-pixel image switch, and give it in CSS pixels
The draw contract measures an icon's imageLod switch in CSS pixels; the
aircraft layers' GPU icons switch to their near image past 76 device
(drawing-buffer) pixels. iconAtlas now names that switch, which the icon
shader reads, and nearImageSwitchPx(pixelRatio) gives it in CSS pixels for
a layer moving onto the draw port: 76 over the scene's pixel ratio, the one
the quality port's frame signals report. On the default renderer that is
its pixelRatio setting, or 1 while that is browser-recommended;
devicePixelRatio does not enter it, so the default is 1.
2026-11-07 02:36:39 -08:00
Sameh Khamis 87395bb733 Rasterise a GPU icon's SVG at its own size, apart from its drawn size
The Cesium draw port's GPU icon sets put each image into the shared icon
atlas at the item's drawn size. An SVG data URL (or SVG ref) that gives its
root a pixel width and height now takes the atlas at the larger of those,
at most 256 px, as a billboard rasterises it at its natural size; other
images still take the drawn size. A layer drawing a 64 px glyph at 20 CSS
px, with a 192 px near image, keeps both rasters through the draw port.
The atlas-room check counts the same slots the rows then take.

Ships (32 px SVGs drawn at 32) take the slots they took before.
2026-11-07 02:36:39 -08:00
Sameh Khamis 0349941b71 Read a moving icon's position and course through one shared evaluator
render/motion/iconMotion evaluates a draw item's motion segment and course
glide at a time on the set's motion clock, without a renderer: where the
item is drawn, the course it is drawn with, and when its motion ends. The app
can now read a moving icon back (to follow it, label it, judge a pick or
its horizon) the way the renderer draws it.

The stub renderer evaluates its segments with it, in place of its own copy,
and so now steps a lerp with no span 1 ms after t0, as the Cesium renderer
does. The Cesium GPU icon sets read the course shown before a write, a
blend's target and when rows stop moving through it, from copies of what
they wrote, and write each glide with the offset it computes, so an exact
half turn goes the way the app reads it.

norm360/norm180 and Position-to-ECEF move to geo for both to share.
Conformance gains a check that icons are drawn where the evaluator puts
them.
2026-11-07 02:36:39 -08:00
Sameh Khamis 2061f5647c Draw the air quality stations through the renderer's draw port
The station discs are now one draw set of ground-clamped filled ellipses per
layer, with the same band colours, alpha and radius, and their readings as
item meta; they had no visible outline before either (Cesium turns outlines
off on clamped entity ellipses). The readout's in-view list reads the view
rectangle through the camera port. The layer no longer imports Cesium and
leaves the allow-list; a caller handing it a Cesium viewer of their own,
with no renderer bound, loads the ./render/cesium/unbound export once first.

Double-clicking a station no longer starts the viewer's entity follow, since
draw items are not entities.
2026-11-07 01:50:52 -08:00
Sameh Khamis 7e07927660 Draw Street Level's coverage lines through the renderer's draw port
The coverage lines are draped line sets on the draw port now, not
ground polyline primitives of the layer's own. A tile draws in sets of
120 line parts, as its primitives were batched; each part is an item of
its own (its id made unique in the tile) that picks its sequence
(`meta.pick`). A filter change redraws the sets in place, so the old
lines show until the new ones are ready. The selected sequence is one
set over the coverage, redrawn in place as tiles land; the tiles hide
their own lines of it, a show change made in place, so it shows
whichever set is drawn over which. The wait for the terrain-height
table goes: the renderer builds draped lines when it is ready. A colour
the layer cannot read is handed to the renderer as given.

Clicks no longer read the renderer's pick. The click dispatcher's event
gains `windowHit(width, height)`, the wider pick read as the canonical
id, the draw-set hit and whether it is the map itself. Street Level
routes its own sets' hits by their pick, anything else (a provider's own
drawing) by its id, as before; the ground under a click comes from the
event, and the ground click is told whether the map was hit. The screen
centre is aimed through the query port, a pick that fails counting as a
miss. Street Level no longer reads the scenePick service.

The Cesium draw port no longer lets a show queued while a draped line
built override one applied once it was ready, before the swap: the
highlight hand-over now depends on that.

lineCoverage leaves the Cesium allow-list; with it every Street Level
file named in this work is off the list.

Differences the contract does not let us avoid:
- The lines draw among the scene's primitives, not its ground
  primitives: they now draw over other layers' clamped entities and
  ground primitives, and win picks against them.
- The highlight builds asynchronously: a newly selected line is not
  drawn for the frames that takes.
- Lines of other sequences in tiles that land after the highlight was
  first drawn cross over it.
2026-11-07 01:40:32 -08:00
Sameh Khamis f6422d2247 Draw the vessels layer's ships through the renderer's ports
The ships are one icon set from the draw port, held on course with hold
motion segments and drawn over depth as before; the layer keeps what it last
drew in an icon book and reads focus and pick ownership back from there,
matching clicks on the draw hit's set and id. Its frame hook, camera pose,
horizon test and screen projection come from the frame, camera and query
ports, with the horizon lift in geo/horizon judging the same point the GPU
cull does. The icons' draw set is disposed when the layer is destroyed.

rendering.js no longer imports Cesium or touches the scene's primitives,
picks, render events or camera, and leaves the Cesium allow-list. It still
reads the canvas size for the label budget. Callers of the vessels entry
load the Cesium adapter's unbound fallbacks.
2026-11-07 00:38:20 -08:00
Sameh Khamis bb85e0fa74 Draw moving icon sets on the GPU through the Cesium draw port
An icon set whose items move along motion segments, glide their course,
recede toward the limb, pick through a larger proxy or switch images by
drawn size, or that takes columns, now draws as one instanced
IconSetPrimitive in place of its billboards. The set switches the first time
an item needs it (or columns arrive) and stays switched; a course blend
alone switches it only when everything it holds can go. The Cesium ports
advertise columns, motionSegments and courseGlide.

GPU sets refuse loudly what billboards draw and they do not: clamped
heights, fadeByDistance, displayRange, offsets, anchors other than the
centre, axis and screen rotations, opaque and additive blends, images other
than URLs and SVG, and more images than the shared atlas has room for. A
refused write changes nothing.

The shared icon columns gain an image switch size, a pick proxy and a
per-row depth-test distance (defaulting to always over depth, as before),
arcs gain a climb rate, and the epoch rebases in both directions. Rows keep
asking for frames while they move, turn or blend; a write that moves a row
as it already moves (a restyle, a focus change) leaves its segment alone.
Billboard icons now fade with focus as GPU ones do.

Conformance gains columns and motion checks for the Cesium adapter.
2026-11-07 00:38:20 -08:00
Sameh Khamis 2592289612 Draw the ALPR layer's markers through the renderer's ports
The ALPR badges were Cesium entities whose billboards the layer changed in
place: the canvas overlay swapped a badge to a faint pick target at its
anchor, selection swapped the image, and unresolved floors clamped to the
ground. They are now one icon set from the draw port, updated in place
through upsert, so selection and the overlay swap change the same
billboard without a rebuild or a blink. Badges keep their scale by
distance, ground clamping and depth-test settings.

Marker state lives in the app (markerState.js): a plain carrier per camera,
registered as the camera's context entity, and a marker set that batches
changes and sends only the icons that draw differently. Clicks on native
badges come from the dispatcher's draw hit. Projection, the on-screen
count, height samples (excluding the layer's own set), the screen-centre
ellipsoid pick and the camera reach the renderer through the query,
camera and frame ports. A resync of the overlay now hands back only the
cameras that leave it, so kept ones are not written twice.

index.js, overlay.js and presentation.js leave the Cesium allow-list; the
layer's entry is Cesium-free, and a caller's own viewer loads the
unbound factories.

Differences the contract does not let us avoid:
- Double-clicking a badge no longer starts the viewer's entity follow,
  since draw items are not entities.
- The terrain fallback for anchors is no longer skipped while the globe
  is hidden: the globe port has no visibility getter.
- Without depth support the query port answers no heights, terrain
  included, so anchors wait for a cached floor there.
- On a viewer with no renderer bound, the surface counts as settled
  when anchors are refined.
2026-11-06 23:28:43 -08:00
Sameh Khamis faded8a418 Draw the installations layer's named markers through the renderer's ports
The named-site dots are a draw-port point set with horizon culling instead
of a raw point collection; their on-screen count tests the ellipsoid
horizon and projects through the query port, and they follow the camera
port's changed and moveEnd events and the frame port's preRender. Points
that only change look (a selection) are restyled in place. Clicks on a dot
read the draw hit; the item id is not the bare record id, so sibling
layers' pick-owner checks still treat a dot click as nobody's.

Code that only asks whether a click hit anything (the CCTV layer) now sees
a dot click as a hit, as it already did for the site markers: a draw item's
pick always resolves to its id.

The named markers leave the Cesium allow-list. The site markers in
rendering.js stay entities.
2026-11-06 23:28:43 -08:00