From 8122199887d4b3e387140aaf22efb9b0f49471ae Mon Sep 17 00:00:00 2001 From: Sameh Khamis Date: Wed, 11 Nov 2026 15:56:50 -0800 Subject: [PATCH] The Cesium renderer lists modelAtmosphere Cesium's models already take the atmosphere's scattering, in the stage that draws distance fog; the capability now says so, and the contract doc says it follows the sky's fog setting there. --- docs/RENDERER-CONTRACT.md | 4 ++++ src/render/cesium/ports.js | 3 +++ src/render/cesium/ports.test.mjs | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/RENDERER-CONTRACT.md b/docs/RENDERER-CONTRACT.md index 11820fa7f..23dcb4c95 100644 --- a/docs/RENDERER-CONTRACT.md +++ b/docs/RENDERER-CONTRACT.md @@ -126,6 +126,10 @@ optional, so a renderer written before it still conforms: [The application and its renderer](#the-application-and-its-renderer). - `frame.renderNow()` throws when the frame fails to draw. +The Cesium port lists `modelAtmosphere`: Cesium scatters drawn models +through the atmosphere in the same stage as its distance fog, so models take +it while `globe.sky`'s `fog` is on. + The Cesium port lists `followAutodetect`: an `autodetect` follow is Cesium's own AUTODETECT tracking frame, east-north-up on a still or slow target and an orbit frame (x along the inertial motion, z up) on a fast diff --git a/src/render/cesium/ports.js b/src/render/cesium/ports.js index 7f1bbfaa9..69a244e18 100644 --- a/src/render/cesium/ports.js +++ b/src/render/cesium/ports.js @@ -64,6 +64,9 @@ const GLOBE_CAPABILITIES = [ export function cesiumCapabilities(scene, only) { const all = [ 'models', + // Cesium scatters drawn models through the atmosphere wherever the + // scene draws fog (its models' atmosphere stage). + 'modelAtmosphere', 'quads', 'meshes', // Raster shells; other field kinds are refused. diff --git a/src/render/cesium/ports.test.mjs b/src/render/cesium/ports.test.mjs index 17dc108bf..55ce0cfc7 100644 --- a/src/render/cesium/ports.test.mjs +++ b/src/render/cesium/ports.test.mjs @@ -30,7 +30,7 @@ test('capabilities follow what the scene supports', () => { 'surfaceShading', ]; const globe = { show: true }; - const draw = ['models', 'quads', 'meshes', 'fields']; + const draw = ['models', 'modelAtmosphere', 'quads', 'meshes', 'fields']; assert.deepEqual(cesiumCapabilities({}), [...draw, ...effects]); // A scene with a globe reads its visibility back. assert.deepEqual(cesiumCapabilities({ globe }), [