Skip to content

Commit 85fd29c

Browse files
authored
Merge pull request #5254 from austinEng/improved-tile-loading
Refactor Tileset Traversal
2 parents 37e4690 + b653d6c commit 85fd29c

5 files changed

+972
-634
lines changed

Source/Scene/Cesium3DTile.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -330,16 +330,20 @@ define([
330330
*/
331331
this._optimChildrenWithinParent = Cesium3DTileOptimizationHint.NOT_COMPUTED;
332332

333-
this._sse = 0;
333+
this._screenSpaceError = 0;
334+
this._screenSpaceErrorComputedFrame = -1;
334335
this._finalResolution = true;
335336
this._requestHeap = undefined;
336337
this._depth = 0;
337338
this._centerZDepth = 0;
338339
this._stackLength = 0;
339340
this._selectedFrame = -1;
340341
this._selectionDepth = 0;
341-
this._lastFinalResolution = undefined;
342342
this._lastSelectionDepth = undefined;
343+
this._requestedFrame = undefined;
344+
this._lastVisitedFrame = undefined;
345+
this._ancestorWithContent = undefined;
346+
this._ancestorWithLoadedContent = undefined;
343347
}
344348

345349
defineProperties(Cesium3DTile.prototype, {

Source/Scene/Cesium3DTileBatchTable.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -1261,13 +1261,13 @@ define([
12611261
derivedCommands.front = deriveTranslucentCommand(command, CullFace.BACK);
12621262
}
12631263

1264-
var bivariateVisibilityTest = tileset._hasMixedContent && this.context.stencilBuffer;
1264+
var bivariateVisibilityTest = tileset.skipLODs && tileset._hasMixedContent && this.context.stencilBuffer;
12651265

12661266
if (bivariateVisibilityTest) {
1267-
if (!tile._finalResolution) {
1268-
if (!defined(derivedCommands.zback)) {
1269-
derivedCommands.zback = deriveZBackfaceCommand(command);
1270-
}
1267+
if (!defined(derivedCommands.zback)) {
1268+
derivedCommands.zback = deriveZBackfaceCommand(command);
1269+
}
1270+
if (command.pass !== Pass.TRANSLUCENT) {
12711271
tileset._backfaceCommands.push(derivedCommands.zback);
12721272
}
12731273

@@ -1340,13 +1340,16 @@ define([
13401340

13411341
function deriveCommand(command) {
13421342
var derivedCommand = DrawCommand.shallowClone(command);
1343-
derivedCommand.pass = Pass.CESIUM_3D_TILE;
13441343

13451344
// Add a uniform to indicate if the original command was translucent so
13461345
// the shader knows not to cull vertices that were originally transparent
13471346
// even though their style is opaque.
13481347
var translucentCommand = (derivedCommand.pass === Pass.TRANSLUCENT);
13491348

1349+
if (!translucentCommand) {
1350+
derivedCommand.pass = Pass.CESIUM_3D_TILE;
1351+
}
1352+
13501353
derivedCommand.uniformMap = defined(derivedCommand.uniformMap) ? derivedCommand.uniformMap : {};
13511354
derivedCommand.uniformMap.tile_translucentCommand = function() {
13521355
return translucentCommand;

0 commit comments

Comments
 (0)