Skip to content

Commit

Permalink
More concise handling of finalResolution
Browse files Browse the repository at this point in the history
  • Loading branch information
lilleyse committed Jul 28, 2018
1 parent 8d85e60 commit 4fc6f7e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
3 changes: 1 addition & 2 deletions Source/Scene/Batched3DModel3DTileContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,7 @@ define([
// If any commands were pushed, add derived commands
var commandEnd = frameState.commandList.length;
if ((commandStart < commandEnd) && (frameState.passes.render || frameState.passes.pick) && !defined(tileset.classificationType)) {
var finalResolution = this._tile._finalResolution;
this._batchTable.addDerivedCommands(frameState, commandStart, finalResolution);
this._batchTable.addDerivedCommands(frameState, commandStart);
}
};

Expand Down
3 changes: 2 additions & 1 deletion Source/Scene/Cesium3DTileBatchTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -1210,10 +1210,11 @@ define([
OPAQUE_AND_TRANSLUCENT : 2
};

Cesium3DTileBatchTable.prototype.addDerivedCommands = function(frameState, commandStart, finalResolution) {
Cesium3DTileBatchTable.prototype.addDerivedCommands = function(frameState, commandStart) {
var commandList = frameState.commandList;
var commandEnd = commandList.length;
var tile = this._content._tile;
var finalResolution = tile._finalResolution;
var tileset = tile._tileset;
var bivariateVisibilityTest = tileset._skipLevelOfDetail && tileset._hasMixedContent && frameState.context.stencilBuffer;
var styleCommandsNeeded = getStyleCommandsNeeded(this);
Expand Down
11 changes: 3 additions & 8 deletions Source/Scene/Cesium3DTilesetTraversal.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ define([
}

function addEmptyTile(tileset, tile) {
tile._finalResolution = true;
tileset._emptyTiles.push(tile);
}

Expand Down Expand Up @@ -162,7 +161,6 @@ define([
updateTile(tileset, child, frameState);
touchTile(tileset, child, frameState);
selectTile(tileset, child, frameState);
tile._finalResolution = true;
} else if (child._depth - root._depth < descendantSelectionDepth) {
// Continue traversing, but not too far
stack.push(child);
Expand All @@ -176,7 +174,6 @@ define([
if (tile.contentAvailable) {
// The tile can be selected right away and does not require traverseAndSelect
selectTile(tileset, tile, frameState);
tile._finalResolution = true;
}
return;
}
Expand Down Expand Up @@ -332,7 +329,7 @@ define([
tile.updateExpiration();

tile._shouldSelect = false;
tile._finalResolution = false;
tile._finalResolution = true;
tile._ancestorWithContent = undefined;
tile._ancestorWithContentAvailable = undefined;

Expand Down Expand Up @@ -586,8 +583,8 @@ define([
var waitingTile = ancestorStack.peek();
if (waitingTile._stackLength === stack.length) {
ancestorStack.pop();
if (waitingTile === lastAncestor) {
waitingTile._finalResolution = true;
if (waitingTile !== lastAncestor) {
waitingTile._finalResolution = false;
}
selectTile(tileset, waitingTile, frameState);
continue;
Expand All @@ -609,7 +606,6 @@ define([
if (shouldSelect) {
if (add) {
selectTile(tileset, tile, frameState);
tile._finalResolution = true;
} else {
tile._selectionDepth = ancestorStack.length;
if (tile._selectionDepth > 0) {
Expand All @@ -618,7 +614,6 @@ define([
lastAncestor = tile;
if (!traverse) {
selectTile(tileset, tile, frameState);
tile._finalResolution = true;
continue;
}
ancestorStack.push(tile);
Expand Down

0 comments on commit 4fc6f7e

Please sign in to comment.