The contract text speaks of the renderer

This commit is contained in:
Sameh Khamis committed 2026-11-15 19:20:48 -08:00
1 parent 9862b2a165
commit 256e992372
17 files changed
+33 -32

No files matched your search

+1 -1
View File
@@ -48,7 +48,7 @@ async function overAustin(h, r, height = 2000) {
/**
* Waits until what is drawn has loaded (icon images, tiles, models), as a
* query answers from what is loaded. Where the renderer draws synchronously it
* settled at once.
* is settled at once.
*/
async function settled(r) {
const result = await r.whenSettled({ timeoutMs: 20000 });
+2 -2
View File
@@ -55,7 +55,7 @@ export interface CameraPose {
/**
* Vertical field of view, radians. `fovy` and `aspectRatio` describe a
* centred perspective frustum. Where the renderer's frustum is off-centre or
* orthographic reports the nearest centred one here and its exact
* orthographic, it reports the nearest centred one here and its exact
* projection only in `matrices()`; code that culls or projects exactly
* reads `matrices()`.
*/
@@ -147,7 +147,7 @@ export interface FollowTarget {
visualPosition?(t: number): Ecef | null;
/**
* The drawn item this target is, when it is one. Where the renderer moves
* items itself (`motionSegments`) follows where it draws the item, so the
* items itself (`motionSegments`), it follows where it draws the item, so the
* eye and the icon never part; `position` stays the answer elsewhere.
*/
item?: { set: string; id: string };
+2 -2
View File
@@ -1,8 +1,8 @@
/**
* Full-screen effects: visual styles, bloom, sharpen and screen modulation.
* Each style is a plain full-screen pass over the frame's colour. The application owns
* Each style is a plain full-screen pass over the frame's colour. The
* application owns the styles and defines them on the renderer
* renderer runs the same set; a renderer's own styles are extra ones.
* (`defineStyle`); the renderer's own styles are extra ones.
*/
import type { Off } from './common';
+5 -6
View File
@@ -208,12 +208,11 @@ export interface BaseStatus {
/**
* The sky. These switch parts of it on and off; they do not say how it
* looks. How the sky, the atmosphere over the ground, distance haze, the
* lighting and the tone mapping and exposure of the frame look is each
* renderer's own, and no check compares colours with
* another's. With `atmosphere`, `fog` and `lighting` off and clear weather,
* a renderer applies none of its look: what is drawn shows its own colours.
* A renderer whose sun, moon or fog are not separate from its
* atmosphere follows `atmosphere` for them and reports them as it draws them.
* lighting and the tone mapping and exposure of the frame look is the
* renderer's own, and no check compares colours. With `atmosphere`, `fog`
* and `lighting` off and clear weather, the renderer applies none of its
* look: what is drawn shows its own colours. Where the renderer's sun, moon
* or fog are not separate from its atmosphere, it follows `atmosphere` for them and reports them as it draws them.
*/
export interface SkySettings {
atmosphere: boolean;
+1 -1
View File
@@ -26,7 +26,7 @@
*
* A click is delivered with its pick already made, once, and shared by
* every subscriber (`PointerEv.pick`). Where the renderer's picks answer a
* or two late delivers the click that much later rather than answering
* frame or two late, it delivers the click that much later rather than answering
* without them; `query.pick` stays synchronous for everything else.
*
* The engine's stock behaviours (select on click, follow on double-click)
+5 -5
View File
@@ -34,9 +34,9 @@ export interface RendererPlugin {
}
/**
* What only some renderers have and the application uses where given, does
* What the renderer's plugin hands the application beside the contract; the
* application uses each where given and does without where not. None is a
* do is in the ports.
* contract member: what the renderer should do is in the ports.
*/
export interface ApplicationHooks {
/**
@@ -173,9 +173,9 @@ export interface Renderer {
releaseUnused(): void;
on(event: 'error', cb: (error: Error) => void): Off;
/**
* The drawing context was lost, or came back. A renderer that cannot restore its context
* never sends `contextRestored`; the application then makes
* a new renderer.
* The drawing context was lost, or came back. Where the renderer cannot
* restore its context it never sends `contextRestored`; the application
* then makes a new renderer.
*/
on(event: 'contextLost' | 'contextRestored', cb: () => void): Off;
/**
+2 -1
View File
@@ -1,5 +1,6 @@
/**
* Who hears each pointer event: the contract's input rules
* Who hears each pointer event: the contract's input rules, shared by the
* Cesium port and the stub
* (`router.js`).
*/
import type { InputPort, Lease, PointerEv } from '../contract/index';
+2 -1
View File
@@ -1,7 +1,8 @@
/**
* @module render/input/router
* @description Who hears each pointer event: the contract's input rules
* (`src/render/contract/input.d.ts`). The renderer feeds it
* (`src/render/contract/input.d.ts`), shared by the Cesium port and the stub.
* The renderer feeds it
* the events its engine sees, already shaped as `PointerEv` (its clicks with
* their pick); the router decides, from the leases and the presses under
* way, which listeners get each one, and keeps the input port's leases and
+1 -1
View File
@@ -5,7 +5,7 @@
* `MotionSegment` and `CourseGlide` in `render/contract/draw.d.ts`). The app
* reads a moving icon back with it (to follow it, label it, judge a pick or
* its horizon) instead of asking the renderer; the renderer evaluates its
* segments with it on the CPU, and the default renderer's GPU icons draw the
* segments with it on the CPU, and the Cesium port's GPU icons draw the
* same path (`data/iconSegment.js` packs it, the shader evaluates it).
*
* Times are epoch ms on the set's motion clock. Plain numbers and `{x, y, z}`
+1 -1
View File
@@ -1,7 +1,7 @@
/**
* How a set that recedes (`SetSpec.recede`) shrinks and fades its items
* toward the globe's limb (`recession.js`), so the renderer draws exactly
* same factors.
* those factors.
*/
import type { RecedeSpec } from './contract/index';
+1 -1
View File
@@ -2,7 +2,7 @@
* @module render/recession
* @description How a set that recedes (`SetSpec.recede`) shrinks and fades
* its items toward the globe's limb, free of Cesium, so the renderer
* draws the same factors. The factors are 1 while an item is nearer than
* draws exactly those factors. The factors are 1 while an item is nearer than
* `startLimbRatio` of the distance from the eye to the limb, and ease
* (smoothstep) to `scaleFloor` and `alphaFloor` at the limb. The whole of it
* eases back to nothing as the eye climbs through the blend band
+1 -1
View File
@@ -2133,7 +2133,7 @@ export function createStubRenderer(options = {}) {
/**
* The stub as a renderer plugin (`RendererPlugin`), for running the whole
* application on it: each renderer it makes fills the container it is given
* with a canvas, as any plugin's does. Nothing runs on its own: the caller
* with a canvas, as the Cesium plugin's does. Nothing runs on its own: the caller
* drives the loop (`testing.tick()`), each frame or as a test needs.
* @param {Parameters<typeof createStubRenderer>[0]} [options] For each
* renderer it makes (`capabilities`, `viewport`, `time`...).