fix(ui): the Cesium engine's render.sharpen() mirrors the sharpen stage

VisualEffects sends its sharpen state to engine.render.setSharpen when a
viewer exists too; the Cesium engine keeps it as state, and the Cesium
stage itself is unchanged.
This commit is contained in:
German Khokhlov committed 2026-10-16 14:34:17 +04:00
1 parent d50eaa28af
commit 26968f4903
2 files changed
+27 -9

No files matched your search

+5 -5
View File
@@ -32,12 +32,11 @@ export class VisualEffects {
createStage = (options) => new PostProcessStage(options),
}) {
this.viewer = viewer;
// Cesium sharpens with its own post stage below; an engine without a
// viewer (Navara) sharpens in its render pipeline.
// Cesium sharpens with its own post stage below, and the engine's
// render.sharpen() mirrors that stage (the Cesium engine keeps the state
// only); an engine without a viewer (Navara) sharpens in its pipeline.
this.engineRender =
!viewer && typeof engine?.render?.setSharpen === 'function'
? engine.render
: null;
typeof engine?.render?.setSharpen === 'function' ? engine.render : null;
this.requestRender = requestRender;
this.holdRender = holdRender;
this.releaseRender = releaseRender;
@@ -118,6 +117,7 @@ export class VisualEffects {
});
this.sharpenStage.enabled = false;
this.viewer.scene.postProcessStages.add(this.sharpenStage);
this.engineRender?.setSharpen({ enabled: false });
this.applySharpenIntensity(sharpenIntensity);
}