Register the Navara style, bloom and cloud cover modules in the package boundaries and keep VisualEffects free of the globe contract

This commit is contained in:
German Khokhlov committed 2026-11-03 21:49:50 +04:00
1 parent 89339cdd96
commit c2d7a6dbb0
2 files changed
+20 -5

No files matched your search

+5 -1
View File
@@ -3595,7 +3595,11 @@
"src/globe/navara/look.js",
"src/globe/navara/maps.js",
"src/globe/navara/sharpen.js",
"src/annotations/drawInputNavara.js",
"src/globe/navara/stylePass.js",
"src/globe/navara/stylePasses.js",
"src/globe/navara/bloom.js",
"src/globe/navara/bloomSettings.js",
"src/globe/navara/cockpitClouds.js",
"src/globe/navara/surface.js",
"src/globe/navara/viewOptions.js",
"src/app/engineChoice.js",
+15 -4
View File
@@ -1,5 +1,4 @@
import { PostProcessStage } from 'cesium';
import { engineCapabilities } from '../globe/contract.js';
import {
bloomStrengthFromIntensity,
clampBloomIntensity,
@@ -77,11 +76,23 @@ export class VisualEffects {
typeof engine?.render?.setSharpen === 'function' ? engine.render : null;
// Without a viewer, an engine that draws the styles itself
// (render.setStyle) gets them through stand-in stages (initStyles).
const capabilities = engineCapabilities(engine);
// (The visualStyles and bloom capabilities of src/globe/contract.js
// engineCapabilities, read by member: this package stays engine-free.)
const render = engine?.render;
this.engineStyles =
!viewer && capabilities.visualStyles ? engine.render : null;
!viewer &&
Array.isArray(render?.visualStyles) &&
typeof render.setStyle === 'function' &&
typeof render.style === 'function'
? render
: null;
// Likewise the bloom (render.setBloom) for Cesium's bloom stage.
this.engineBloom = !viewer && capabilities.bloom ? engine.render : null;
this.engineBloom =
!viewer &&
typeof render?.setBloom === 'function' &&
typeof render.bloom === 'function'
? render
: null;
this.requestRender = requestRender;
this.holdRender = holdRender;
this.releaseRender = releaseRender;