Run styles, bloom and sharpen through a Cesium effects port

The effects port puts each style the app defines on its own post-process
stage, takes the scene's bloom stage and adds a sharpen stage, with the
mappings the application uses today. An animated style holds frames and
advances its time uniform while it draws. A replaced style keeps drawing
until its intensity is 0, so the app can crossfade; the contract, the stub
and a new conformance check say so. The conformance renderer has the
port; the application renderer does not yet.
This commit is contained in:
Sameh Khamis committed 2026-11-06 16:32:39 -08:00
1 parent 765a0db094
commit bbda6dd0a1
11 files changed
+814 -9

No files matched your search

+16 -1
View File
@@ -968,6 +968,11 @@ export function createStubRenderer(options = {}) {
modulation: null,
};
const effectListeners = [];
/** The styles a setStyle replaced, drawing until their intensity is 0. */
const fading = new Set();
const styleIntensity = (id) => effectState.intensity[id] ?? 1;
const styleDraws = (id) =>
(id === effectState.style || fading.has(id)) && styleIntensity(id) > 0;
/** Styles the app defined, by id. */
const defined = new Map();
const STYLES = Object.freeze([
@@ -1015,17 +1020,24 @@ export function createStubRenderer(options = {}) {
removed = true;
if (defined.get(entry.id) !== entry) return;
defined.delete(entry.id);
fading.delete(entry.id);
if (effectState.style === entry.id) effectState.style = null;
effectsChanged();
};
},
setStyle(id, params) {
if (id !== effectState.style) {
if (effectState.style !== null && styleIntensity(effectState.style) > 0)
fading.add(effectState.style);
fading.delete(id);
}
effectState.style = id;
if (params) effectState.params[id] = { ...params };
effectsChanged();
},
setStyleIntensity(id, value) {
effectState.intensity[id] = value;
if (!(value > 0)) fading.delete(id);
effectsChanged();
},
setStyleParams(id, params) {
@@ -1045,7 +1057,10 @@ export function createStubRenderer(options = {}) {
diagnostics: () => ({
style: effectState.style,
passes: [
...(effectState.style ? [`style:${effectState.style}`] : []),
...effects
.styles()
.filter((s) => styleDraws(s.id))
.map((s) => `style:${s.id}`),
...(effectState.bloom?.enabled ? ['bloom'] : []),
...(effectState.sharpen?.enabled ? ['sharpen'] : []),
...(effectState.modulation ? ['modulation'] : []),