Skip to content

Commit

Permalink
Only render atmosphere when terrain tiles are rendered.
Browse files Browse the repository at this point in the history
  • Loading branch information
bagnell committed Nov 9, 2015
1 parent 28d15df commit 4cccade
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/Scene/Scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -1406,6 +1406,7 @@ define([
// Manage celestial and terrestrial environment effects.
var renderPass = frameState.passes.render;
var skyBoxCommand = (renderPass && defined(scene.skyBox)) ? scene.skyBox.update(frameState) : undefined;
var skyAtmosphereVisible = defined(scene.globe) && scene.globe._surface._tilesToRender.length > 0;
var skyAtmosphereCommand = (renderPass && defined(scene.skyAtmosphere)) ? scene.skyAtmosphere.update(frameState) : undefined;
var sunCommands = (renderPass && defined(scene.sun)) ? scene.sun.update(scene) : undefined;
var sunDrawCommand = defined(sunCommands) ? sunCommands.drawCommand : undefined;
Expand Down Expand Up @@ -1496,7 +1497,7 @@ define([
executeCommand(skyBoxCommand, scene, context, passState);
}

if (defined(skyAtmosphereCommand)) {
if (defined(skyAtmosphereCommand) && skyAtmosphereVisible) {
executeCommand(skyAtmosphereCommand, scene, context, passState);
}

Expand Down

0 comments on commit 4cccade

Please sign in to comment.