Commit Graph
26 Commits
Author SHA1 Message Date
Sameh Khamis 74d6d97b29 Draw the Global Context range ring and its pulses through the draw port
The ring, its sonar fronts and the band behind them leave Cesium: the
ring and each front are one solid line with an outline, the band is one
flat unpickable ellipse at the rim filled with a canvas painted from the
pulse radii. rangeRingCesium.js goes, and the Cesium allow-list is empty.

Solid lines take an optional outline ({color, widthPx}, inside the
line's width on each side), drawn in the line's own pass so a
translucent halo never darkens where it meets the core; both colours
change in place, and outlined lines never settle into the static batch.
An unclamped image fill takes a new canvas in place: copied into its
texture when the size is the same.

A parked view steps the pulses from the 80 ms timer before it asks for
the frame that draws them, so it draws one frame a step; frames the
camera moves in, or held drawing, step them every frame, and the band is
painted at most every 80 ms. The lines reference scene gains an outlined
line.
2026-11-10 07:48:07 -08:00
Sameh Khamis c8346c9fda Keep shape radii, rim gradients, depth-fail looks, sweep cadence and step camera moves out of the renderer contract
Shapes take their radii in metres; the world annotation ring follows the
camera height itself (ringRadiusAt), resizing on preRender. The radial rim
preset and depthBias go: the launch pad zone draws a canvas image fill made
by the layer. Solid and dashed lines take one depthFail look (solid or
dash) in place of depthFailColor and depthFailDash. sonarCadenceHz goes from
the quality settings: nothing set it, and the sweep moves every 80 ms.

Camera move, look, rotateAround and zoom leave the camera port: the app's pans,
in-place turns, globe turns and zooms are setView views summed over the pose
(geo/eyeMoves), and the Cesium port places a view by direction and up
exactly rather than through heading, pitch and roll. The conformance driver
runs those script steps through setView; the lookAt script turns in place
where it turned about the frame-local axis, and its reference is recorded
again.
2026-11-10 04:08:41 -08:00
Sameh Khamis 46cdeba7fa Remove renderer contract members nothing in the application uses
Drops from the contract, the stub, the Cesium renderer and the
conformance suite: agent paths, renderer-propagated orbits and celestial
draws (orbits stay drawn as icons and inertial lines), scalar raster
fields, lodGroup, volume classification, icon eye offsets, the dash gap
colour, box shapes, courseBlendMs (courseGlide covers easing), relief
surface shading, globe clouds and water, sky atmosphere tuning, heightmap
and quantized-mesh terrain, WMTS and ArcGIS imagery, the batched cached
height read, the quality benchmark and the animated-style and overlay
pixel-ratio knobs. Capabilities clouds, water, celestial, agents, orbits
and benchmark go with them.

The lodGroup check becomes a displayRange check across two sets, the
height-query check uses an extruded polygon in place of a box, the shape
scenes draw extruded blocks where they drew boxes, and the fields scene
draws a raster shell. The shape references are recorded again.
2026-11-10 03:27:10 -08:00
Sameh Khamis b9f8ac1ff0 Merge main through #1319 into the renderer seam
Brings in range ring visibility and sonar pulses (#1518, #1519), the
drone airspace layer (#1086), the Houston CCTV pack (#1125), typed chat
(#1507, #1545), in-view ground sampling for infrastructure (#1464) and
the CCTV model specs refresh (#1319).

What main added that reached Cesium or the viewer:
- Drone airspace draws its zones as clamped fills and draped boundary
  lines in draw sets and takes clicks from the input dispatcher, as fire
  perimeters does.
- Infrastructure ground sampling tests the view frustum and the horizon
  from the camera port's pose (geo/frustum, geo/horizon) and reads loaded
  terrain through the height queries.
- The awareness lifecycle reads the canvas, frames and whether the camera
  controls take input through the ports. The sonar echo field measures
  with the geo helpers.
- The range ring's pulses need a disc whose fill is computed per pixel
  from values set each frame, and an outlined line whose opacity changes
  without a rebuild. The draw port has neither, so that code keeps to one
  module, src/layers/awareness/rangeRingCesium.js, which is on the Cesium
  allow-list until the draw port can draw them. It draws only on a viewer
  with a Cesium primitive collection, and takes its primitives out of the
  collection it drew them in. On the stub the layer draws the
  ring without pulses as a haloed line through the draw port.

Also from review of the previous merge: tests that the scene's viewer
hooks install the zoom-out guard, and that an ambiguous area name is
settled by the ground at mid-screen, else where the camera stands.
2026-11-09 19:59:26 -08:00
Sameh Khamis 6c1f91014c Draw imported files through the draw port, off Cesium
Import no longer loads KML, KMZ, GeoJSON and GPX through Cesium's data
source loaders. geoImportFeatures.js reads the sanitized file into plain
pins, lines, walls, polygons and ground overlays with the looks those
loaders gave them: icon, scale, colour, heading and hot spot, the shared
and inline style precedence, line and polygon colours and widths,
extruded and clamped geometry, rotated boxes and quads, and GeoJSON's
48 px pins, draped lines along rhumb lines and quarter-opacity fills.
geoImportPins.js draws them in three draw sets per file, places ground
pins through the height service (0 on the bare ellipsoid, whose coarse
tiles sag below it; the mesh nearby on photoreal maps), follows a
double-clicked pin, frames Fly-to, and shows, hides and removes them.

The Cesium adapter now draws two members the contract already had: an
icon's pixel offset and the wall shape. Image fills draw in the
translucent pass, so an overlay's own alpha blends as it did.

The Cesium allow-list is now empty; the ratchet test checks that its
scan still sees each way of reaching Cesium. The QA scripts read what a
file drew through the import's drawn(id), and the large-file check
compares it with Cesium's own reading of the same KML. A file the
renderer refuses to draw is refused by itself, without stopping its
batch. Two translations no longer used are dropped.
2026-11-09 15:50:53 -08:00
Sameh Khamis 4c587a6d0f Application scene and conformance page leave the Cesium allow-list
The application scene is the composition root: it now takes everything it
needs from one adapter module (src/render/cesium/application.js), which
loads, shows and releases the photoreal tileset and hands out the viewer
hooks. The conformance page keeps importing the adapter's harness and scene
renderer, since running the suite on Cesium is its purpose. Both are named
in the ratchet as the only files outside the adapter that may import it,
each limited to those modules, by name only, and the modules may not hand
out the Cesium namespace. Only geoImportPins stays on the allow-list.
2026-11-09 12:58:45 -08:00
Sameh Khamis 2a26d13fff render: wind relief is the globe port's hillshade; the wind layer no longer reaches Cesium
The wind relief now asks the globe port for hillshade surface shading at
0.28 instead of building a globe material itself; the Cesium globe port
draws the same view-directed shading, over terrain normals or the globe's
curvature, and the unbound provider now lists surfaceShading. The wind
layer's canvas flow, bounds, imagery fade and render requests go through
the camera, frame and query ports, so src/layers/wind/rendering.js and
relief.js leave the Cesium allow list.

A refused shading request is taken back so it never shows after Wind is
off, and a camera height that is not a number falls back as before.

The application layers and standalone catalog entries no longer load the
unbound factories themselves: a viewer with no renderer bound
needs render/cesium/unbound loaded first. The contract and current-state
docs say what the Cesium adapter's fields and surface shading do now.
2026-11-09 08:13:04 -08:00
Sameh Khamis 90499762f5 Add pointer-driven camera scripts with Cesium goldens, and count wheel lines as Cesium does
Five new camera conformance scripts move the camera by user input: a
left drag that coasts, thirty pixel-mode and thirty line-mode wheel
notches from 5 km, a middle-drag tilt, and Shift and Ctrl drags held too
long to coast. The runner turns input steps into pointer events for a
driver: a move starts where the pointer last pressed or moved and carries
the held button. The golden recorder now drives Cesium's own screen-space
camera controller on a stand-in canvas, with Date on the virtual clock so
inertia is deterministic. The existing goldens are unchanged.

A harness that answers pointer input sets cameraInput and a pointer hook.
Harnesses without it, such as the stub, skip the input scripts.

The input port reported a line-mode wheel at 33 1/3 pixels a line. It now
counts lines as the reference does, 40 pixels a line and 3 lines a page,
so a pixel or line wheel converts back to the same pixels.
2026-11-08 20:08:56 -08:00
Sameh Khamis ef616b7905 Share the camera events and the stub's drawn positions with other cameras
The geo export now has geodesicAt and horizonFrom. The camera events module
is a public export (./render/camera/events) and holds move detection and the
command hooks as well as the per-listener changed measure; the stub camera
uses them. Each onCommand registration is now its own, so removing one twin
leaves the other. The stub's testing.drawnPosition says where it draws an
item, so a camera that is not the stub's can follow drawn items.
2026-11-08 19:22:42 -08:00
Sameh Khamis f9749ac83c Redefine the modulation sector: a sweep over markers with a reach and a floor
ModulationSector gains radius and floor and says what it dims and what it
leaves alone; picks are unchanged and setting or clearing a sector asks
for one frame. The stub names its pass screenModulation, and a
conformance check covers the pass, the frame request and the pick.
2026-11-08 14:37:59 -08:00
Sameh Khamis c87bd38d18 Add fields' alpha, paused, shell detail and a drawn event, in the contract and the stub
windStreamlines takes alpha and paused; rasterShell replaces detailWindow
with a detail image and rectangle and says how shells stack, blend and
update; FieldHandle.on('drawn') says once per change that it is drawn,
never while hidden. The stub fires it on the render after a change, and a
conformance check covers it. The Cesium adapter has no fields yet.
2026-11-08 14:19:52 -08:00
Sameh Khamis c32bf3177d Add hillshade surface shading and draw it on the Cesium globe
The globe port takes the globe's material only when it is free, follows a
terrain change, lets go of a material someone replaced, and takes it again
once it comes free; idle ticks ask for no frame.
2026-11-08 13:50:38 -08:00
Sameh Khamis 456645f291 Name the surface heights answer against: globe.surfaceVersion and the surface settle kind
A new capability, surfaceIdentity, adds globe.surfaceVersion(): a number
that changes whenever what surface heights answer against changes (base,
terrain or photoreal swapped, the globe shown or hidden) and never on
camera moves or tile loads, so the app can key cached heights by it. The
settle kind 'surface' says whether that surface has loaded what is in
view: the terrain while the globe is shown, otherwise the drawn tiles,
false with neither; a renderer without the capability answers it as base.

The Cesium globe port reads both off the scene, so a base changed around
the port counts too; its versions come from one counter shared by every
port. The stub bumps on real base, terrain, photoreal and visibility
changes. A conformance check and a globe port test cover them.
2026-11-08 13:31:03 -08:00
Sameh Khamis e15cfb3e32 Let shapes choose lit or flat shading, and say how a renderer that cannot drape falls back
ShapeItem.lit picks the renderer's fixed light or a flat colour; omitted,
extruded shapes and boxes are lit and the rest flat, as they were. The
Cesium draw port lights unclamped colour and image fills by it; clamped
shapes still drape unlit. A new reference scene, shapes-lit, draws a lit
and a flat box and square.

LineItem.mode now says a renderer that cannot drape at all draws draped
lines and clamped shapes as overlay, and clampState() says overlay. The
Cesium port says overlay when its context has no depth textures, which
only a WebGL 1 context can lack.
2026-11-08 13:11:25 -08:00
Sameh Khamis 45302e9fbf Bound drillPick's work, pick before styles, and put changed thresholds behind a capability
The query contract now says picks answer against the scene as drawn before
effects, and that a drillPick limit bounds the work as well as the answer:
the renderer stops at `limit` hits and looks through at most
max(limit, 16) things under the pointer. The Cesium query port passes that
depth to Cesium's drill (a pick looking under something unpickable stays
unbounded), a click's drill caches one pass per depth, and the stub counts
unpickable items toward the depth.

CameraPose says fovy and aspectRatio describe the nearest centred
perspective frustum, the exact projection being in matrices().

A changed listener's own threshold is now the capability
cameraChangeThreshold; without it every listener fires at 0.5. The Cesium
and stub cameras have it, measured per listener without touching Cesium's
shared percentageChanged.

Conformance: draw.drillPick checks limit 0, never the surface, nothing over
the bare globe, an unpickable cover, nearest first and a bounded prefix;
query.pickBeforeStyles picks an icon under a mirroring style; the threshold
trace is skipped without its capability.
2026-11-08 12:37:04 -08:00
Sameh Khamis 4a9b1389ba Draw rocket launches through the renderer ports, off Cesium
The launches layer's sites, markers, reticles, mission lines, live orbit
rings and pad zone are now renderer draw sets. Picks go through the query
port, double-click follow through the camera port (shared with other layers
in src/data/stockFollow.js), and per-frame work through the frame port.
rendering.js, orbitRendering.js and launchPad.js leave the Cesium list.

The Cesium draw port gains what these need: pattern line styles, lines in
the inertial frame turned each frame by the set's motion clock, radial-rim
fills on clamped ellipses with a depth bias, and parking for hidden lines
that cannot settle into a static batch, so a hidden line no longer costs a
draw each frame. A roster writes each set once, and a followed live payload
shares one position sample with its marker each frame.
2026-11-08 11:26:21 -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 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 396e7f0deb Ratchet Cesium-shaped viewer access in files off the Cesium list
A second ratchet beside the Cesium allow-list: files off that list (and
outside the Cesium adapter) may no longer reach Cesium through the viewer
either. src/render/viewerAccessAllowList.json records, per file, how many
such accesses it still makes (the viewer's entities, dataSources, scene,
camera, clock, imageryLayers, terrainProvider, trackedEntity and canvas;
the scene's primitives, pick, drillPick, pickPosition, globe, frame
events, canvas, requestRender and camera), read from the parsed source in
their plain, optional, bracketed, call-result and destructured forms.
viewer.container, comments and tests do not count.

The test fails when a file makes more accesses than recorded, when a
recorded count is higher than the file now needs or names a file gone or
back on the Cesium list, and when the record grows against origin/main.
scripts/viewer-access-baseline.mjs lowers the record to what the files
hold; it never adds or raises an entry. The record starts with 25 files
and 50 accesses.
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 3dc79515bb Settle imagery, world data and sky capabilities in the renderer contract
- setFrames takes a timed source (URL frames, or video tiles in
  segments) on the scene clock by default or its own; frameReady fires
  once each time the shown frame is drawn.
- drapeOn is 'surface' | 'objects' | 'all' plus lit; imagery.host() and
  onHostChange go, and the drape rule the app derives is written out.
- ImagerySpec.fetchTile answers bytes, missing or defer on every
  renderer; tileTransform, admit and canvas imagery need imageHooks, and
  add() throws for them without it.
- Generic names for the default renderer's world data: worldDataToken,
  the photoreal fallback route, and world terrain and imagery.
- clouds and water capabilities, with globe.setClouds and setWater.
2026-11-05 13:26:14 -08:00
Sameh Khamis a7aeeb558a Settle leases, styles, credits and controls in the renderer contract
- claimPointer takes a grab filter, asked on each down: a lease takes
  only the presses it grabs, and wheel, pinch and every other press stay
  with the camera and everyone else. Each event of a press goes where its
  down went, per button, so a claim never takes a press under way.
- The app owns the styles: effects.defineStyle passes a GLSL (and optionally
  WGSL) full-screen pass, with the shader interface written out.
- Credits are plain data ({ text, href, logoUrl, inline }) that the app
  renders; CreateOptions.creditContainer goes.
- controls.coast { drag, zoom } in seconds replaces the inertia trio; the
  stub's defaults are the default renderer's, converted.
- The frame order is the default renderer's own: a move made by follow or
  in preUpdate reaches changed on the next frame.
2026-11-05 13:11:59 -08:00
Sameh Khamis b7c26351f7 Settle the draw decisions in the renderer contract
- lodGroup links items across sets as one thing at different detail;
  picks name the member shown and report the group. displayRange is
  half-open.
- An orbits capability: the renderer propagates two-line elements with
  SGP4 on the set's motion clock. The stub propagates with satellite.js.
- Height queries see draw sets only with includeInHeightQueries (was
  excludeFromHeightQueries); HeightSample.source gains 'set'.
- courseGlide is a capability; courseBlendMs eases the course on every
  renderer.
- Arc segments climb at climbMps; a negative minDtS stays for the
  aircraft warm-up.
- The star catalogue is optional, a hidden column row keeps its motion,
  and draw.clampState() reports the drape fallback.

Checks cover the climb and warm-up, lodGroup ranges, orbits against SGP4
(with and without motionSegments), hidden rows resuming, and sets not
answering height queries by default.
2026-11-05 12:50:58 -08:00
Sameh Khamis 8db995acfc Define the renderer contract, with a stub renderer and a conformance suite
The renderer contract is what the application asks of a 3D renderer. It is nine ports
(frame, globe, draw, camera, query, input, effects, credits, quality) plus
the renderer itself, one strict .d.ts per port in src/render/contract/.
PORTS lists every member at run time, and a TypeScript-compiler test fails
when the list and the types disagree on one member. An optional member
exists only with its capability; a required one answers null or empty
without it. Nothing in the application uses the contract yet.

The stub renderer (src/render/stub/) implements every port in memory and
draws nothing. Its camera is a port of the default camera's maths: views,
lookAt, flights with their height arc and easing, rectangle framing on the
geodesic midpoint, the view rectangle with its horizon and pole cases,
changed thresholds, follows, and flights that finish inside the call.

The conformance suite (src/render/conformance/) runs 59 checks against
a renderer through the contract alone, in Node or in a browser page. The
camera checks compare traces recorded from Cesium's own Camera, headless on
a virtual clock (scripts/record-camera-goldens.mjs), to 1 mm, 1e-9 and
1e-3 px. The other checks cover listener rules on every subscription, the
frame loop, draw sets, picks, motion clocks, heights, leases, imagery,
styles, credits and quality knobs. The stub passes all of them but the
model check, which needs a glTF asset.

Reference scenes draw one scene per primitive family, a city and a
calibration path from orbit to the street, from contract calls only and
with no network. /dev/conformance/ draws them on the Cesium scene renderer
(src/render/cesium/sceneRenderer.js), records references through a
dev-server-only, loopback-only endpoint, and compares captures with
pixelmatch's antialias detection plus a solid-pixel count. Measured on
Cesium: every MSAA setting passes, and a dropped 4 px point, a dropped 2 px
line and a 1 px shift of the view fail. visual.js states the limits.

The package exports ./render/contract, ./render/stub and
./render/conformance. Documented in docs/RENDERER-CONTRACT.md,
docs/CODE-BOUNDARIES.md and docs/CURRENT-STATE.md.
2026-11-04 14:21:48 -08:00