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 }), [