Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vanishing atmosphere when looking up #3347 #3965

Merged
merged 2 commits into from
May 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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