Skip to content

Commit

Permalink
Merge pull request #3965 from likangning93/vanishingAtmosphere
Browse files Browse the repository at this point in the history
Vanishing atmosphere when looking up #3347
  • Loading branch information
lilleyse committed May 26, 2016
2 parents d8244f1 + 78993a3 commit 6ca381f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion Source/Scene/Scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ define([

isSunVisible : false,
isMoonVisible : false,
isReadyForAtmosphere : false,
isSkyAtmosphereVisible : false,

clearGlobeDepth : false,
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 6ca381f

Please sign in to comment.