feat(render): a renderer can draw weather: the weather capability adds globe.weather (clouds, fog, haze, rain and snow, 0 to 1, and the wind they drift on); the view shows the conditions observed under the camera, and the Display panel's Weather group sets them by hand

This commit is contained in:
Sameh Khamis committed 2026-11-13 11:02:56 -08:00
1 parent 639e92b4f7
commit 0b1dc325bc
29 files changed
+869 -27

No files matched your search

+17 -3
View File
@@ -2,6 +2,10 @@ import { catalogControlServices } from './catalog.js';
import { StyleManager } from '../ui/composition.js';
import { applyStartView, START_VIEW } from '../camera.js';
import { initCockpitCloudEffects } from '../cockpitCloudEffects.js';
import { createViewWeather } from '../viewWeather.js';
import { findGlobe } from '../render/rendererOf.js';
import { useDisplayStore } from '../ui/stores/display.js';
import { applicationPinia } from '../ui/vueRuntime.js';
import { t } from '../i18n/index.js';
/**
@@ -52,10 +56,20 @@ export function createApplicationControls({
// clouds use a separate, capped low-resolution GPU pass that never attaches
// Cesium fog or post-process stages and is fully stopped in map mode.
const weatherEffects = null;
const cockpitCloudEffects = initCockpitCloudEffects(viewer, {
weatherService: operations.requests.weather,
});
// Where the renderer draws weather, it draws the cockpit's clouds too.
const cockpitCloudEffects = findGlobe(viewer)?.weather
? null
: initCockpitCloudEffects(viewer, {
weatherService: operations.requests.weather,
});
defer(() => cockpitCloudEffects?.destroy());
// Clouds, fog, rain and snow on a renderer that draws them: the conditions
// under the camera, or what the user sets in the Display panel.
const viewWeather = createViewWeather(viewer, {
weatherService: operations.requests.weather,
store: useDisplayStore(applicationPinia()),
});
defer(() => viewWeather.destroy());
loaderStatus.textContent = styleManager.hasShareState
? t('Restoring shared view...')