mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 09:42:21 +00:00
The renderer seam: clicks go to the newest tool, recession and display groups through the contract, drawing at parity with Cesium
- Clicks: when two tools want the globe's clicks, the newest takes them and the older is told and turns itself off; a click is decided when it arrives, and ambient selection fires only when no tool holds the pointer. The "map is busy" paths and their strings are removed. - Recession: the limb fade is shared (src/render/recession.js) and reaches icon and model sets through SetSpec.recede; tuning applies on the next frame. - Display panel groups are published through src/ui/displayGroups.js; the Weather group and src/viewWeather.js are removed. - Draw port: a set whose icons only move is moved in place, and models that did not change are not restyled each frame, so moving fleets cost what they did when drawn directly; an untinted, fully opaque model is drawn without a colour. - Conformance: input.lease.lost checks the new lease inside onLost and reports a throwing onLost; draw.sets.recede covers model sets. - QA scripts read the renderer host instead of internals the seam replaced.
This commit is contained in:
1 parent
a0d299523d
commit
0ab31d4fb8
130 files changed
+5438
-1674
No files matched your search
@@ -54,11 +54,13 @@ if (typeof window !== 'undefined' && !window.__CESIUM__)
|
||||
/**
|
||||
* Cesium.Viewer options of the standard globe viewer. `showRenderLoopErrors`
|
||||
* false leaves render errors to the caller's own notice instead of Cesium's
|
||||
* panel.
|
||||
* panel; `msaa` is the multisampling to start with (0 off, 4 by default).
|
||||
* The drawing buffer is kept after presenting, for `capture` and
|
||||
* `readPixels` to read the frame drawn.
|
||||
*/
|
||||
export function applicationViewerOptions(
|
||||
creditContainer,
|
||||
{ showRenderLoopErrors = true } = {},
|
||||
{ showRenderLoopErrors = true, msaa = 4 } = {},
|
||||
) {
|
||||
return {
|
||||
timeline: false,
|
||||
@@ -77,23 +79,31 @@ export function applicationViewerOptions(
|
||||
// which would also stop CesiumWidget from creating the Sun and Moon.
|
||||
skyBox: new StarrySky(),
|
||||
creditContainer,
|
||||
msaaSamples: 4,
|
||||
// Cesium's 1 is no multisampling.
|
||||
msaaSamples: msaa || 1,
|
||||
contextOptions: { webgl: { preserveDrawingBuffer: true } },
|
||||
showRenderLoopErrors,
|
||||
};
|
||||
}
|
||||
|
||||
/** Create the standard globe viewer in caller-owned, visible containers. */
|
||||
/**
|
||||
* Create the standard globe viewer in caller-owned, visible containers;
|
||||
* `msaa` as `applicationViewerOptions` takes it.
|
||||
*/
|
||||
export function createApplicationViewer({
|
||||
container,
|
||||
creditContainer,
|
||||
showRenderLoopErrors,
|
||||
msaa,
|
||||
}) {
|
||||
if (!container || !creditContainer)
|
||||
throw new TypeError('Viewer and credit containers are required');
|
||||
const viewer = new Cesium.Viewer(
|
||||
container,
|
||||
applicationViewerOptions(creditContainer, { showRenderLoopErrors }),
|
||||
applicationViewerOptions(creditContainer, {
|
||||
showRenderLoopErrors,
|
||||
msaa,
|
||||
}),
|
||||
);
|
||||
try {
|
||||
// Until the frame port takes over (appRenderer.js), tick at the idle
|
||||
|
||||
Reference in new issue
Block a user