diff --git a/CHANGES.md b/CHANGES.md index d52d64586b7d..1b7f6ed88d7c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -25,6 +25,7 @@ Change Log * 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) * Added `Scene.nearToFarDistance2D` that determines the size of each frustum of the multifrustum in 2D. * Added support for rendering models in 2D and Columbus view. +* 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 3d17c94d5a39..bd886f931fd9 100644 --- a/Source/Scene/Scene.js +++ b/Source/Scene/Scene.js @@ -571,6 +571,7 @@ define([ isSunVisible : false, isMoonVisible : false, + isReadyForAtmosphere : false, isSkyAtmosphereVisible : false, clearGlobeDepth : false, @@ -1238,7 +1239,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); @@ -1919,6 +1920,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;