Drive the visual styles, bloom and sharpen through the effects port

VisualEffects defines each preset on the renderer and keeps its own
records of intensities and parameters, written through to the port, so
crossfades, the anime sky fade, bloom and sharpen behave as before. The
renderer animates the animated styles. Sensor picks read the style
records instead of the renderer's stages. The application renderer now
has the effects port and its capabilities.
This commit is contained in:
Sameh Khamis committed 2026-11-06 16:32:49 -08:00
1 parent bbda6dd0a1
commit 6a7905fc49
18 files changed
+375 -186

No files matched your search

+2 -4
View File
@@ -8,6 +8,7 @@ import {
fakeInput,
} from './testDoubles.mjs';
import { sensorPickPosition } from './sensorPick.js';
import { registerStyleStages } from '../styles/styleStages.js';
import { claimPointer, releasePointer } from '../data/inputOwnership.js';
import {
registerPickOwner,
@@ -376,11 +377,8 @@ test('sensor styles move the pick to where the picture came from', () => {
const stage = { enabled: true, uniforms: { intensity: 1, pixelation: 4 } };
const scene = {
canvas: { clientWidth: 400, clientHeight: 200, width: 400, height: 200 },
postProcessStages: {
getStageByName: (name) =>
name === 'godsEyeView_surveillance' ? stage : undefined,
},
};
registerStyleStages(scene, { surveillance: stage });
const click = { x: 300, y: 50 };
const mapped = sensorPickPosition(scene, click);
assert.notDeepEqual([mapped.x, mapped.y], [300, 50]);
+4 -3
View File
@@ -7,6 +7,7 @@
* distortion and quantization first.
*/
import * as Cesium from 'cesium';
import { styleStagesOf } from '../styles/styleStages.js';
const SENSOR_STYLES = ['thermal', 'surveillance'];
@@ -18,10 +19,10 @@ const SENSOR_STYLES = ['thermal', 'surveillance'];
*/
export function sensorPickPosition(scene, position) {
const out = new Cesium.Cartesian2(position.x, position.y);
const stages = scene.postProcessStages;
if (typeof stages?.getStageByName !== 'function') return out;
const stages = styleStagesOf(scene);
if (!stages) return out;
for (const style of SENSOR_STYLES) {
const stage = stages.getStageByName(`godsEyeView_${style}`);
const stage = stages[style];
if (!stage?.enabled) continue;
const intensity = stage.uniforms.intensity;
const canvas = scene.canvas,