mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
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:
1 parent
765a0db094
commit
bbda6dd0a1
11 files changed
+814
-9
No files matched your search
@@ -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'] : []),
|
||||
|
||||
Reference in new issue
Block a user