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.
This commit is contained in:
Sameh Khamis committed 2026-11-10 03:27:10 -08:00
1 parent 71f2f12f75
commit 46cdeba7fa
37 files changed
+370 -1165

No files matched your search

+2 -14
View File
@@ -162,10 +162,6 @@ export type Capability =
| 'surfaceShading'
/** A version of what surface heights answer against (`globe.surfaceVersion`). */
| 'surfaceIdentity'
/** Volumetric clouds (`globe.setClouds`). */
| 'clouds'
/** A water surface on the oceans (`globe.setWater`). */
| 'water'
/** Main-thread tile hooks: `tileTransform`, `admit` and `canvas` imagery. */
| 'imageHooks'
/** A screen-space sector modulation pass (a sweeping sonar band). */
@@ -188,14 +184,8 @@ export type Capability =
| 'quads'
/** Custom meshes in a local east-north-up frame. */
| 'meshes'
/** Wind streamlines, scalar rasters and raised raster shells. */
/** Wind streamlines and raised raster shells. */
| 'fields'
/** Stars and orbit rings in an inertial frame. */
| 'celestial'
/** Agents moving along polylines (traffic flow). */
| 'agents'
/** Satellites propagated by the renderer from their elements (`draw.orbits`). */
| 'orbits'
/** Rate-limited course easing (`IconItem.courseGlide`). */
| 'courseGlide'
/** Screen-space clustering of icons. */
@@ -213,6 +203,4 @@ export type Capability =
/** Reading the frame the eye is placed in (`camera.followFrame`). */
| 'followFrame'
/** A `threshold` per `changed` listener (`camera.on`). */
| 'cameraChangeThreshold'
/** A built-in quality benchmark. */
| 'benchmark';
| 'cameraChangeThreshold';
+5 -113
View File
@@ -68,8 +68,7 @@ export interface SetSpec {
/** What clamped items clamp to. */
clampTo?: ClampTarget;
/**
* `motionSegments` or `orbits`: the clock motion segments and orbits are
* evaluated on.
* `motionSegments`: the clock motion segments are evaluated on.
* `live` (the default) is wall time minus `delayMs`, as a live feed is
* drawn a little behind real time; `scene` is the frame port's scene time.
*/
@@ -90,14 +89,6 @@ export interface Placed {
fadeByDistance?: NearFar;
/** Shown only at eye distances in `[near, far)`, metres. */
displayRange?: [near: number, far: number];
/**
* Items in different sets that share a `lodGroup` are one thing drawn at
* different detail (a model near, an icon far), each shown over its own
* `displayRange`. A renderer may draw the group as one entity; a pick on
* it names the member shown at that distance (`Hit.set`, `Hit.id`) and
* reports the group (`Hit.lodGroup`).
*/
lodGroup?: string;
/** Draw over depth within this many metres of the eye (`Infinity`: always). */
disableDepthTest?: number;
}
@@ -124,9 +115,8 @@ export type ImageRef =
* climbing along the fix's up axis at `climbMps` (default 0). The elapsed
* time is clamped to `[minDtS, maxDtS]`; a negative `minDtS` runs the same
* path backward before `t0` (a warm-up), `maxDtS` is how long it coasts.
* The drawn course eases onto a new one over the item's `courseBlendMs`; an
* item that also has `courseGlide` eases at its rate instead, on a renderer
* with the `courseGlide` capability.
* The drawn course turns onto a new one at once; an item with `courseGlide`
* eases at its rate instead, on a renderer with the `courseGlide` capability.
*/
export type MotionSegment =
| { kind: 'hold'; courseDeg?: number }
@@ -170,12 +160,6 @@ export interface IconItem extends Placed {
motion?: MotionSegment;
/** `courseGlide`: ease the drawn course at a rate, from `fromCourseDeg`. */
courseGlide?: CourseGlide;
/**
* Ease the drawn course onto a new one over this long; 0 or omitted turns
* at once. The renderer has it; with the `courseGlide` capability an
* item's `courseGlide`, when it has one, is used instead.
*/
courseBlendMs?: number;
/** Degrees clockwise from north. */
course?: number;
/**
@@ -189,8 +173,6 @@ export interface IconItem extends Placed {
/** ECEF axis for `rotationMode: 'axis'`. */
alignedAxis?: Vec3;
pixelOffset?: ScreenXY;
/** Offset toward the eye, metres in eye space. */
eyeOffset?: Vec3;
anchor?: 'center' | 'bottom' | 'top';
/** Swap to `near` when drawn larger than `switchPx`. */
imageLod?: { near: ImageRef; switchPx: number };
@@ -212,13 +194,7 @@ export interface PointItem extends Placed {
export type LineStyle =
| { kind: 'solid'; color: Color }
| { kind: 'glow'; color: Color; power: number; taper?: number }
| {
kind: 'dash';
color: Color;
gapColor?: Color;
length: number;
pattern16?: number;
}
| { kind: 'dash'; color: Color; length: number; pattern16?: number }
| { kind: 'arrow'; color: Color }
| { kind: 'pattern'; image: ImageRef; repeat: number }
| { kind: 'flow'; color: Color; repeat: number; duty: number; speed: number };
@@ -297,12 +273,6 @@ export type ShapeGeometry =
* image fill turns with it.
*/
| { kind: 'rectangle'; rect: GeoRect; height?: number; rotation?: number }
| {
kind: 'box';
center: Position;
dimensions: Vec3;
orientation?: Quaternion;
}
| {
kind: 'wall';
positions: Position[];
@@ -322,13 +292,11 @@ export interface ShapeItem {
extrudeHeight?: number;
height?: 'absolute' | 'clampGround';
clampTo?: ClampTarget;
/** Classify what is inside the volume (tint the tiles it covers). */
classifyVolume?: boolean;
/** Pull toward the eye, metres, to win depth against coplanar surfaces. */
depthBias?: number;
/**
* Shaded by the renderer's fixed light (true) or flat colour (false).
* Omitted: lit for extruded shapes and boxes, flat otherwise. A renderer
* Omitted: lit for extruded shapes, flat otherwise. A renderer
* may draw clamped shapes, which drape on the surface, flat whatever it
* says.
*/
@@ -412,17 +380,6 @@ export type FieldSpec =
/** Draw the paths still, dimmed. */
paused?: boolean;
}
| {
kind: 'scalarRaster';
id: string;
values: Float32Array;
width: number;
height: number;
rectangle: GeoRect;
/** Colour ramp: value stops in ascending order. */
ramp: Array<{ value: number; color: Color }>;
alpha?: number;
}
| {
/**
* A raster on a sphere raised above the ground. Shells draw in
@@ -456,65 +413,6 @@ export interface FieldHandle extends Handle {
on(event: 'drawn', cb: () => void): Off;
}
export type CelestialSpec =
| {
kind: 'stars';
id: string;
/**
* Packed stars; omitted draws the renderer's own catalogue (one it
* streams, say), down to `magnitudeLimit`, or no stars when it has
* none.
*/
catalogue?: Float32Array;
magnitudeLimit?: number;
}
| {
kind: 'orbitRings';
id: string;
/** Each ring: packed `x, y, z` in the inertial frame, metres. */
rings: Float64Array[];
color: Color;
widthPx: number;
};
/**
* `orbits`: a satellite from its elements. The renderer propagates it with
* SGP4 on its set's `motionClock` and draws the marker and, optionally, its
* ring. Without the capability the app propagates and draws the positions
* itself as icons and lines.
*/
export interface OrbitItem {
id: string;
/** A two-line element set. */
tle: [line1: string, line2: string];
marker:
| { image: ImageRef; size: [width: number, height: number] }
| { pixelSize: number; color: Color };
/** The orbit's ring over `periods` orbits (default 1), in the inertial frame. */
ring?: { color: Color; widthPx: number; periods?: number } | null;
meta?: Meta;
show?: boolean;
pickable?: boolean;
/** As on `Placed`. */
displayRange?: [near: number, far: number];
lodGroup?: string;
}
/** `agents`: dots moving along polylines (traffic flow). */
export interface AgentPathItem {
id: string;
positions: Ecef[] | Float64Array;
/** Agents on this path. */
count: number;
speedMps: number;
/** 0 flows freely; 1 stopped; between creeps. */
congestion?: number;
color: Color;
pixelSize: number;
fadeByDistance?: NearFar;
meta?: Meta;
}
/**
* Columnar update for large sets (`columns`). Column `i` of each array is
* row `ids[i]`. `dirty` limits the upload to these index runs.
@@ -580,12 +478,6 @@ export interface DrawPort {
meshes?(spec: SetSpec): DrawSet<MeshItem>;
/** `fields`. */
field?(spec: FieldSpec): FieldHandle;
/** `celestial`: drawn in an inertial frame rotated by sidereal time. */
celestial?(spec: CelestialSpec): Handle;
/** `agents`. */
agents?(spec: SetSpec): DrawSet<AgentPathItem>;
/** `orbits`. */
orbits?(spec: SetSpec): DrawSet<OrbitItem>;
/**
* Whether clamped items (`clampTo: 'tiles' | 'both'`, draped lines and
* shapes) are draped onto the 3D tiles now (`draped`), or drawn over them
+7 -43
View File
@@ -31,21 +31,11 @@ export interface PhotorealStatus {
*/
export type TerrainSpec = (
| { kind: 'ellipsoid' }
| { kind: 'quantizedMesh'; url: string; requestVertexNormals?: boolean }
/**
* The renderer's global terrain, through `CreateOptions.worldDataToken`
* (for the default renderer, Cesium World Terrain).
*/
| { kind: 'world'; requestVertexNormals?: boolean }
/** A DEM image pyramid (`{z}/{x}/{y}`), heights encoded in RGB. */
| {
kind: 'heightmap';
url: string;
encoding: 'terrarium' | 'mapbox';
maxLevel?: number;
/** The geoid the encoded heights are relative to; omitted: the ellipsoid. */
geoid?: 'egm96' | 'egm2008';
}
) & {
/** Vertical exaggeration of the drawn terrain; default 1. */
exaggeration?: number;
@@ -75,20 +65,13 @@ export interface ImagerySpec {
* `CreateOptions.worldDataToken` (for the default renderer, Cesium ion's
* world imagery), in `worldStyle`. `canvas`: `imageHooks`.
*/
kind: 'xyz' | 'wmts' | 'arcgis' | 'world' | 'single-image' | 'canvas';
kind: 'xyz' | 'world' | 'single-image' | 'canvas';
/** `world`: aerial (the default), or aerial with labels. */
worldStyle?: 'aerial' | 'aerialLabels';
/** URL or URL template (`{x}`, `{y}`, `{z}`, `{s}`, `{time}`). */
url?: string;
/** `'canvas'` (`imageHooks`): draws one tile. */
drawTile?: (tile: TileRequest, canvas: HTMLCanvasElement) => void;
/** WMTS: layer, style, tile matrix set and format. */
wmts?: {
layer: string;
style: string;
tileMatrixSetId: string;
format?: string;
};
subdomains?: string[];
tiling?: TilingScheme;
rectangle?: GeoRect;
@@ -216,11 +199,6 @@ export interface BaseStatus {
*/
export interface SkySettings {
atmosphere: boolean;
atmosphereTuning?: {
brightness?: number;
hueShift?: number;
saturation?: number;
};
stars: boolean;
/** Milky Way brightness, 0..1. */
milkyWay: number;
@@ -232,22 +210,12 @@ export interface SkySettings {
lighting: boolean;
}
export type SurfaceShading =
| {
kind: 'relief';
/** Elevation-like field to shade, row-major, `width × height`. */
values: Float32Array;
width: number;
height: number;
rectangle: GeoRect;
strength: number;
}
/**
* View-lit shading of the drawn terrain's own relief (the ellipsoid's
* curvature where terrain has no normals); darkens only, at most
* `strength` opacity.
*/
| { kind: 'hillshade'; strength: number };
/**
* View-lit shading of the drawn terrain's own relief (the ellipsoid's
* curvature where terrain has no normals); darkens only, at most
* `strength` opacity.
*/
export type SurfaceShading = { kind: 'hillshade'; strength: number };
export interface LoadProgress {
tilesPending: number;
@@ -287,10 +255,6 @@ export interface GlobePort {
surfaceVersion?(): number;
/** `surfaceShading`. */
setSurfaceShading?(shading: SurfaceShading | null): void;
/** `clouds`: the renderer's volumetric clouds, or none. */
setClouds?(clouds: { coverage: number } | null): void;
/** `water`: the renderer's own water surface on the oceans, on or off. */
setWater?(enabled: boolean): void;
readonly imagery: {
/**
* Without `imageHooks`, a spec with `tileTransform`, `admit` or kind
+3 -18
View File
@@ -24,8 +24,6 @@ export const CAPABILITIES = Object.freeze([
'imageryFrames',
'surfaceShading',
'surfaceIdentity',
'clouds',
'water',
'imageHooks',
'screenModulation',
'gpuTiming',
@@ -38,9 +36,6 @@ export const CAPABILITIES = Object.freeze([
'quads',
'meshes',
'fields',
'celestial',
'agents',
'orbits',
'courseGlide',
'cluster',
'styles',
@@ -50,7 +45,6 @@ export const CAPABILITIES = Object.freeze([
'globeVisibility',
'followFrame',
'cameraChangeThreshold',
'benchmark',
]);
/** @type {readonly import('./frame').FrameStep[]} */
@@ -69,7 +63,6 @@ export const FRAME_STEPS = Object.freeze([
/** Every quality setting a renderer may support. */
export const QUALITY_KEYS = Object.freeze([
'pixelRatio',
'overlayPixelRatio',
'msaa',
'tiles3dDetail',
'terrainDetail',
@@ -83,7 +76,6 @@ export const QUALITY_KEYS = Object.freeze([
'particles',
'models',
'postFx',
'animatedStyleFps',
'sonarCadenceHz',
'targetFps',
]);
@@ -154,8 +146,6 @@ export const PORTS = deepFreeze({
['isGlobeVisible', 'globeVisibility'],
['surfaceVersion', 'surfaceIdentity'],
['setSurfaceShading', 'surfaceShading'],
['setClouds', 'clouds'],
['setWater', 'water'],
['imagery.getSplit', 'splitSwipe'],
['imagery.setSplit', 'splitSwipe'],
]),
@@ -173,9 +163,6 @@ export const PORTS = deepFreeze({
['quads', 'quads'],
['meshes', 'meshes'],
['field', 'fields'],
['celestial', 'celestial'],
['agents', 'agents'],
['orbits', 'orbits'],
]),
camera: Object.fromEntries([
...required(
@@ -232,7 +219,6 @@ export const PORTS = deepFreeze({
'projectMany',
'isOccluded',
'sampleHeightNow',
'sampleHeightNowMany',
'sampleHeight',
'clampToSurface',
'rayCast',
@@ -269,8 +255,8 @@ export const PORTS = deepFreeze({
['screenModulation', 'screenModulation'],
]),
credits: Object.fromEntries(required('addStatic', 'list', 'on')),
quality: Object.fromEntries([
...required(
quality: Object.fromEntries(
required(
'knobs',
'get',
'set',
@@ -280,8 +266,7 @@ export const PORTS = deepFreeze({
'signals.gpuTiming',
'signals.on',
),
['benchmark', 'benchmark'],
]),
),
drawSet: Object.fromEntries([
...required(
'id',
-15
View File
@@ -8,8 +8,6 @@ import type { Off } from './common';
export interface QualitySettings {
/** Absolute device pixel ratio for the scene; 0 = browser recommended. */
pixelRatio: number;
/** Pixel ratio of screen-space overlays. */
overlayPixelRatio: number;
msaa: 0 | 2 | 4 | 8;
/** 0..1: 3D tile detail (screen-space error, both directions). */
tiles3dDetail: number;
@@ -25,8 +23,6 @@ export interface QualitySettings {
particles: number;
models: { maxInstances: number; maxDistance: number };
postFx: { bloom: boolean; sharpen: boolean; style: 'low' | 'high' };
/** Frame rate of animated styles. */
animatedStyleFps: number;
/** Updates per second of a screen modulation sweep. */
sonarCadenceHz: number;
targetFps: number;
@@ -90,12 +86,6 @@ export interface ProbeResult {
knobs: KnobDescriptor[];
}
export interface BenchResult {
frames: number;
cpuMs: { median: number; p95: number };
gpuMs?: { median: number; p95: number };
}
export interface QualityPort {
/** The settings this renderer supports, with ranges, defaults and costs. */
knobs(): KnobDescriptor[];
@@ -108,9 +98,4 @@ export interface QualityPort {
readonly gpuTiming: 'none' | 'frame' | 'perPass';
on(event: 'frame', cb: (signals: FrameSignals) => void): Off;
};
/** `benchmark`: the renderer's own; the governor has a default. */
benchmark?(options: {
durationMs: number;
scene?: 'standard';
}): Promise<BenchResult>;
}
-12
View File
@@ -19,8 +19,6 @@ export interface Hit {
id: string;
/** The item's `meta`, as it was given; absent when the item had none. */
meta?: Meta;
/** The item's `lodGroup`, when it has one: the thing it is a detail level of. */
lodGroup?: string;
/** The map itself (tiles or globe), rather than a drawn item. */
surface: boolean;
/** Where the hit is, when the renderer knows it. */
@@ -96,16 +94,6 @@ export interface QueryPort {
isOccluded(position: Ecef): boolean;
/** `sampleHeight`: cached height now, or null when not loaded. */
sampleHeightNow(point: LonLat, options?: HeightOptions): number | null;
/**
* `sampleHeight`: cached heights for many points at once: packed `lon, lat`
* degrees in, one height per point out (NaN when not loaded). The app makes
* its per-frame height reads through this, once a frame.
*/
sampleHeightNowMany(
points: Float64Array,
out: Float64Array,
options?: HeightOptions,
): void;
/**
* `sampleHeight`: heights, loading as needed; null per miss.
* `mostDetailed` (`finestHeights`) waits for the finest data.