mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
The contract text speaks of the renderer
This commit is contained in:
1 parent
9862b2a165
commit
256e992372
17 files changed
+33
-32
No files matched your search
@@ -8129,7 +8129,7 @@ renderer's own objects: the record of files that still did,
|
|||||||
- The renderer follows its container's size (`Renderer.resize`, from a
|
- The renderer follows its container's size (`Renderer.resize`, from a
|
||||||
`ResizeObserver`).
|
`ResizeObserver`).
|
||||||
- The credits: the Cesium renderer's plugin says it shows them in a display
|
- The credits: the Cesium renderer's plugin says it shows them in a display
|
||||||
its own (`ownCreditDisplay`; Cesium's `#cesium-credits`) keeps it. On the
|
of its own (`ownCreditDisplay`; `#cesium-credits`), which it keeps. On the
|
||||||
stub, the application shows what the credits port lists in its own line
|
stub, the application shows what the credits port lists in its own line
|
||||||
at the bottom left (`#gev-credits`, `src/ui/creditsView.js`): the inline
|
at the bottom left (`#gev-credits`, `src/ui/creditsView.js`): the inline
|
||||||
credits on the line, the rest (the layers' data credits among them) in
|
credits on the line, the rest (the layers' data credits among them) in
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ The package exports these modules:
|
|||||||
| `gods-eye-view/render/camera/events` | The camera port's events: `changed` per listener, `moveStart`/`moveEnd`, command hooks |
|
| `gods-eye-view/render/camera/events` | The camera port's events: `changed` per listener, `moveStart`/`moveEnd`, command hooks |
|
||||||
| `gods-eye-view/render/conformance` | The conformance suite, reference scenes and visual comparison |
|
| `gods-eye-view/render/conformance` | The conformance suite, reference scenes and visual comparison |
|
||||||
|
|
||||||
The pieces that do not depend on Cesium are exported
|
The pieces that do not depend on Cesium are exported too, each with its
|
||||||
too, each with its own `.d.ts`:
|
own `.d.ts`:
|
||||||
|
|
||||||
- `gods-eye-view/render/input/router`: the input port's leases and routing;
|
- `gods-eye-view/render/input/router`: the input port's leases and routing;
|
||||||
- `gods-eye-view/render/stub/camera`, `.../stub/viewRectangle` and
|
- `gods-eye-view/render/stub/camera`, `.../stub/viewRectangle` and
|
||||||
@@ -92,8 +92,8 @@ optional:
|
|||||||
`detail: {image, rectangle}`, a sharper image drawn in place of the base
|
`detail: {image, rectangle}`, a sharper image drawn in place of the base
|
||||||
one, and says how shells stack, blend and update. `FieldHandle.on('drawn')`
|
one, and says how shells stack, blend and update. `FieldHandle.on('drawn')`
|
||||||
says once per spec or `update` that it is drawn, never while hidden. These
|
says once per spec or `update` that it is drawn, never while hidden. These
|
||||||
change `fields` itself rather than add to it, so a renderer that lists
|
change `fields` itself rather than add to it, so the renderer follows
|
||||||
`fields` follows them. The Cesium adapter lists `fields` and
|
them where it lists `fields`. The Cesium adapter lists `fields` and
|
||||||
draws `rasterShell` and `windStreamlines`. It reads the grid's samples as
|
draws `rasterShell` and `windStreamlines`. It reads the grid's samples as
|
||||||
points, the first column at `rectangle.west` and the first row at
|
points, the first column at `rectangle.west` and the first row at
|
||||||
`rectangle.north`, rows running south. Over the whole globe its paths
|
`rectangle.north`, rows running south. Over the whole globe its paths
|
||||||
@@ -411,7 +411,7 @@ fails when `PORTS` and the types disagree on a single member.
|
|||||||
`vectorBase` (`BaseSpec.vector = { styleUrl }`) draws a MapLibre style
|
`vectorBase` (`BaseSpec.vector = { styleUrl }`) draws a MapLibre style
|
||||||
document's vector tiles as the globe's base. They are painted in shared,
|
document's vector tiles as the globe's base. They are painted in shared,
|
||||||
Cesium-free code, `src/render/vectorBase/`, which the renderer draws as
|
Cesium-free code, `src/render/vectorBase/`, which the renderer draws as
|
||||||
draws imagery draws the same pixels:
|
imagery:
|
||||||
|
|
||||||
- `loadVectorStyle(styleUrl, fetch)` fetches the style and the TileJSON its
|
- `loadVectorStyle(styleUrl, fetch)` fetches the style and the TileJSON its
|
||||||
vector sources name (a source's `url`; inline `tiles` are used as given,
|
vector sources name (a source's `url`; inline `tiles` are used as given,
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ export function createRendering({
|
|||||||
* Kept roads are jam first, then slow, then free, longest first; overflow
|
* Kept roads are jam first, then slow, then free, longest first; overflow
|
||||||
* is logged. The set swaps its whole contents at once, so a rebuild never
|
* is logged. The set swaps its whole contents at once, so a rebuild never
|
||||||
* blinks. No-op in sim mode or when both looks are off. Where the renderer
|
* blinks. No-op in sim mode or when both looks are off. Where the renderer
|
||||||
* cannot drape draws them over the surface instead (the draw port's
|
* cannot drape, it draws them over the surface instead (the draw port's
|
||||||
* `overlay`).
|
* `overlay`).
|
||||||
*
|
*
|
||||||
* One build runs at a time. A city loads in progressive paints, each asking
|
* One build runs at a time. A city loads in progressive paints, each asking
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@
|
|||||||
*
|
*
|
||||||
* The renderer's plugin may hand the application a map engine of its own
|
* The renderer's plugin may hand the application a map engine of its own
|
||||||
* (`mapEngine` in `src/render/applicationHooks.js`); when it hands none, the
|
* (`mapEngine` in `src/render/applicationHooks.js`); when it hands none, the
|
||||||
* hands none switches through its globe port (`globeEngine.js`). A viewer
|
* renderer switches through its globe port (`globeEngine.js`). A viewer
|
||||||
* with no renderer bound uses the engine its adapter
|
* with no renderer bound uses the engine its adapter
|
||||||
* provided as it loaded (the Cesium one through the package's
|
* provided as it loaded (the Cesium one through the package's
|
||||||
* `./render/cesium/unbound` export).
|
* `./render/cesium/unbound` export).
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* @module maps/globeEngine
|
* @module maps/globeEngine
|
||||||
* @description The map engine (`engine.js`) over the renderer contract's
|
* @description The map engine (`engine.js`) over the renderer contract's
|
||||||
* globe port, for a renderer whose plugin hands the application no map
|
* globe port, for when the renderer's plugin hands the application no map
|
||||||
* engine of its own (`src/render/applicationHooks.js`). The map stacks'
|
* engine of its own (`src/render/applicationHooks.js`). The map stacks'
|
||||||
* sources become the port's specs: Esri and OSM as `xyz` imagery, Cesium
|
* sources become the port's specs: Esri and OSM as `xyz` imagery, Cesium
|
||||||
* ion's world imagery as `world` imagery, the photoreal stack as the port's
|
* ion's world imagery as `world` imagery, the photoreal stack as the port's
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ async function overAustin(h, r, height = 2000) {
|
|||||||
/**
|
/**
|
||||||
* Waits until what is drawn has loaded (icon images, tiles, models), as a
|
* 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
|
* query answers from what is loaded. Where the renderer draws synchronously it
|
||||||
* settled at once.
|
* is settled at once.
|
||||||
*/
|
*/
|
||||||
async function settled(r) {
|
async function settled(r) {
|
||||||
const result = await r.whenSettled({ timeoutMs: 20000 });
|
const result = await r.whenSettled({ timeoutMs: 20000 });
|
||||||
|
|||||||
Vendored
+2
-2
@@ -55,7 +55,7 @@ export interface CameraPose {
|
|||||||
/**
|
/**
|
||||||
* Vertical field of view, radians. `fovy` and `aspectRatio` describe a
|
* Vertical field of view, radians. `fovy` and `aspectRatio` describe a
|
||||||
* centred perspective frustum. Where the renderer's frustum is off-centre or
|
* 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
|
* projection only in `matrices()`; code that culls or projects exactly
|
||||||
* reads `matrices()`.
|
* reads `matrices()`.
|
||||||
*/
|
*/
|
||||||
@@ -147,7 +147,7 @@ export interface FollowTarget {
|
|||||||
visualPosition?(t: number): Ecef | null;
|
visualPosition?(t: number): Ecef | null;
|
||||||
/**
|
/**
|
||||||
* The drawn item this target is, when it is one. Where the renderer moves
|
* 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.
|
* eye and the icon never part; `position` stays the answer elsewhere.
|
||||||
*/
|
*/
|
||||||
item?: { set: string; id: string };
|
item?: { set: string; id: string };
|
||||||
|
|||||||
Vendored
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Full-screen effects: visual styles, bloom, sharpen and screen modulation.
|
* 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
|
* 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';
|
import type { Off } from './common';
|
||||||
|
|
||||||
|
|||||||
Vendored
+5
-6
@@ -208,12 +208,11 @@ export interface BaseStatus {
|
|||||||
/**
|
/**
|
||||||
* The sky. These switch parts of it on and off; they do not say how it
|
* 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
|
* 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
|
* lighting and the tone mapping and exposure of the frame look is the
|
||||||
* renderer's own, and no check compares colours with
|
* renderer's own, and no check compares colours. With `atmosphere`, `fog`
|
||||||
* another's. With `atmosphere`, `fog` and `lighting` off and clear weather,
|
* and `lighting` off and clear weather, the renderer applies none of its
|
||||||
* a renderer applies none of its look: what is drawn shows its own colours.
|
* look: what is drawn shows its own colours. Where the renderer's sun, moon
|
||||||
* A renderer whose sun, moon or fog are not separate from its
|
* or fog are not separate from its atmosphere, it follows `atmosphere` for them and reports them as it draws them.
|
||||||
* atmosphere follows `atmosphere` for them and reports them as it draws them.
|
|
||||||
*/
|
*/
|
||||||
export interface SkySettings {
|
export interface SkySettings {
|
||||||
atmosphere: boolean;
|
atmosphere: boolean;
|
||||||
|
|||||||
Vendored
+1
-1
@@ -26,7 +26,7 @@
|
|||||||
*
|
*
|
||||||
* A click is delivered with its pick already made, once, and shared by
|
* A click is delivered with its pick already made, once, and shared by
|
||||||
* every subscriber (`PointerEv.pick`). Where the renderer's picks answer a
|
* 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.
|
* without them; `query.pick` stays synchronous for everything else.
|
||||||
*
|
*
|
||||||
* The engine's stock behaviours (select on click, follow on double-click)
|
* The engine's stock behaviours (select on click, follow on double-click)
|
||||||
|
|||||||
Vendored
+5
-5
@@ -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
|
* 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 {
|
export interface ApplicationHooks {
|
||||||
/**
|
/**
|
||||||
@@ -173,9 +173,9 @@ export interface Renderer {
|
|||||||
releaseUnused(): void;
|
releaseUnused(): void;
|
||||||
on(event: 'error', cb: (error: Error) => void): Off;
|
on(event: 'error', cb: (error: Error) => void): Off;
|
||||||
/**
|
/**
|
||||||
* The drawing context was lost, or came back. A renderer that cannot restore its context
|
* The drawing context was lost, or came back. Where the renderer cannot
|
||||||
* never sends `contextRestored`; the application then makes
|
* restore its context it never sends `contextRestored`; the application
|
||||||
* a new renderer.
|
* then makes a new renderer.
|
||||||
*/
|
*/
|
||||||
on(event: 'contextLost' | 'contextRestored', cb: () => void): Off;
|
on(event: 'contextLost' | 'contextRestored', cb: () => void): Off;
|
||||||
/**
|
/**
|
||||||
|
|||||||
Vendored
+2
-1
@@ -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`).
|
* (`router.js`).
|
||||||
*/
|
*/
|
||||||
import type { InputPort, Lease, PointerEv } from '../contract/index';
|
import type { InputPort, Lease, PointerEv } from '../contract/index';
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* @module render/input/router
|
* @module render/input/router
|
||||||
* @description Who hears each pointer event: the contract's input rules
|
* @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
|
* the events its engine sees, already shaped as `PointerEv` (its clicks with
|
||||||
* their pick); the router decides, from the leases and the presses under
|
* 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
|
* way, which listeners get each one, and keeps the input port's leases and
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* `MotionSegment` and `CourseGlide` in `render/contract/draw.d.ts`). The app
|
* `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
|
* 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
|
* 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).
|
* 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}`
|
* Times are epoch ms on the set's motion clock. Plain numbers and `{x, y, z}`
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* How a set that recedes (`SetSpec.recede`) shrinks and fades its items
|
* How a set that recedes (`SetSpec.recede`) shrinks and fades its items
|
||||||
* toward the globe's limb (`recession.js`), so the renderer draws exactly
|
* toward the globe's limb (`recession.js`), so the renderer draws exactly
|
||||||
* same factors.
|
* those factors.
|
||||||
*/
|
*/
|
||||||
import type { RecedeSpec } from './contract/index';
|
import type { RecedeSpec } from './contract/index';
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @module render/recession
|
* @module render/recession
|
||||||
* @description How a set that recedes (`SetSpec.recede`) shrinks and fades
|
* @description How a set that recedes (`SetSpec.recede`) shrinks and fades
|
||||||
* its items toward the globe's limb, free of Cesium, so the renderer
|
* 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
|
* `startLimbRatio` of the distance from the eye to the limb, and ease
|
||||||
* (smoothstep) to `scaleFloor` and `alphaFloor` at the limb. The whole of it
|
* (smoothstep) to `scaleFloor` and `alphaFloor` at the limb. The whole of it
|
||||||
* eases back to nothing as the eye climbs through the blend band
|
* eases back to nothing as the eye climbs through the blend band
|
||||||
|
|||||||
@@ -2133,7 +2133,7 @@ export function createStubRenderer(options = {}) {
|
|||||||
/**
|
/**
|
||||||
* The stub as a renderer plugin (`RendererPlugin`), for running the whole
|
* The stub as a renderer plugin (`RendererPlugin`), for running the whole
|
||||||
* application on it: each renderer it makes fills the container it is given
|
* 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.
|
* drives the loop (`testing.tick()`), each frame or as a test needs.
|
||||||
* @param {Parameters<typeof createStubRenderer>[0]} [options] For each
|
* @param {Parameters<typeof createStubRenderer>[0]} [options] For each
|
||||||
* renderer it makes (`capabilities`, `viewport`, `time`...).
|
* renderer it makes (`capabilities`, `viewport`, `time`...).
|
||||||
|
|||||||
Reference in new issue
Block a user