From 95f222c6f0f18dfeffe5705fff4cc2d350891464 Mon Sep 17 00:00:00 2001 From: Kangning Li Date: Thu, 26 May 2016 13:50:18 -0400 Subject: [PATCH] Fixed bug where the atmosphere would disappear if no tiles were being rendered. --- CHANGES.md | 1 + Source/Scene/Scene.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index c43e601eefdc..201289fd5387 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -23,6 +23,7 @@ Change Log * Added `debugShowShadowVolume` to `GroundPrimitive`. * Fixed issue where `Matrix4.fromCamera` was taking eye/target instead of position/direction. [#3927](https://github.com/AnalyticalGraphicsInc/cesium/issues/3927) * Fixed a bug that would cause a crash is the camera was on the IDL in 2D. [#3951](https://github.com/AnalyticalGraphicsInc/cesium/issues/3951) +* Fixed a bug that was causing the atmosphere to disappear when only atmosphere is visible. [#3347](https://github.com/AnalyticalGraphicsInc/cesium/issues/3347) ### 1.21 - 2016-05-02 diff --git a/Source/Scene/Scene.js b/Source/Scene/Scene.js index 3f318fdd60dc..d28443ed204b 100644 --- a/Source/Scene/Scene.js +++ b/Source/Scene/Scene.js @@ -562,6 +562,7 @@ define([ isSunVisible : false, isMoonVisible : false, + isReadyForAtmosphere : false, isSkyAtmosphereVisible : false, clearGlobeDepth : false, @@ -1221,7 +1222,7 @@ define([ // Determine visibility of celestial and terrestrial environment effects. var environmentState = scene._environmentState; - environmentState.isSkyAtmosphereVisible = defined(environmentState.skyAtmosphereCommand) && defined(scene.globe) && scene.globe._surface._tilesToRender.length > 0; + environmentState.isSkyAtmosphereVisible = defined(environmentState.skyAtmosphereCommand) && environmentState.isReadyForAtmosphere; environmentState.isSunVisible = isVisible(environmentState.sunDrawCommand, cullingVolume, occluder); environmentState.isMoonVisible = isVisible(environmentState.moonCommand, cullingVolume, occluder); @@ -1876,6 +1877,7 @@ define([ var environmentState = scene._environmentState; var renderPass = frameState.passes.render; environmentState.skyBoxCommand = (renderPass && defined(scene.skyBox)) ? scene.skyBox.update(frameState) : undefined; + environmentState.isReadyForAtmosphere = defined(scene.skyAtmosphere) && (environmentState.isReadyForAtmosphere || (defined(scene.globe) && scene.globe._surface._tilesToRender.length > 0)); environmentState.skyAtmosphereCommand = (renderPass && defined(scene.skyAtmosphere)) ? scene.skyAtmosphere.update(frameState) : undefined; var sunCommands = (renderPass && defined(scene.sun)) ? scene.sun.update(scene) : undefined; environmentState.sunDrawCommand = defined(sunCommands) ? sunCommands.drawCommand : undefined;