From 27972ffe773c27f0944beffc16d829d1c1d77bcf Mon Sep 17 00:00:00 2001
From: Dan Bagnell
Date: Thu, 30 Nov 2017 19:14:55 -0500
Subject: [PATCH 01/51] Add option to make a b3dm tileset classify another
tileset.
---
.../gallery/3D Tiles Adjust Height.html | 17 ++
Source/Renderer/Pass.js | 9 +-
Source/Scene/Batched3DModel3DTileContent.js | 1 +
Source/Scene/Cesium3DTileset.js | 2 +-
Source/Scene/ClassificationType.js | 1 +
Source/Scene/Model.js | 263 ++++++++++++++++--
.../Shaders/Builtin/Constants/passOpaque.glsl | 2 +-
.../Builtin/Constants/passOverlay.glsl | 2 +-
.../Builtin/Constants/passTranslucent.glsl | 2 +-
9 files changed, 269 insertions(+), 30 deletions(-)
diff --git a/Apps/Sandcastle/gallery/3D Tiles Adjust Height.html b/Apps/Sandcastle/gallery/3D Tiles Adjust Height.html
index 09813d39da55..4e7402e2a991 100644
--- a/Apps/Sandcastle/gallery/3D Tiles Adjust Height.html
+++ b/Apps/Sandcastle/gallery/3D Tiles Adjust Height.html
@@ -68,6 +68,21 @@
throw(error);
});
+var classification = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
+ url : '../../../Specs/Data/Cesium3DTiles/Tilesets/Tileset',
+ classificationType : Cesium.ClassificationType.CESIUM_3D_TILE,
+ modelMatrix : Cesium.Matrix4.fromUniformScale(1.2),
+ skipLevelOfDetail : false
+}));
+
+classification.readyPromise.then(function() {
+ classification.style = new Cesium.Cesium3DTileStyle({
+ color : 'rgba(255, 255, 0, 0.5)'
+ });
+}).otherwise(function(error) {
+ throw(error);
+});
+
Cesium.knockout.getObservable(viewModel, 'height').subscribe(function(height) {
height = Number(height);
if (isNaN(height)) {
@@ -79,6 +94,8 @@
var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, height);
var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3());
tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
+
+ classification.modelMatrix = Cesium.Matrix4.multiply(Cesium.Matrix4.fromTranslation(translation), Cesium.Matrix4.fromUniformScale(1.1), new Cesium.Matrix4());
});
//Sandcastle_End
Sandcastle.finishedLoading();
diff --git a/Source/Renderer/Pass.js b/Source/Renderer/Pass.js
index f623fab44eec..3ab04a936286 100644
--- a/Source/Renderer/Pass.js
+++ b/Source/Renderer/Pass.js
@@ -24,10 +24,11 @@ define([
CESIUM_3D_TILE : 4,
CESIUM_3D_TILE_CLASSIFICATION : 5,
CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW : 6,
- OPAQUE : 7,
- TRANSLUCENT : 8,
- OVERLAY : 9,
- NUMBER_OF_PASSES : 10
+ CLASSIFICATION : 7,
+ OPAQUE : 8,
+ TRANSLUCENT : 9,
+ OVERLAY : 10,
+ NUMBER_OF_PASSES : 11
};
return freezeObject(Pass);
diff --git a/Source/Scene/Batched3DModel3DTileContent.js b/Source/Scene/Batched3DModel3DTileContent.js
index 72f65d8252ac..210601ffb8d1 100644
--- a/Source/Scene/Batched3DModel3DTileContent.js
+++ b/Source/Scene/Batched3DModel3DTileContent.js
@@ -444,6 +444,7 @@ define([
this._model.modelMatrix = this._tile.computedTransform;
this._model.shadows = this._tileset.shadows;
this._model.debugWireframe = this._tileset.debugWireframe;
+ this._model.classificationType = this._tileset.classificationType;
this._model.update(frameState);
// If any commands were pushed, add derived commands
diff --git a/Source/Scene/Cesium3DTileset.js b/Source/Scene/Cesium3DTileset.js
index 6f821bf07b99..2cdacedba107 100644
--- a/Source/Scene/Cesium3DTileset.js
+++ b/Source/Scene/Cesium3DTileset.js
@@ -528,7 +528,7 @@ define([
*
* @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
*/
- this.classificationType = defaultValue(options.classificationType, ClassificationType.CESIUM_3D_TILE);
+ this.classificationType = defaultValue(options.classificationType, ClassificationType.NONE);
/**
* This property is for debugging only; it is not optimized for production use.
diff --git a/Source/Scene/ClassificationType.js b/Source/Scene/ClassificationType.js
index b8b9e7eced1b..987d83a5910d 100644
--- a/Source/Scene/ClassificationType.js
+++ b/Source/Scene/ClassificationType.js
@@ -10,6 +10,7 @@ define([
* @exports ClassificationOption
*/
var ClassificationType = {
+ NONE : -1,
/**
* Only terrain will be classified.
*
diff --git a/Source/Scene/Model.js b/Source/Scene/Model.js
index c7cca1194ef6..af37804d2e5c 100644
--- a/Source/Scene/Model.js
+++ b/Source/Scene/Model.js
@@ -63,7 +63,9 @@ define([
'./AttributeType',
'./Axis',
'./BlendingState',
+ './ClassificationType',
'./ColorBlendMode',
+ './DepthFunction',
'./getAttributeOrUniformBySemantic',
'./HeightReference',
'./JobType',
@@ -73,7 +75,9 @@ define([
'./ModelMesh',
'./ModelNode',
'./SceneMode',
- './ShadowMode'
+ './ShadowMode',
+ './StencilFunction',
+ './StencilOperation'
], function(
BoundingSphere,
Cartesian2,
@@ -139,7 +143,9 @@ define([
AttributeType,
Axis,
BlendingState,
+ ClassificationType,
ColorBlendMode,
+ DepthFunction,
getAttributeOrUniformBySemantic,
HeightReference,
JobType,
@@ -149,7 +155,9 @@ define([
ModelMesh,
ModelNode,
SceneMode,
- ShadowMode) {
+ ShadowMode,
+ StencilFunction,
+ StencilOperation) {
'use strict';
// Bail out if the browser doesn't support typed arrays, to prevent the setup function
@@ -427,6 +435,9 @@ define([
*/
this.silhouetteSize = defaultValue(options.silhouetteSize, 0.0);
+ this.classificationType = defaultValue(options.classificationType, ClassificationType.NONE);
+ this._classificationType = undefined;
+
/**
* The 4x4 transformation matrix that transforms the model from model to world coordinates.
* When this is the identity matrix, the model is drawn in world coordinates, i.e., Earth's WGS84 coordinates.
@@ -3512,7 +3523,14 @@ define([
silhouetteColorCommand2D : undefined,
// Generated on demand when color alpha is less than 1.0
translucentCommand : undefined,
- translucentCommand2D : undefined
+ translucentCommand2D : undefined,
+ // Generated on demand when the model is set as a classifier
+ classificationPreloadCommand : undefined,
+ classificationStencilCommand : undefined,
+ classificationColorCommand : undefined,
+ classificationPreloadCommand2D : undefined,
+ classificationStencilCommand2D : undefined,
+ classificationColorCommand2D : undefined
};
runtimeNode.commands.push(nodeCommand);
nodeCommands.push(nodeCommand);
@@ -4040,6 +4058,10 @@ define([
return silhouetteSupported(frameState.context) && (model.silhouetteSize > 0.0) && (model.silhouetteColor.alpha > 0.0) && defined(model._normalAttributeName);
}
+ function isClassification(model, frameState) {
+ return frameState.context.stencilBuffer && model.classificationType !== ClassificationType.NONE;
+ }
+
function hasTranslucentCommands(model) {
var nodeCommands = model._nodeCommands;
var length = nodeCommands.length;
@@ -4211,6 +4233,181 @@ define([
}
}
+ var stencilMask = 0x0F;
+ var stencilReference = 0;
+
+ var classificationPreloadRS = {
+ colorMask : {
+ red : false,
+ green : false,
+ blue : false,
+ alpha : false
+ },
+ stencilTest : {
+ enabled : true,
+ frontFunction : StencilFunction.ALWAYS,
+ frontOperation : {
+ fail : StencilOperation.KEEP,
+ zFail : StencilOperation.DECREMENT_WRAP,
+ zPass : StencilOperation.DECREMENT_WRAP
+ },
+ backFunction : StencilFunction.ALWAYS,
+ backOperation : {
+ fail : StencilOperation.KEEP,
+ zFail : StencilOperation.INCREMENT_WRAP,
+ zPass : StencilOperation.INCREMENT_WRAP
+ },
+ reference : stencilReference,
+ mask : stencilMask
+ },
+ depthTest : {
+ enabled : false
+ },
+ depthMask : false
+ };
+
+ var classificationStencilRS = {
+ colorMask : {
+ red : false,
+ green : false,
+ blue : false,
+ alpha : false
+ },
+ stencilTest : {
+ enabled : true,
+ frontFunction : StencilFunction.ALWAYS,
+ frontOperation : {
+ fail : StencilOperation.KEEP,
+ zFail : StencilOperation.KEEP,
+ zPass : StencilOperation.INCREMENT_WRAP
+ },
+ backFunction : StencilFunction.ALWAYS,
+ backOperation : {
+ fail : StencilOperation.KEEP,
+ zFail : StencilOperation.KEEP,
+ zPass : StencilOperation.DECREMENT_WRAP
+ },
+ reference : stencilReference,
+ mask : stencilMask
+ },
+ depthTest : {
+ enabled : true,
+ func : DepthFunction.LESS_OR_EQUAL
+ },
+ depthMask : false
+ };
+
+ var classificationColorRS = {
+ stencilTest : {
+ enabled : true,
+ frontFunction : StencilFunction.NOT_EQUAL,
+ frontOperation : {
+ fail : StencilOperation.KEEP,
+ zFail : StencilOperation.KEEP,
+ zPass : StencilOperation.DECREMENT_WRAP
+ },
+ backFunction : StencilFunction.NOT_EQUAL,
+ backOperation : {
+ fail : StencilOperation.KEEP,
+ zFail : StencilOperation.KEEP,
+ zPass : StencilOperation.DECREMENT_WRAP
+ },
+ reference : stencilReference,
+ mask : stencilMask
+ },
+ depthTest : {
+ enabled : false
+ },
+ depthMask : false,
+ blending : BlendingState.ALPHA_BLEND
+ };
+
+ function createClassificationCommands(model, frameState) {
+ var scene3DOnly = frameState.scene3DOnly;
+ var nodeCommands = model._nodeCommands;
+ var length = nodeCommands.length;
+ for (var i = 0; i < length; ++i) {
+ var nodeCommand = nodeCommands[i];
+ var command = nodeCommand.command;
+
+ var preloadCommand = DrawCommand.shallowClone(command);
+ preloadCommand.renderState = RenderState.fromCache(classificationPreloadRS);
+ nodeCommand.classificationPreloadCommand = preloadCommand;
+
+ var stencilCommand = DrawCommand.shallowClone(command);
+ stencilCommand.renderState = RenderState.fromCache(classificationStencilRS);
+ nodeCommand.classificationStencilCommand = stencilCommand;
+
+ var colorCommand = DrawCommand.shallowClone(command);
+ colorCommand.renderState = RenderState.fromCache(classificationColorRS);
+ nodeCommand.classificationColorCommand = colorCommand;
+
+ if (!scene3DOnly) {
+ var command2D = nodeCommand.command2D;
+ var preloadCommand2D = DrawCommand.shallowClone(preloadCommand);
+ preloadCommand2D.boundingVolume = command2D.boundingVolume;
+ preloadCommand2D.modelMatrix = command2D.modelMatrix;
+ nodeCommand.classificationPreloadCommand2D = preloadCommand2D;
+
+ var stencilCommand2D = DrawCommand.shallowClone(stencilCommand);
+ stencilCommand2D.boundingVolume = command2D.boundingVolume;
+ stencilCommand2D.modelMatrix = command2D.modelMatrix;
+ nodeCommand.classificationStencilCommand2D = stencilCommand2D;
+
+ var colorCommand2D = DrawCommand.shallowClone(colorCommand);
+ colorCommand2D.boundingVolume = command2D.boundingVolume;
+ colorCommand2D.modelMatrix = command2D.modelMatrix;
+ nodeCommand.classificationColorCommand2D = colorCommand2D;
+ }
+ }
+ }
+
+ function updateClassification(model, frameState) {
+ var dirty = model._classificationType !== model.classificationType || model._dirty;
+ model._classificationType = model.classificationType;
+
+ if (!isClassification(model, frameState)) {
+ return;
+ }
+
+ var nodeCommands = model._nodeCommands;
+ if (!defined(nodeCommands[0].classificationPreloadCommand)) {
+ createClassificationCommands(model, frameState);
+ }
+
+ if (!dirty) {
+ return;
+ }
+
+ var pass;
+ switch (model._classificationType) {
+ case ClassificationType.TERRAIN:
+ pass = Pass.TERRAIN_CLASSIFICATION;
+ break;
+ case ClassificationType.CESIUM_3D_TILE:
+ pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;
+ break;
+ default:
+ pass = Pass.CLASSIFICATION;
+ }
+
+ var scene3DOnly = frameState.scene3DOnly;
+ var length = nodeCommands.length;
+ for (var i = 0; i < length; ++i) {
+ var nodeCommand = nodeCommands[i];
+
+ nodeCommand.classificationPreloadCommand.pass = pass;
+ nodeCommand.classificationStencilCommand.pass = pass;
+ nodeCommand.classificationColorCommand.pass = pass;
+
+ if (!scene3DOnly) {
+ nodeCommand.classificationPreloadCommand2D.pass = pass;
+ nodeCommand.classificationStencilCommand2D.pass = pass;
+ nodeCommand.classificationColorCommand2D.pass = pass;
+ }
+ }
+ }
+
var scratchBoundingSphere = new BoundingSphere();
function scaleInPixels(positionWC, radius, frameState) {
@@ -4609,8 +4806,9 @@ define([
var silhouette = hasSilhouette(this, frameState);
var translucent = isTranslucent(this);
var invisible = isInvisible(this);
+ var classification = isClassification(this, frameState);
var displayConditionPassed = defined(this.distanceDisplayCondition) ? distanceDisplayConditionVisible(this, frameState) : true;
- var show = this.show && displayConditionPassed && (this.scale !== 0.0) && (!invisible || silhouette);
+ var show = this.show && displayConditionPassed && (this.scale !== 0.0) && (!invisible || silhouette || classification);
if ((show && this._state === ModelState.LOADED) || justLoaded) {
var animated = this.activeAnimations.update(frameState) || this._cesiumAnimationsDirty;
@@ -4675,6 +4873,7 @@ define([
updateShadows(this);
updateColor(this, frameState);
updateSilhouette(this, frameState);
+ updateClassification(this, frameState);
}
if (justLoaded) {
@@ -4703,32 +4902,52 @@ define([
var boundingVolume;
if (passes.render) {
- for (i = 0; i < length; ++i) {
- nc = nodeCommands[i];
- if (nc.show) {
- var command = translucent ? nc.translucentCommand : nc.command;
- command = silhouette ? nc.silhouetteModelCommand : command;
- commandList.push(command);
- boundingVolume = nc.command.boundingVolume;
- if (frameState.mode === SceneMode.SCENE2D &&
- (boundingVolume.center.y + boundingVolume.radius > idl2D || boundingVolume.center.y - boundingVolume.radius < idl2D)) {
- var command2D = translucent ? nc.translucentCommand2D : nc.command2D;
- command2D = silhouette ? nc.silhouetteModelCommand2D : command2D;
- commandList.push(command2D);
+ if (!classification) {
+ for (i = 0; i < length; ++i) {
+ nc = nodeCommands[i];
+ if (nc.show) {
+ var command = translucent ? nc.translucentCommand : nc.command;
+ command = silhouette ? nc.silhouetteModelCommand : command;
+ commandList.push(command);
+ boundingVolume = nc.command.boundingVolume;
+ if (frameState.mode === SceneMode.SCENE2D &&
+ (boundingVolume.center.y + boundingVolume.radius > idl2D || boundingVolume.center.y - boundingVolume.radius < idl2D)) {
+ var command2D = translucent ? nc.translucentCommand2D : nc.command2D;
+ command2D = silhouette ? nc.silhouetteModelCommand2D : command2D;
+ commandList.push(command2D);
+ }
}
}
- }
- if (silhouette) {
- // Render second silhouette pass
+ if (silhouette) {
+ // Render second silhouette pass
+ for (i = 0; i < length; ++i) {
+ nc = nodeCommands[i];
+ if (nc.show) {
+ commandList.push(nc.silhouetteColorCommand);
+ boundingVolume = nc.command.boundingVolume;
+ if (frameState.mode === SceneMode.SCENE2D &&
+ (boundingVolume.center.y + boundingVolume.radius > idl2D || boundingVolume.center.y - boundingVolume.radius < idl2D)) {
+ commandList.push(nc.silhouetteColorCommand2D);
+ }
+ }
+ }
+ }
+ } else {
for (i = 0; i < length; ++i) {
nc = nodeCommands[i];
if (nc.show) {
- commandList.push(nc.silhouetteColorCommand);
- boundingVolume = nc.command.boundingVolume;
+ var originalCommand = nc.command;
+ boundingVolume = originalCommand.boundingVolume;
if (frameState.mode === SceneMode.SCENE2D &&
(boundingVolume.center.y + boundingVolume.radius > idl2D || boundingVolume.center.y - boundingVolume.radius < idl2D)) {
- commandList.push(nc.silhouetteColorCommand2D);
+ commandList.push(nc.classificationPreloadCommand2D);
+ commandList.push(nc.classificationStencilCommand2D);
+ commandList.push(nc.classificationColorCommand2D);
+ } else {
+ commandList.push(nc.classificationPreloadCommand);
+ commandList.push(nc.classificationStencilCommand);
+ commandList.push(nc.classificationColorCommand);
}
}
}
diff --git a/Source/Shaders/Builtin/Constants/passOpaque.glsl b/Source/Shaders/Builtin/Constants/passOpaque.glsl
index 8465b01838d1..8dfb5126f13a 100644
--- a/Source/Shaders/Builtin/Constants/passOpaque.glsl
+++ b/Source/Shaders/Builtin/Constants/passOpaque.glsl
@@ -6,4 +6,4 @@
*
* @see czm_pass
*/
-const float czm_passOpaque = 7.0;
+const float czm_passOpaque = 8.0;
diff --git a/Source/Shaders/Builtin/Constants/passOverlay.glsl b/Source/Shaders/Builtin/Constants/passOverlay.glsl
index e104cb08dd74..6aea11eb1ee0 100644
--- a/Source/Shaders/Builtin/Constants/passOverlay.glsl
+++ b/Source/Shaders/Builtin/Constants/passOverlay.glsl
@@ -6,4 +6,4 @@
*
* @see czm_pass
*/
-const float czm_passOverlay = 9.0;
+const float czm_passOverlay = 10.0;
diff --git a/Source/Shaders/Builtin/Constants/passTranslucent.glsl b/Source/Shaders/Builtin/Constants/passTranslucent.glsl
index 78cf93eb138f..1fd11409cc8b 100644
--- a/Source/Shaders/Builtin/Constants/passTranslucent.glsl
+++ b/Source/Shaders/Builtin/Constants/passTranslucent.glsl
@@ -6,4 +6,4 @@
*
* @see czm_pass
*/
-const float czm_passTranslucent = 8.0;
+const float czm_passTranslucent = 9.0;
From b4f367a52999b73de8cfa6d71e5eb85e85750be3 Mon Sep 17 00:00:00 2001
From: Dan Bagnell
Date: Fri, 1 Dec 2017 15:03:19 -0500
Subject: [PATCH 02/51] Add a separate pass for classification on both terrain
and 3D Tiles. This makes draw command management easier and reduces the
memory for draw commands by half.
---
Source/Scene/ClassificationPrimitive.js | 80 +++++--------------
Source/Scene/GroundPrimitive.js | 62 +++++---------
Source/Scene/Scene.js | 41 +++++++---
Source/Scene/Vector3DTilePrimitive.js | 74 +++++++----------
.../Builtin/Constants/passClassification.glsl | 9 +++
5 files changed, 107 insertions(+), 159 deletions(-)
create mode 100644 Source/Shaders/Builtin/Constants/passClassification.glsl
diff --git a/Source/Scene/ClassificationPrimitive.js b/Source/Scene/ClassificationPrimitive.js
index 7ca451d9bc5c..e33082f767d2 100644
--- a/Source/Scene/ClassificationPrimitive.js
+++ b/Source/Scene/ClassificationPrimitive.js
@@ -594,7 +594,7 @@ define([
function createColorCommands(classificationPrimitive, colorCommands) {
var primitive = classificationPrimitive._primitive;
var length = primitive._va.length * 3;
- colorCommands.length = length * 2;
+ colorCommands.length = length;
var i;
var command;
@@ -617,7 +617,6 @@ define([
command.renderState = classificationPrimitive._rsStencilPreloadPass;
command.shaderProgram = classificationPrimitive._sp;
command.uniformMap = uniformMap;
- command.pass = Pass.TERRAIN_CLASSIFICATION;
// stencil depth command
command = colorCommands[i + 1];
@@ -632,7 +631,6 @@ define([
command.renderState = classificationPrimitive._rsStencilDepthPass;
command.shaderProgram = classificationPrimitive._sp;
command.uniformMap = uniformMap;
- command.pass = Pass.TERRAIN_CLASSIFICATION;
// color command
command = colorCommands[i + 2];
@@ -647,12 +645,6 @@ define([
command.renderState = classificationPrimitive._rsColorPass;
command.shaderProgram = classificationPrimitive._sp;
command.uniformMap = uniformMap;
- command.pass = Pass.TERRAIN_CLASSIFICATION;
- }
-
- for (i = 0; i < length; ++i) {
- command = colorCommands[length + i] = DrawCommand.shallowClone(colorCommands[i], colorCommands[length + i]);
- command.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;
}
var commandsIgnoreShow = classificationPrimitive._commandsIgnoreShow;
@@ -678,7 +670,7 @@ define([
var primitive = classificationPrimitive._primitive;
var pickOffsets = primitive._pickOffsets;
var length = pickOffsets.length * 3;
- pickCommands.length = length * 2;
+ pickCommands.length = length;
var j;
var command;
@@ -707,7 +699,6 @@ define([
command.renderState = classificationPrimitive._rsStencilPreloadPass;
command.shaderProgram = classificationPrimitive._spStencil;
command.uniformMap = uniformMap;
- command.pass = Pass.TERRAIN_CLASSIFICATION;
// stencil depth command
command = pickCommands[j + 1];
@@ -724,7 +715,6 @@ define([
command.renderState = classificationPrimitive._rsStencilDepthPass;
command.shaderProgram = classificationPrimitive._spStencil;
command.uniformMap = uniformMap;
- command.pass = Pass.TERRAIN_CLASSIFICATION;
// color command
command = pickCommands[j + 2];
@@ -741,12 +731,6 @@ define([
command.renderState = classificationPrimitive._rsPickPass;
command.shaderProgram = classificationPrimitive._spPick;
command.uniformMap = uniformMap;
- command.pass = Pass.TERRAIN_CLASSIFICATION;
- }
-
- for (j = 0; j < length; ++j) {
- command = pickCommands[length + j] = DrawCommand.shallowClone(pickCommands[j], pickCommands[length + j]);
- command.pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;
}
}
@@ -756,31 +740,7 @@ define([
}
function boundingVolumeIndex(commandIndex, length) {
- return Math.floor((commandIndex % (length / 2)) / 3);
- }
-
- var scratchCommandIndices = {
- start : 0,
- end : 0
- };
-
- function getCommandIndices(classificationType, length) {
- var startIndex;
- var endIndex;
- if (classificationType === ClassificationType.TERRAIN) {
- startIndex = 0;
- endIndex = length / 2;
- } else if (classificationType === ClassificationType.CESIUM_3D_TILE) {
- startIndex = length / 2;
- endIndex = length;
- } else {
- startIndex = 0;
- endIndex = length;
- }
-
- scratchCommandIndices.start = startIndex;
- scratchCommandIndices.end = endIndex;
- return scratchCommandIndices;
+ return Math.floor((commandIndex % length) / 3);
}
function updateAndQueueCommands(classificationPrimitive, frameState, colorCommands, pickCommands, modelMatrix, cull, debugShowBoundingVolume, twoPasses) {
@@ -802,34 +762,37 @@ define([
var passes = frameState.passes;
var i;
- var indices;
- var startIndex;
- var endIndex;
- var classificationType = classificationPrimitive.classificationType;
+ var pass;
+ switch (classificationPrimitive.classificationType) {
+ case ClassificationType.TERRAIN:
+ pass = Pass.TERRAIN_CLASSIFICATION;
+ break;
+ case ClassificationType.CESIUM_3D_TILE:
+ pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;
+ break;
+ default:
+ pass = Pass.CLASSIFICATION;
+ }
if (passes.render) {
var colorCommand;
var colorLength = colorCommands.length;
- indices = getCommandIndices(classificationType, colorLength);
- startIndex = indices.start;
- endIndex = indices.end;
-
- for (i = startIndex; i < endIndex; ++i) {
+ for (i = 0; i < colorLength; ++i) {
colorCommand = colorCommands[i];
colorCommand.modelMatrix = modelMatrix;
colorCommand.boundingVolume = boundingVolumes[boundingVolumeIndex(i, colorLength)];
colorCommand.cull = cull;
colorCommand.debugShowBoundingVolume = debugShowBoundingVolume;
+ colorCommand.pass = pass;
commandList.push(colorCommand);
}
if (frameState.invertClassification) {
var ignoreShowCommands = classificationPrimitive._commandsIgnoreShow;
- startIndex = 0;
- endIndex = ignoreShowCommands.length;
+ var ignoreShowCommandsLength = ignoreShowCommands.length;
- for (i = startIndex; i < endIndex; ++i) {
+ for (i = 0; i < ignoreShowCommandsLength; ++i) {
var bvIndex = Math.floor(i / 2);
colorCommand = ignoreShowCommands[i];
colorCommand.modelMatrix = modelMatrix;
@@ -844,17 +807,14 @@ define([
if (passes.pick) {
var pickLength = pickCommands.length;
- indices = getCommandIndices(classificationType, pickLength);
- startIndex = indices.start;
- endIndex = indices.end;
-
var pickOffsets = primitive._pickOffsets;
- for (i = startIndex; i < endIndex; ++i) {
+ for (i = 0; i < pickLength; ++i) {
var pickOffset = pickOffsets[boundingVolumeIndex(i, pickLength)];
var pickCommand = pickCommands[i];
pickCommand.modelMatrix = modelMatrix;
pickCommand.boundingVolume = boundingVolumes[pickOffset.index];
pickCommand.cull = cull;
+ pickCommand.pass = pass;
commandList.push(pickCommand);
}
diff --git a/Source/Scene/GroundPrimitive.js b/Source/Scene/GroundPrimitive.js
index de0224d2a979..095e58968e4d 100644
--- a/Source/Scene/GroundPrimitive.js
+++ b/Source/Scene/GroundPrimitive.js
@@ -16,6 +16,7 @@ define([
'../Core/Math',
'../Core/OrientedBoundingBox',
'../Core/Rectangle',
+ '../Renderer/Pass',
'../ThirdParty/when',
'./ClassificationPrimitive',
'./ClassificationType',
@@ -38,6 +39,7 @@ define([
CesiumMath,
OrientedBoundingBox,
Rectangle,
+ Pass,
when,
ClassificationPrimitive,
ClassificationType,
@@ -566,31 +568,7 @@ define([
}
function boundingVolumeIndex(commandIndex, length) {
- return Math.floor((commandIndex % (length / 2)) / 3);
- }
-
- var scratchCommandIndices = {
- start : 0,
- end : 0
- };
-
- function getCommandIndices(classificationType, length) {
- var startIndex;
- var endIndex;
- if (classificationType === ClassificationType.TERRAIN) {
- startIndex = 0;
- endIndex = length / 2;
- } else if (classificationType === ClassificationType.CESIUM_3D_TILE) {
- startIndex = length / 2;
- endIndex = length;
- } else {
- startIndex = 0;
- endIndex = length;
- }
-
- scratchCommandIndices.start = startIndex;
- scratchCommandIndices.end = endIndex;
- return scratchCommandIndices;
+ return Math.floor((commandIndex % length) / 3);
}
function updateAndQueueCommands(groundPrimitive, frameState, colorCommands, pickCommands, modelMatrix, cull, debugShowBoundingVolume, twoPasses) {
@@ -601,39 +579,42 @@ define([
boundingVolumes = groundPrimitive._boundingVolumes2D;
}
- var indices;
- var startIndex;
- var endIndex;
- var classificationType = groundPrimitive.classificationType;
+ var pass;
+ switch (groundPrimitive.classificationType) {
+ case ClassificationType.TERRAIN:
+ pass = Pass.TERRAIN_CLASSIFICATION;
+ break;
+ case ClassificationType.CESIUM_3D_TILE:
+ pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;
+ break;
+ default:
+ pass = Pass.CLASSIFICATION;
+ }
var commandList = frameState.commandList;
var passes = frameState.passes;
if (passes.render) {
var colorLength = colorCommands.length;
- indices = getCommandIndices(classificationType, colorLength);
- startIndex = indices.start;
- endIndex = indices.end;
-
var i;
var colorCommand;
- for (i = startIndex; i < endIndex; ++i) {
+ for (i = 0; i < colorLength; ++i) {
colorCommand = colorCommands[i];
colorCommand.owner = groundPrimitive;
colorCommand.modelMatrix = modelMatrix;
colorCommand.boundingVolume = boundingVolumes[boundingVolumeIndex(i, colorLength)];
colorCommand.cull = cull;
colorCommand.debugShowBoundingVolume = debugShowBoundingVolume;
+ colorCommand.pass = pass;
commandList.push(colorCommand);
}
if (frameState.invertClassification) {
var ignoreShowCommands = groundPrimitive._primitive._commandsIgnoreShow;
- startIndex = 0;
- endIndex = ignoreShowCommands.length;
+ var ignoreShowCommandsLength = ignoreShowCommands.length;
- for (i = startIndex; i < endIndex; ++i) {
+ for (i = 0; i < ignoreShowCommandsLength; ++i) {
var bvIndex = Math.floor(i / 2);
colorCommand = ignoreShowCommands[i];
colorCommand.modelMatrix = modelMatrix;
@@ -648,13 +629,9 @@ define([
if (passes.pick) {
var pickLength = pickCommands.length;
- indices = getCommandIndices(classificationType, pickLength);
- startIndex = indices.start;
- endIndex = indices.end;
-
var primitive = groundPrimitive._primitive._primitive;
var pickOffsets = primitive._pickOffsets;
- for (var j = startIndex; j < endIndex; ++j) {
+ for (var j = 0; j < pickLength; ++j) {
var pickOffset = pickOffsets[boundingVolumeIndex(j, pickLength)];
var bv = boundingVolumes[pickOffset.index];
@@ -663,6 +640,7 @@ define([
pickCommand.modelMatrix = modelMatrix;
pickCommand.boundingVolume = bv;
pickCommand.cull = cull;
+ pickCommand.pass = pass;
commandList.push(pickCommand);
}
diff --git a/Source/Scene/Scene.js b/Source/Scene/Scene.js
index 196999a79d20..7fe5b2ed5c42 100644
--- a/Source/Scene/Scene.js
+++ b/Source/Scene/Scene.js
@@ -1983,6 +1983,7 @@ define([
passState.framebuffer = fb;
}
+ // Draw terrain classification
us.updatePass(Pass.TERRAIN_CLASSIFICATION);
commands = frustumCommands.commands[Pass.TERRAIN_CLASSIFICATION];
length = frustumCommands.indices[Pass.TERRAIN_CLASSIFICATION];
@@ -1990,6 +1991,14 @@ define([
executeCommand(commands[j], scene, context, passState);
}
+ // Draw classification marked for both terrain and 3D Tiles classification
+ us.updatePass(Pass.CLASSIFICATION);
+ commands = frustumCommands.commands[Pass.CLASSIFICATION];
+ length = frustumCommands.indices[Pass.CLASSIFICATION];
+ for (j = 0; j < length; ++j) {
+ executeCommand(commands[j], scene, context, passState);
+ }
+
if (clearGlobeDepth) {
clearDepth.execute(context, passState);
}
@@ -2012,6 +2021,14 @@ define([
for (j = 0; j < length; ++j) {
executeCommand(commands[j], scene, context, passState);
}
+
+ // Draw classification marked for both terrain and 3D Tiles classification
+ us.updatePass(Pass.CLASSIFICATION);
+ commands = frustumCommands.commands[Pass.CLASSIFICATION];
+ length = frustumCommands.indices[Pass.CLASSIFICATION];
+ for (j = 0; j < length; ++j) {
+ executeCommand(commands[j], scene, context, passState);
+ }
} else {
// When the invert classification color is opaque:
// Main FBO (FBO1): Main_Color + Main_DepthStencil
@@ -2087,6 +2104,14 @@ define([
for (j = 0; j < length; ++j) {
executeCommand(commands[j], scene, context, passState);
}
+
+ // Draw style over classification marked for both terrain and 3D Tiles classification
+ us.updatePass(Pass.CLASSIFICATION);
+ commands = frustumCommands.commands[Pass.CLASSIFICATION];
+ length = frustumCommands.indices[Pass.CLASSIFICATION];
+ for (j = 0; j < length; ++j) {
+ executeCommand(commands[j], scene, context, passState);
+ }
}
if (length > 0 && context.stencilBuffer) {
@@ -2097,17 +2122,11 @@ define([
depthPlane.execute(context, passState);
}
- // Execute commands in order by pass up to the translucent pass.
- // Translucent geometry needs special handling (sorting/OIT).
- var startPass = Pass.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW + 1;
- var endPass = Pass.TRANSLUCENT;
- for (var pass = startPass; pass < endPass; ++pass) {
- us.updatePass(pass);
- commands = frustumCommands.commands[pass];
- length = frustumCommands.indices[pass];
- for (j = 0; j < length; ++j) {
- executeCommand(commands[j], scene, context, passState);
- }
+ us.updatePass(Pass.OPAQUE);
+ commands = frustumCommands.commands[Pass.OPAQUE];
+ length = frustumCommands.indices[Pass.OPAQUE];
+ for (j = 0; j < length; ++j) {
+ executeCommand(commands[j], scene, context, passState);
}
if (index !== 0 && scene.mode !== SceneMode.SCENE2D) {
diff --git a/Source/Scene/Vector3DTilePrimitive.js b/Source/Scene/Vector3DTilePrimitive.js
index 018aba47b63d..9649af2bd1ab 100644
--- a/Source/Scene/Vector3DTilePrimitive.js
+++ b/Source/Scene/Vector3DTilePrimitive.js
@@ -643,17 +643,14 @@ define([
var commands = primitive._commands;
var batchedIndices = primitive._batchedIndices;
var length = batchedIndices.length;
- var commandsLength = length * 3 * (primitive._classificationType === ClassificationType.BOTH ? 2 : 1);
+ var commandsLength = length * 3;
if (defined(commands) &&
!needsRebatch &&
- commands.length === commandsLength &&
- primitive.classificationType === primitive._classificationType) {
+ commands.length === commandsLength) {
return;
}
- primitive._pickCommandsDirty = primitive._pickCommandsDirty || primitive._classificationType !== primitive.classificationType;
- primitive._classificationType = primitive.classificationType;
commands.length = commandsLength;
var vertexArray = primitive._va;
@@ -661,7 +658,6 @@ define([
var modelMatrix = Matrix4.IDENTITY;
var uniformMap = primitive._batchTable.getUniformMapCallback()(primitive._uniformMap);
var bv = primitive._boundingVolume;
- var pass = primitive._classificationType !== ClassificationType.TERRAIN ? Pass.CESIUM_3D_TILE_CLASSIFICATION : Pass.TERRAIN_CLASSIFICATION;
for (var j = 0; j < length; ++j) {
var offset = batchedIndices[j].offset;
@@ -682,7 +678,6 @@ define([
stencilPreloadCommand.shaderProgram = sp;
stencilPreloadCommand.uniformMap = uniformMap;
stencilPreloadCommand.boundingVolume = bv;
- stencilPreloadCommand.pass = pass;
var stencilDepthCommand = commands[j * 3 + 1];
if (!defined(stencilDepthCommand)) {
@@ -699,7 +694,6 @@ define([
stencilDepthCommand.shaderProgram = sp;
stencilDepthCommand.uniformMap = uniformMap;
stencilDepthCommand.boundingVolume = bv;
- stencilDepthCommand.pass = pass;
var colorCommand = commands[j * 3 + 2];
if (!defined(colorCommand)) {
@@ -716,20 +710,6 @@ define([
colorCommand.shaderProgram = sp;
colorCommand.uniformMap = uniformMap;
colorCommand.boundingVolume = bv;
- colorCommand.pass = pass;
- }
-
- if (primitive._classificationType === ClassificationType.BOTH) {
- length = length * 3;
- for (var i = 0; i < length; ++i) {
- var command = commands[i + length];
- if (!defined(command)) {
- command = commands[i + length] = new DrawCommand();
- }
-
- DrawCommand.shallowClone(commands[i], command);
- command.pass = Pass.TERRAIN_CLASSIFICATION;
- }
}
primitive._commandsDirty = true;
@@ -772,14 +752,13 @@ define([
var length = primitive._indexOffsets.length;
var pickCommands = primitive._pickCommands;
- pickCommands.length = length * 3 * (primitive._classificationType === ClassificationType.BOTH ? 2 : 1);
+ pickCommands.length = length * 3;
var vertexArray = primitive._va;
var spStencil = primitive._spStencil;
var spPick = primitive._spPick;
var modelMatrix = Matrix4.IDENTITY;
var uniformMap = primitive._batchTable.getPickUniformMapCallback()(primitive._uniformMap);
- var pass = primitive._classificationType !== ClassificationType.TERRAIN ? Pass.CESIUM_3D_TILE_CLASSIFICATION : Pass.TERRAIN_CLASSIFICATION;
for (var j = 0; j < length; ++j) {
var offset = primitive._indexOffsets[j];
@@ -801,7 +780,6 @@ define([
stencilPreloadCommand.shaderProgram = spStencil;
stencilPreloadCommand.uniformMap = uniformMap;
stencilPreloadCommand.boundingVolume = bv;
- stencilPreloadCommand.pass = pass;
var stencilDepthCommand = pickCommands[j * 3 + 1];
if (!defined(stencilDepthCommand)) {
@@ -818,7 +796,6 @@ define([
stencilDepthCommand.shaderProgram = spStencil;
stencilDepthCommand.uniformMap = uniformMap;
stencilDepthCommand.boundingVolume = bv;
- stencilDepthCommand.pass = pass;
var colorCommand = pickCommands[j * 3 + 2];
if (!defined(colorCommand)) {
@@ -835,20 +812,6 @@ define([
colorCommand.shaderProgram = spPick;
colorCommand.uniformMap = uniformMap;
colorCommand.boundingVolume = bv;
- colorCommand.pass = pass;
- }
-
- if (primitive._classificationType === ClassificationType.BOTH) {
- length = length * 3;
- for (var i = 0; i < length; ++i) {
- var command = pickCommands[i + length];
- if (!defined(command)) {
- command = pickCommands[i + length] = new DrawCommand();
- }
-
- DrawCommand.shallowClone(pickCommands[i], command);
- command.pass = Pass.TERRAIN_CLASSIFICATION;
- }
}
primitive._pickCommandsDirty = false;
@@ -1037,12 +1000,15 @@ define([
this._batchDirty = true;
};
- function queueCommands(frameState, commands, commandsIgnoreShow) {
+ function queueCommands(frameState, pass, commands, commandsIgnoreShow) {
var commandList = frameState.commandList;
var commandLength = commands.length;
var i;
+ var command;
for (i = 0; i < commandLength; ++i) {
- commandList.push(commands[i]);
+ command = commands[i];
+ command.pass = pass;
+ commandList.push(command);
}
if (!frameState.invertClassification || !defined(commandsIgnoreShow)) {
@@ -1051,7 +1017,9 @@ define([
commandLength = commandsIgnoreShow.length;
for (i = 0; i < commandLength; ++i) {
- commandList.push(commandsIgnoreShow[i]);
+ command = commandsIgnoreShow[i];
+ command.pass = pass;
+ commandList.push(command);
}
}
@@ -1059,7 +1027,9 @@ define([
var commandList = frameState.commandList;
var commandLength = commands.length;
for (var i = 0; i < commandLength; i += 3) {
- commandList.push(commands[i + 2]);
+ var command = commands[i + 2];
+ command.pass = Pass.OPAQUE;
+ commandList.push(command);
}
}
@@ -1107,6 +1077,18 @@ define([
createRenderStates(this);
createUniformMap(this, context);
+ var pass;
+ switch (this.classificationType) {
+ case ClassificationType.TERRAIN:
+ pass = Pass.TERRAIN_CLASSIFICATION;
+ break;
+ case ClassificationType.CESIUM_3D_TILE:
+ pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;
+ break;
+ default:
+ pass = Pass.CLASSIFICATION;
+ }
+
var passes = frameState.passes;
if (passes.render) {
createColorCommands(this, context);
@@ -1116,13 +1098,13 @@ define([
if (this._debugWireframe) {
queueWireframeCommands(frameState, this._commands);
} else {
- queueCommands(frameState, this._commands, this._commandsIgnoreShow);
+ queueCommands(frameState, pass, this._commands, this._commandsIgnoreShow);
}
}
if (passes.pick) {
createPickCommands(this);
- queueCommands(frameState, this._pickCommands);
+ queueCommands(frameState, pass, this._pickCommands);
}
};
diff --git a/Source/Shaders/Builtin/Constants/passClassification.glsl b/Source/Shaders/Builtin/Constants/passClassification.glsl
new file mode 100644
index 000000000000..8e1b63be6963
--- /dev/null
+++ b/Source/Shaders/Builtin/Constants/passClassification.glsl
@@ -0,0 +1,9 @@
+/**
+ * The automatic GLSL constant for {@link Pass#CLASSIFICATION}
+ *
+ * @name czm_passClassification
+ * @glslConstant
+ *
+ * @see czm_pass
+ */
+const float czm_passClassification = 8.0;
From e7ec3be1a36df853e2392fde5ef585bc7199aa2a Mon Sep 17 00:00:00 2001
From: Dan Bagnell
Date: Fri, 1 Dec 2017 16:27:40 -0500
Subject: [PATCH 03/51] Optimize b3dm classification fragment shader.
---
Source/Scene/Batched3DModel3DTileContent.js | 9 ++++
Source/Scene/Cesium3DTileBatchTable.js | 31 ++++++++++++++
Source/Scene/Cesium3DTileset.js | 4 +-
Source/Scene/ClassificationType.js | 1 -
Source/Scene/Model.js | 47 ++++++++++++++++++++-
Source/Scene/Vector3DTilePrimitive.js | 3 +-
6 files changed, 88 insertions(+), 7 deletions(-)
diff --git a/Source/Scene/Batched3DModel3DTileContent.js b/Source/Scene/Batched3DModel3DTileContent.js
index 210601ffb8d1..321953401f93 100644
--- a/Source/Scene/Batched3DModel3DTileContent.js
+++ b/Source/Scene/Batched3DModel3DTileContent.js
@@ -231,6 +231,14 @@ define([
};
}
+ function getClassificationFragmentShaderCallback(content) {
+ return function(fs) {
+ var batchTable = content._batchTable;
+ var callback = batchTable.getClassificationFragmentShaderCallback();
+ return defined(callback) ? callback(fs) : fs;
+ };
+ }
+
function initialize(content, arrayBuffer, byteOffset) {
var tileset = content._tileset;
var tile = content._tile;
@@ -370,6 +378,7 @@ define([
incrementallyLoadTextures : false,
vertexShaderLoaded : getVertexShaderCallback(content),
fragmentShaderLoaded : getFragmentShaderCallback(content),
+ classificationShaderLoaded : getClassificationFragmentShaderCallback(content),
uniformMapLoaded : batchTable.getUniformMapCallback(),
pickVertexShaderLoaded : getPickVertexShaderCallback(content),
pickFragmentShaderLoaded : batchTable.getPickFragmentShaderCallback(),
diff --git a/Source/Scene/Cesium3DTileBatchTable.js b/Source/Scene/Cesium3DTileBatchTable.js
index df4dc636e03a..cdcfcb1caefb 100644
--- a/Source/Scene/Cesium3DTileBatchTable.js
+++ b/Source/Scene/Cesium3DTileBatchTable.js
@@ -1049,6 +1049,37 @@ define([
};
};
+ Cesium3DTileBatchTable.prototype.getClassificationFragmentShaderCallback = function() {
+ if (this.featuresLength === 0) {
+ return;
+ }
+ return function(source) {
+ source = ShaderSource.replaceMain(source, 'tile_main');
+ if (ContextLimits.maximumVertexTextureImageUnits > 0) {
+ // When VTF is supported, per-feature show/hide already happened in the fragment shader
+ source +=
+ 'varying vec4 tile_featureColor; \n' +
+ 'void main() \n' +
+ '{ \n' +
+ ' gl_FragColor = tile_featureColor; \n' +
+ '}';
+ } else {
+ source +=
+ 'uniform sampler2D tile_batchTexture; \n' +
+ 'varying vec2 tile_featureSt; \n' +
+ 'void main() \n' +
+ '{ \n' +
+ ' vec4 featureProperties = texture2D(tile_batchTexture, tile_featureSt); \n' +
+ ' if (featureProperties.a == 0.0) { \n' + // show: alpha == 0 - false, non-zeo - true
+ ' discard; \n' +
+ ' } \n' +
+ ' gl_FragColor = featureProperties; \n' +
+ '} \n';
+ }
+ return source;
+ };
+ };
+
function getColorBlend(batchTable) {
var tileset = batchTable._content._tileset;
var colorBlendMode = tileset.colorBlendMode;
diff --git a/Source/Scene/Cesium3DTileset.js b/Source/Scene/Cesium3DTileset.js
index 2cdacedba107..db5982a5fc9c 100644
--- a/Source/Scene/Cesium3DTileset.js
+++ b/Source/Scene/Cesium3DTileset.js
@@ -524,11 +524,11 @@ define([
/**
* Determines whether terrain, 3D Tiles or both will be classified by vector tiles.
* @type {ClassificationType}
- * @default ClassificationType.CESIUM_3D_TILE
+ * @default undefined
*
* @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
*/
- this.classificationType = defaultValue(options.classificationType, ClassificationType.NONE);
+ this.classificationType = options.classificationType;
/**
* This property is for debugging only; it is not optimized for production use.
diff --git a/Source/Scene/ClassificationType.js b/Source/Scene/ClassificationType.js
index 987d83a5910d..b8b9e7eced1b 100644
--- a/Source/Scene/ClassificationType.js
+++ b/Source/Scene/ClassificationType.js
@@ -10,7 +10,6 @@ define([
* @exports ClassificationOption
*/
var ClassificationType = {
- NONE : -1,
/**
* Only terrain will be classified.
*
diff --git a/Source/Scene/Model.js b/Source/Scene/Model.js
index af37804d2e5c..5cf25fad7c33 100644
--- a/Source/Scene/Model.js
+++ b/Source/Scene/Model.js
@@ -435,7 +435,7 @@ define([
*/
this.silhouetteSize = defaultValue(options.silhouetteSize, 0.0);
- this.classificationType = defaultValue(options.classificationType, ClassificationType.NONE);
+ this.classificationType = options.classificationType;
this._classificationType = undefined;
/**
@@ -627,6 +627,7 @@ define([
this._precreatedAttributes = options.precreatedAttributes;
this._vertexShaderLoaded = options.vertexShaderLoaded;
this._fragmentShaderLoaded = options.fragmentShaderLoaded;
+ this._classificationShaderLoaded = options.classificationShaderLoaded;
this._uniformMapLoaded = options.uniformMapLoaded;
this._pickVertexShaderLoaded = options.pickVertexShaderLoaded;
this._pickFragmentShaderLoaded = options.pickFragmentShaderLoaded;
@@ -683,6 +684,7 @@ define([
programs : {},
pickPrograms : {},
silhouettePrograms : {},
+ classificationPrograms : {},
textures : {},
samplers : {},
renderStates : {}
@@ -3674,6 +3676,7 @@ define([
resources.programs = cachedResources.programs;
resources.pickPrograms = cachedResources.pickPrograms;
resources.silhouettePrograms = cachedResources.silhouettePrograms;
+ resources.classificationPrograms = cachedResources.classificationPrograms;
resources.textures = cachedResources.textures;
resources.samplers = cachedResources.samplers;
resources.renderStates = cachedResources.renderStates;
@@ -4059,7 +4062,7 @@ define([
}
function isClassification(model, frameState) {
- return frameState.context.stencilBuffer && model.classificationType !== ClassificationType.NONE;
+ return frameState.context.stencilBuffer && defined(model.classificationType);
}
function hasTranslucentCommands(model) {
@@ -4322,24 +4325,61 @@ define([
blending : BlendingState.ALPHA_BLEND
};
+ function createClassificationProgram(model, id, program, frameState) {
+ var vs = program.vertexShaderSource;
+ var attributeLocations = program._attributeLocations;
+ var fs =
+ 'void main() \n' +
+ '{ \n' +
+ ' gl_FragColor = vec4(1.0); \n' +
+ '}';
+
+ fs = modifyShader(fs, id, model._classificationShaderLoaded);
+
+ return ShaderProgram.fromCache({
+ context : frameState.context,
+ vertexShaderSource : vs,
+ fragmentShaderSource : fs,
+ attributeLocations : attributeLocations
+ });
+ }
+
function createClassificationCommands(model, frameState) {
var scene3DOnly = frameState.scene3DOnly;
+ var classificationPrograms = model._rendererResources.classificationPrograms;
var nodeCommands = model._nodeCommands;
var length = nodeCommands.length;
for (var i = 0; i < length; ++i) {
var nodeCommand = nodeCommands[i];
var command = nodeCommand.command;
+ var program = command.shaderProgram;
+ var id = getProgramId(model, program);
+ var classificationProgram = classificationPrograms[id];
+ if (!defined(classificationProgram)) {
+ classificationProgram = createClassificationProgram(model, id, program, frameState);
+ classificationPrograms[id] = classificationProgram;
+ }
+
var preloadCommand = DrawCommand.shallowClone(command);
preloadCommand.renderState = RenderState.fromCache(classificationPreloadRS);
+ preloadCommand.shaderProgram = classificationProgram;
+ preloadCommand.castShadows = false;
+ preloadCommand.receiveShadows = false;
nodeCommand.classificationPreloadCommand = preloadCommand;
var stencilCommand = DrawCommand.shallowClone(command);
stencilCommand.renderState = RenderState.fromCache(classificationStencilRS);
+ stencilCommand.shaderProgram = classificationProgram;
+ stencilCommand.castShadows = false;
+ stencilCommand.receiveShadows = false;
nodeCommand.classificationStencilCommand = stencilCommand;
var colorCommand = DrawCommand.shallowClone(command);
colorCommand.renderState = RenderState.fromCache(classificationColorRS);
+ colorCommand.shaderProgram = classificationProgram;
+ colorCommand.castShadows = false;
+ colorCommand.receiveShadows = false;
nodeCommand.classificationColorCommand = colorCommand;
if (!scene3DOnly) {
@@ -4503,6 +4543,7 @@ define([
this.programs = undefined;
this.pickPrograms = undefined;
this.silhouettePrograms = undefined;
+ this.classificationPrograms = undefined;
this.textures = undefined;
this.samplers = undefined;
this.renderStates = undefined;
@@ -4527,6 +4568,7 @@ define([
destroy(resources.programs);
destroy(resources.pickPrograms);
destroy(resources.silhouettePrograms);
+ destroy(resources.classificationPrograms);
destroy(resources.textures);
}
@@ -4784,6 +4826,7 @@ define([
cachedResources.programs = resources.programs;
cachedResources.pickPrograms = resources.pickPrograms;
cachedResources.silhouettePrograms = resources.silhouettePrograms;
+ cachedResources.classificationPrograms = resources.classificationPrograms;
cachedResources.textures = resources.textures;
cachedResources.samplers = resources.samplers;
cachedResources.renderStates = resources.renderStates;
diff --git a/Source/Scene/Vector3DTilePrimitive.js b/Source/Scene/Vector3DTilePrimitive.js
index 9649af2bd1ab..0978d8886c28 100644
--- a/Source/Scene/Vector3DTilePrimitive.js
+++ b/Source/Scene/Vector3DTilePrimitive.js
@@ -154,7 +154,6 @@ define([
* @default ClassificationType.CESIUM_3D_TILE
*/
this.classificationType = ClassificationType.CESIUM_3D_TILE;
- this._classificationType = this.classificationType;
this._batchIdLookUp = {};
@@ -716,7 +715,7 @@ define([
}
function createColorCommandsIgnoreShow(primitive, frameState) {
- if (primitive._classificationType === ClassificationType.TERRAIN ||
+ if (primitive.classificationType === ClassificationType.TERRAIN ||
!frameState.invertClassification ||
(defined(primitive._commandsIgnoreShow) && !primitive._commandsDirty)) {
return;
From 2b0f52f60cb4dd404d2454625ce02ab9225b649b Mon Sep 17 00:00:00 2001
From: Dan Bagnell
Date: Mon, 4 Dec 2017 14:51:44 -0500
Subject: [PATCH 04/51] Initial rework.
---
Source/Scene/Batched3DModel3DTileContent.js | 75 +-
Source/Scene/ClassificationModel.js | 3808 +++++++++++++++++++
Source/Scene/Model.js | 306 +-
3 files changed, 3881 insertions(+), 308 deletions(-)
create mode 100644 Source/Scene/ClassificationModel.js
diff --git a/Source/Scene/Batched3DModel3DTileContent.js b/Source/Scene/Batched3DModel3DTileContent.js
index 321953401f93..05dacde8888b 100644
--- a/Source/Scene/Batched3DModel3DTileContent.js
+++ b/Source/Scene/Batched3DModel3DTileContent.js
@@ -16,6 +16,7 @@ define([
'./Cesium3DTileBatchTable',
'./Cesium3DTileFeature',
'./Cesium3DTileFeatureTable',
+ './ClassificationModel',
'./getAttributeOrUniformBySemantic',
'./Model'
], function(
@@ -36,6 +37,7 @@ define([
Cesium3DTileBatchTable,
Cesium3DTileFeature,
Cesium3DTileFeatureTable,
+ ClassificationModel,
getAttributeOrUniformBySemantic,
Model) {
'use strict';
@@ -362,30 +364,55 @@ define([
primitive : tileset
};
- // PERFORMANCE_IDEA: patch the shader on demand, e.g., the first time show/color changes.
- // The pick shader still needs to be patched.
- content._model = new Model({
- gltf : gltfView,
- cull : false, // The model is already culled by 3D Tiles
- releaseGltfJson : true, // Models are unique and will not benefit from caching so save memory
- opaquePass : Pass.CESIUM_3D_TILE, // Draw opaque portions of the model during the 3D Tiles pass
- basePath : basePath,
- requestType : RequestType.TILES3D,
- modelMatrix : tile.computedTransform,
- upAxis : tileset._gltfUpAxis,
- shadows: tileset.shadows,
- debugWireframe: tileset.debugWireframe,
- incrementallyLoadTextures : false,
- vertexShaderLoaded : getVertexShaderCallback(content),
- fragmentShaderLoaded : getFragmentShaderCallback(content),
- classificationShaderLoaded : getClassificationFragmentShaderCallback(content),
- uniformMapLoaded : batchTable.getUniformMapCallback(),
- pickVertexShaderLoaded : getPickVertexShaderCallback(content),
- pickFragmentShaderLoaded : batchTable.getPickFragmentShaderCallback(),
- pickUniformMapLoaded : batchTable.getPickUniformMapCallback(),
- addBatchIdToGeneratedShaders : (batchLength > 0), // If the batch table has values in it, generated shaders will need a batchId attribute
- pickObject : pickObject
- });
+ if (!defined(tileset.classificationType)) {
+ // PERFORMANCE_IDEA: patch the shader on demand, e.g., the first time show/color changes.
+ // The pick shader still needs to be patched.
+ content._model = new Model({
+ gltf : gltfView,
+ cull : false, // The model is already culled by 3D Tiles
+ releaseGltfJson : true, // Models are unique and will not benefit from caching so save memory
+ opaquePass : Pass.CESIUM_3D_TILE, // Draw opaque portions of the model during the 3D Tiles pass
+ basePath : basePath,
+ requestType : RequestType.TILES3D,
+ modelMatrix : tile.computedTransform,
+ upAxis : tileset._gltfUpAxis,
+ shadows: tileset.shadows,
+ debugWireframe: tileset.debugWireframe,
+ incrementallyLoadTextures : false,
+ vertexShaderLoaded : getVertexShaderCallback(content),
+ fragmentShaderLoaded : getFragmentShaderCallback(content),
+ classificationShaderLoaded : getClassificationFragmentShaderCallback(content),
+ uniformMapLoaded : batchTable.getUniformMapCallback(),
+ pickVertexShaderLoaded : getPickVertexShaderCallback(content),
+ pickFragmentShaderLoaded : batchTable.getPickFragmentShaderCallback(),
+ pickUniformMapLoaded : batchTable.getPickUniformMapCallback(),
+ addBatchIdToGeneratedShaders : (batchLength > 0), // If the batch table has values in it, generated shaders will need a batchId attribute
+ pickObject : pickObject
+ });
+ } else {
+ content._model = new ClassificationModel({
+ gltf : gltfView,
+ cull : false, // The model is already culled by 3D Tiles
+ releaseGltfJson : true, // Models are unique and will not benefit from caching so save memory
+ opaquePass : Pass.CESIUM_3D_TILE, // Draw opaque portions of the model during the 3D Tiles pass
+ basePath : basePath,
+ requestType : RequestType.TILES3D,
+ modelMatrix : tile.computedTransform,
+ upAxis : tileset._gltfUpAxis,
+ shadows : tileset.shadows,
+ debugWireframe : tileset.debugWireframe,
+ incrementallyLoadTextures : false,
+ vertexShaderLoaded : getVertexShaderCallback(content),
+ fragmentShaderLoaded : getFragmentShaderCallback(content),
+ classificationShaderLoaded : getClassificationFragmentShaderCallback(content),
+ uniformMapLoaded : batchTable.getUniformMapCallback(),
+ pickVertexShaderLoaded : getPickVertexShaderCallback(content),
+ pickFragmentShaderLoaded : batchTable.getPickFragmentShaderCallback(),
+ pickUniformMapLoaded : batchTable.getPickUniformMapCallback(),
+ addBatchIdToGeneratedShaders : (batchLength > 0), // If the batch table has values in it, generated shaders will need a batchId attribute
+ pickObject : pickObject
+ });
+ }
}
function createFeatures(content) {
diff --git a/Source/Scene/ClassificationModel.js b/Source/Scene/ClassificationModel.js
new file mode 100644
index 000000000000..32145c0dd411
--- /dev/null
+++ b/Source/Scene/ClassificationModel.js
@@ -0,0 +1,3808 @@
+define([
+ '../Core/BoundingSphere',
+ '../Core/Cartesian2',
+ '../Core/Cartesian3',
+ '../Core/Cartesian4',
+ '../Core/Cartographic',
+ '../Core/clone',
+ '../Core/Color',
+ '../Core/combine',
+ '../Core/defaultValue',
+ '../Core/defined',
+ '../Core/defineProperties',
+ '../Core/destroyObject',
+ '../Core/DeveloperError',
+ '../Core/DistanceDisplayCondition',
+ '../Core/FeatureDetection',
+ '../Core/getAbsoluteUri',
+ '../Core/getBaseUri',
+ '../Core/getMagic',
+ '../Core/getStringFromTypedArray',
+ '../Core/IndexDatatype',
+ '../Core/joinUrls',
+ '../Core/loadArrayBuffer',
+ '../Core/loadCRN',
+ '../Core/loadImage',
+ '../Core/loadImageFromTypedArray',
+ '../Core/loadKTX',
+ '../Core/loadText',
+ '../Core/Math',
+ '../Core/Matrix2',
+ '../Core/Matrix3',
+ '../Core/Matrix4',
+ '../Core/PixelFormat',
+ '../Core/PrimitiveType',
+ '../Core/Quaternion',
+ '../Core/Queue',
+ '../Core/RuntimeError',
+ '../Core/Transforms',
+ '../Core/WebGLConstants',
+ '../Renderer/Buffer',
+ '../Renderer/BufferUsage',
+ '../Renderer/DrawCommand',
+ '../Renderer/Pass',
+ '../Renderer/RenderState',
+ '../Renderer/Sampler',
+ '../Renderer/ShaderProgram',
+ '../Renderer/ShaderSource',
+ '../Renderer/Texture',
+ '../Renderer/TextureMinificationFilter',
+ '../Renderer/TextureWrap',
+ '../Renderer/VertexArray',
+ '../ThirdParty/GltfPipeline/addDefaults',
+ '../ThirdParty/GltfPipeline/addPipelineExtras',
+ '../ThirdParty/GltfPipeline/ForEach',
+ '../ThirdParty/GltfPipeline/getAccessorByteStride',
+ '../ThirdParty/GltfPipeline/numberOfComponentsForType',
+ '../ThirdParty/GltfPipeline/parseBinaryGltf',
+ '../ThirdParty/GltfPipeline/processModelMaterialsCommon',
+ '../ThirdParty/GltfPipeline/processPbrMetallicRoughness',
+ '../ThirdParty/GltfPipeline/updateVersion',
+ '../ThirdParty/Uri',
+ '../ThirdParty/when',
+ './AttributeType',
+ './Axis',
+ './BlendingState',
+ './ClassificationType',
+ './ColorBlendMode',
+ './DepthFunction',
+ './getAttributeOrUniformBySemantic',
+ './HeightReference',
+ './JobType',
+ './ModelAnimationCache',
+ './ModelAnimationCollection',
+ './ModelMaterial',
+ './ModelMesh',
+ './ModelNode',
+ './SceneMode',
+ './ShadowMode',
+ './StencilFunction',
+ './StencilOperation'
+], function(
+ BoundingSphere,
+ Cartesian2,
+ Cartesian3,
+ Cartesian4,
+ Cartographic,
+ clone,
+ Color,
+ combine,
+ defaultValue,
+ defined,
+ defineProperties,
+ destroyObject,
+ DeveloperError,
+ DistanceDisplayCondition,
+ FeatureDetection,
+ getAbsoluteUri,
+ getBaseUri,
+ getMagic,
+ getStringFromTypedArray,
+ IndexDatatype,
+ joinUrls,
+ loadArrayBuffer,
+ loadCRN,
+ loadImage,
+ loadImageFromTypedArray,
+ loadKTX,
+ loadText,
+ CesiumMath,
+ Matrix2,
+ Matrix3,
+ Matrix4,
+ PixelFormat,
+ PrimitiveType,
+ Quaternion,
+ Queue,
+ RuntimeError,
+ Transforms,
+ WebGLConstants,
+ Buffer,
+ BufferUsage,
+ DrawCommand,
+ Pass,
+ RenderState,
+ Sampler,
+ ShaderProgram,
+ ShaderSource,
+ Texture,
+ TextureMinificationFilter,
+ TextureWrap,
+ VertexArray,
+ addDefaults,
+ addPipelineExtras,
+ ForEach,
+ getAccessorByteStride,
+ numberOfComponentsForType,
+ parseBinaryGltf,
+ processModelMaterialsCommon,
+ processPbrMetallicRoughness,
+ updateVersion,
+ Uri,
+ when,
+ AttributeType,
+ Axis,
+ BlendingState,
+ ClassificationType,
+ ColorBlendMode,
+ DepthFunction,
+ getAttributeOrUniformBySemantic,
+ HeightReference,
+ JobType,
+ ModelAnimationCache,
+ ModelAnimationCollection,
+ ModelMaterial,
+ ModelMesh,
+ ModelNode,
+ SceneMode,
+ ShadowMode,
+ StencilFunction,
+ StencilOperation) {
+ 'use strict';
+
+ // Bail out if the browser doesn't support typed arrays, to prevent the setup function
+ // from failing, since we won't be able to create a WebGL context anyway.
+ if (!FeatureDetection.supportsTypedArrays()) {
+ return {};
+ }
+
+ var boundingSphereCartesian3Scratch = new Cartesian3();
+
+ var ModelState = {
+ NEEDS_LOAD : 0,
+ LOADING : 1,
+ LOADED : 2, // Renderable, but textures can still be pending when incrementallyLoadTextures is true.
+ FAILED : 3
+ };
+
+ // glTF MIME types discussed in https://github.com/KhronosGroup/glTF/issues/412 and https://github.com/KhronosGroup/glTF/issues/943
+ var defaultModelAccept = 'model/gltf-binary,model/gltf+json;q=0.8,application/json;q=0.2,*/*;q=0.01';
+
+ function LoadResources() {
+ this.vertexBuffersToCreate = new Queue();
+ this.indexBuffersToCreate = new Queue();
+ this.buffers = {};
+ this.pendingBufferLoads = 0;
+
+ this.programsToCreate = new Queue();
+ this.shaders = {};
+ this.pendingShaderLoads = 0;
+
+ this.texturesToCreate = new Queue();
+ this.pendingTextureLoads = 0;
+
+ this.texturesToCreateFromBufferView = new Queue();
+ this.pendingBufferViewToImage = 0;
+
+ this.createSamplers = true;
+ this.createSkins = true;
+ this.createRuntimeAnimations = true;
+ this.createVertexArrays = true;
+ this.createRenderStates = true;
+ this.createUniformMaps = true;
+ this.createRuntimeNodes = true;
+
+ this.skinnedNodesIds = [];
+ }
+
+ LoadResources.prototype.getBuffer = function(bufferView) {
+ return getSubarray(this.buffers[bufferView.buffer], bufferView.byteOffset, bufferView.byteLength);
+ };
+
+ LoadResources.prototype.finishedPendingBufferLoads = function() {
+ return (this.pendingBufferLoads === 0);
+ };
+
+ LoadResources.prototype.finishedBuffersCreation = function() {
+ return ((this.pendingBufferLoads === 0) &&
+ (this.vertexBuffersToCreate.length === 0) &&
+ (this.indexBuffersToCreate.length === 0));
+ };
+
+ LoadResources.prototype.finishedProgramCreation = function() {
+ return ((this.pendingShaderLoads === 0) && (this.programsToCreate.length === 0));
+ };
+
+ LoadResources.prototype.finishedTextureCreation = function() {
+ var finishedPendingLoads = (this.pendingTextureLoads === 0);
+ var finishedResourceCreation =
+ (this.texturesToCreate.length === 0) &&
+ (this.texturesToCreateFromBufferView.length === 0);
+
+ return finishedPendingLoads && finishedResourceCreation;
+ };
+
+ LoadResources.prototype.finishedEverythingButTextureCreation = function() {
+ var finishedPendingLoads =
+ (this.pendingBufferLoads === 0) &&
+ (this.pendingShaderLoads === 0);
+ var finishedResourceCreation =
+ (this.vertexBuffersToCreate.length === 0) &&
+ (this.indexBuffersToCreate.length === 0) &&
+ (this.programsToCreate.length === 0) &&
+ (this.pendingBufferViewToImage === 0);
+
+ return finishedPendingLoads && finishedResourceCreation;
+ };
+
+ LoadResources.prototype.finished = function() {
+ return this.finishedTextureCreation() && this.finishedEverythingButTextureCreation();
+ };
+
+ ///////////////////////////////////////////////////////////////////////////
+
+ function setCachedGltf(model, cachedGltf) {
+ model._cachedGltf = cachedGltf;
+ }
+
+ // glTF JSON can be big given embedded geometry, textures, and animations, so we
+ // cache it across all models using the same url/cache-key. This also reduces the
+ // slight overhead in assigning defaults to missing values.
+ //
+ // Note that this is a global cache, compared to renderer resources, which
+ // are cached per context.
+ function CachedGltf(options) {
+ this._gltf = options.gltf;
+ this.ready = options.ready;
+ this.modelsToLoad = [];
+ this.count = 0;
+ }
+
+ defineProperties(CachedGltf.prototype, {
+ gltf : {
+ set : function(value) {
+ this._gltf = value;
+ },
+
+ get : function() {
+ return this._gltf;
+ }
+ }
+ });
+
+ CachedGltf.prototype.makeReady = function(gltfJson) {
+ this.gltf = gltfJson;
+
+ var models = this.modelsToLoad;
+ var length = models.length;
+ for (var i = 0; i < length; ++i) {
+ var m = models[i];
+ if (!m.isDestroyed()) {
+ setCachedGltf(m, this);
+ }
+ }
+ this.modelsToLoad = undefined;
+ this.ready = true;
+ };
+
+ var gltfCache = {};
+
+ ///////////////////////////////////////////////////////////////////////////
+
+ /**
+ * A 3D model based on glTF, the runtime asset format for WebGL, OpenGL ES, and OpenGL.
+ *
+ * Cesium includes support for geometry and materials, glTF animations, and glTF skinning.
+ * In addition, individual glTF nodes are pickable with {@link Scene#pick} and animatable
+ * with {@link Model#getNode}. glTF cameras and lights are not currently supported.
+ *
+ *
+ * An external glTF asset is created with {@link Model.fromGltf}. glTF JSON can also be
+ * created at runtime and passed to this constructor function. In either case, the
+ * {@link Model#readyPromise} is resolved when the model is ready to render, i.e.,
+ * when the external binary, image, and shader files are downloaded and the WebGL
+ * resources are created.
+ *
+ *
+ * For high-precision rendering, Cesium supports the CESIUM_RTC extension, which introduces the
+ * CESIUM_RTC_MODELVIEW parameter semantic that says the node is in WGS84 coordinates translated
+ * relative to a local origin.
+ *
+ *
+ * @alias Model
+ * @constructor
+ *
+ * @param {Object} [options] Object with the following properties:
+ * @param {Object|ArrayBuffer|Uint8Array} [options.gltf] The object for the glTF JSON or an arraybuffer of Binary glTF defined by the KHR_binary_glTF extension.
+ * @param {String} [options.basePath=''] The base path that paths in the glTF JSON are relative to.
+ * @param {Boolean} [options.show=true] Determines if the model primitive will be shown.
+ * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms the model from model to world coordinates.
+ * @param {Number} [options.scale=1.0] A uniform scale applied to this model.
+ * @param {Number} [options.minimumPixelSize=0.0] The approximate minimum pixel size of the model regardless of zoom.
+ * @param {Number} [options.maximumScale] The maximum scale size of a model. An upper limit for minimumPixelSize.
+ * @param {Object} [options.id] A user-defined object to return when the model is picked with {@link Scene#pick}.
+ * @param {Boolean} [options.allowPicking=true] When true
, each glTF mesh and primitive is pickable with {@link Scene#pick}.
+ * @param {Boolean} [options.incrementallyLoadTextures=true] Determine if textures may continue to stream in after the model is loaded.
+ * @param {Boolean} [options.asynchronous=true] Determines if model WebGL resource creation will be spread out over several frames or block until completion once all glTF files are loaded.
+ * @param {Boolean} [options.clampAnimations=true] Determines if the model's animations should hold a pose over frames where no keyframes are specified.
+ * @param {ShadowMode} [options.shadows=ShadowMode.ENABLED] Determines whether the model casts or receives shadows from each light source.
+ * @param {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Draws the bounding sphere for each draw command in the model.
+ * @param {Boolean} [options.debugWireframe=false] For debugging only. Draws the model in wireframe.
+ * @param {HeightReference} [options.heightReference] Determines how the model is drawn relative to terrain.
+ * @param {Scene} [options.scene] Must be passed in for models that use the height reference property.
+ * @param {DistanceDisplayCondition} [options.distanceDisplayCondition] The condition specifying at what distance from the camera that this model will be displayed.
+ * @param {Color} [options.color=Color.WHITE] A color that blends with the model's rendered color.
+ * @param {ColorBlendMode} [options.colorBlendMode=ColorBlendMode.HIGHLIGHT] Defines how the color blends with the model.
+ * @param {Number} [options.colorBlendAmount=0.5] Value used to determine the color strength when the colorBlendMode
is MIX
. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two.
+ * @param {Color} [options.silhouetteColor=Color.RED] The silhouette color. If more than 256 models have silhouettes enabled, there is a small chance that overlapping models will have minor artifacts.
+ * @param {Number} [options.silhouetteSize=0.0] The size of the silhouette in pixels.
+ *
+ * @exception {DeveloperError} bgltf is not a valid Binary glTF file.
+ * @exception {DeveloperError} Only glTF Binary version 1 is supported.
+ *
+ * @see Model.fromGltf
+ *
+ * @demo {@link http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=3D%20Models.html|Cesium Sandcastle Models Demo}
+ */
+ function Model(options) {
+ options = defaultValue(options, defaultValue.EMPTY_OBJECT);
+
+ var cacheKey = options.cacheKey;
+ this._cacheKey = cacheKey;
+ this._cachedGltf = undefined;
+ this._releaseGltfJson = defaultValue(options.releaseGltfJson, false);
+
+ var cachedGltf;
+ if (defined(cacheKey) && defined(gltfCache[cacheKey]) && gltfCache[cacheKey].ready) {
+ // glTF JSON is in cache and ready
+ cachedGltf = gltfCache[cacheKey];
+ ++cachedGltf.count;
+ } else {
+ // glTF was explicitly provided, e.g., when a user uses the Model constructor directly
+ var gltf = options.gltf;
+
+ if (defined(gltf)) {
+ if (gltf instanceof ArrayBuffer) {
+ gltf = new Uint8Array(gltf);
+ }
+
+ if (gltf instanceof Uint8Array) {
+ // Binary glTF
+ var parsedGltf = parseBinaryGltf(gltf);
+
+ cachedGltf = new CachedGltf({
+ gltf : parsedGltf,
+ ready : true
+ });
+ } else {
+ // Normal glTF (JSON)
+ cachedGltf = new CachedGltf({
+ gltf : options.gltf,
+ ready : true
+ });
+ }
+
+ cachedGltf.count = 1;
+
+ if (defined(cacheKey)) {
+ gltfCache[cacheKey] = cachedGltf;
+ }
+ }
+ }
+ setCachedGltf(this, cachedGltf);
+
+ this._basePath = defaultValue(options.basePath, '');
+ var baseUri = getBaseUri(document.location.href);
+ this._baseUri = joinUrls(baseUri, this._basePath);
+
+ /**
+ * Determines if the model primitive will be shown.
+ *
+ * @type {Boolean}
+ *
+ * @default true
+ */
+ this.show = defaultValue(options.show, true);
+
+ this.classificationType = options.classificationType;
+ this._classificationType = undefined;
+
+ /**
+ * The 4x4 transformation matrix that transforms the model from model to world coordinates.
+ * When this is the identity matrix, the model is drawn in world coordinates, i.e., Earth's WGS84 coordinates.
+ * Local reference frames can be used by providing a different transformation matrix, like that returned
+ * by {@link Transforms.eastNorthUpToFixedFrame}.
+ *
+ * @type {Matrix4}
+ *
+ * @default {@link Matrix4.IDENTITY}
+ *
+ * @example
+ * var origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0);
+ * m.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);
+ */
+ this.modelMatrix = Matrix4.clone(defaultValue(options.modelMatrix, Matrix4.IDENTITY));
+ this._modelMatrix = Matrix4.clone(this.modelMatrix);
+ this._clampedModelMatrix = undefined;
+
+ /**
+ * A uniform scale applied to this model before the {@link Model#modelMatrix}.
+ * Values greater than 1.0
increase the size of the model; values
+ * less than 1.0
decrease.
+ *
+ * @type {Number}
+ *
+ * @default 1.0
+ */
+ this.scale = defaultValue(options.scale, 1.0);
+ this._scale = this.scale;
+
+ /**
+ * The approximate minimum pixel size of the model regardless of zoom.
+ * This can be used to ensure that a model is visible even when the viewer
+ * zooms out. When 0.0
, no minimum size is enforced.
+ *
+ * @type {Number}
+ *
+ * @default 0.0
+ */
+ this.minimumPixelSize = defaultValue(options.minimumPixelSize, 0.0);
+ this._minimumPixelSize = this.minimumPixelSize;
+
+ /**
+ * The maximum scale size for a model. This can be used to give
+ * an upper limit to the {@link Model#minimumPixelSize}, ensuring that the model
+ * is never an unreasonable scale.
+ *
+ * @type {Number}
+ */
+ this.maximumScale = options.maximumScale;
+ this._maximumScale = this.maximumScale;
+
+ /**
+ * User-defined object returned when the model is picked.
+ *
+ * @type Object
+ *
+ * @default undefined
+ *
+ * @see Scene#pick
+ */
+ this.id = options.id;
+ this._id = options.id;
+
+ /**
+ * Returns the height reference of the model
+ *
+ * @memberof Model.prototype
+ *
+ * @type {HeightReference}
+ *
+ * @default HeightReference.NONE
+ */
+ this.heightReference = defaultValue(options.heightReference, HeightReference.NONE);
+ this._heightReference = this.heightReference;
+ this._heightChanged = false;
+ this._removeUpdateHeightCallback = undefined;
+ var scene = options.scene;
+ this._scene = scene;
+ if (defined(scene) && defined(scene.terrainProviderChanged)) {
+ this._terrainProviderChangedCallback = scene.terrainProviderChanged.addEventListener(function() {
+ this._heightChanged = true;
+ }, this);
+ }
+
+ /**
+ * Used for picking primitives that wrap a model.
+ *
+ * @private
+ */
+ this._pickObject = options.pickObject;
+ this._allowPicking = defaultValue(options.allowPicking, true);
+
+ this._ready = false;
+ this._readyPromise = when.defer();
+
+ this._defaultTexture = undefined;
+ this._incrementallyLoadTextures = defaultValue(options.incrementallyLoadTextures, true);
+ this._asynchronous = defaultValue(options.asynchronous, true);
+
+ /**
+ * A color that blends with the model's rendered color.
+ *
+ * @type {Color}
+ *
+ * @default Color.WHITE
+ */
+ this.color = defaultValue(options.color, Color.WHITE);
+ this._color = new Color();
+ this._colorPreviousAlpha = 1.0;
+
+ /**
+ * Defines how the color blends with the model.
+ *
+ * @type {ColorBlendMode}
+ *
+ * @default ColorBlendMode.HIGHLIGHT
+ */
+ this.colorBlendMode = defaultValue(options.colorBlendMode, ColorBlendMode.HIGHLIGHT);
+
+ /**
+ * Value used to determine the color strength when the colorBlendMode
is MIX
.
+ * A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with
+ * any value in-between resulting in a mix of the two.
+ *
+ * @type {Number}
+ *
+ * @default 0.5
+ */
+ this.colorBlendAmount = defaultValue(options.colorBlendAmount, 0.5);
+
+ /**
+ * This property is for debugging only; it is not for production use nor is it optimized.
+ *
+ * Draws the bounding sphere for each draw command in the model. A glTF primitive corresponds
+ * to one draw command. A glTF mesh has an array of primitives, often of length one.
+ *
+ *
+ * @type {Boolean}
+ *
+ * @default false
+ */
+ this.debugShowBoundingVolume = defaultValue(options.debugShowBoundingVolume, false);
+ this._debugShowBoundingVolume = false;
+
+ /**
+ * This property is for debugging only; it is not for production use nor is it optimized.
+ *
+ * Draws the model in wireframe.
+ *
+ *
+ * @type {Boolean}
+ *
+ * @default false
+ */
+ this.debugWireframe = defaultValue(options.debugWireframe, false);
+ this._debugWireframe = false;
+
+ this._distanceDisplayCondition = options.distanceDisplayCondition;
+
+ // Undocumented options
+ this._addBatchIdToGeneratedShaders = options.addBatchIdToGeneratedShaders;
+ this._precreatedAttributes = options.precreatedAttributes;
+ this._vertexShaderLoaded = options.vertexShaderLoaded;
+ this._fragmentShaderLoaded = options.fragmentShaderLoaded;
+ this._classificationShaderLoaded = options.classificationShaderLoaded;
+ this._uniformMapLoaded = options.uniformMapLoaded;
+ this._pickVertexShaderLoaded = options.pickVertexShaderLoaded;
+ this._pickFragmentShaderLoaded = options.pickFragmentShaderLoaded;
+ this._pickUniformMapLoaded = options.pickUniformMapLoaded;
+ this._ignoreCommands = defaultValue(options.ignoreCommands, false);
+ this._requestType = options.requestType;
+ this._upAxis = defaultValue(options.upAxis, Axis.Y);
+
+ /**
+ * @private
+ * @readonly
+ */
+ this.cull = defaultValue(options.cull, true);
+
+ /**
+ * @private
+ * @readonly
+ */
+ this.opaquePass = defaultValue(options.opaquePass, Pass.OPAQUE);
+
+ this._computedModelMatrix = new Matrix4(); // Derived from modelMatrix and scale
+ this._initialRadius = undefined; // Radius without model's scale property, model-matrix scale, animations, or skins
+ this._boundingSphere = undefined;
+ this._scaledBoundingSphere = new BoundingSphere();
+ this._state = ModelState.NEEDS_LOAD;
+ this._loadResources = undefined;
+
+ this._mode = undefined;
+
+ this._perNodeShowDirty = false; // true when the Cesium API was used to change a node's show property
+ this._dirty = false; // true when the model was transformed this frame
+ this._maxDirtyNumber = 0; // Used in place of a dirty boolean flag to avoid an extra graph traversal
+
+ this._runtime = {
+ rootNodes : undefined,
+ nodes : undefined, // Indexed with the node property's name, i.e., glTF id
+ nodesByName : undefined, // Indexed with name property in the node
+ meshesByName : undefined, // Indexed with the name property in the mesh
+ materialsByName : undefined, // Indexed with the name property in the material
+ materialsById : undefined // Indexed with the material's property name
+ };
+
+ this._uniformMaps = {}; // Not cached since it can be targeted by glTF animation
+ this._extensionsUsed = undefined; // Cached used glTF extensions
+ this._extensionsRequired = undefined; // Cached required glTF extensions
+ this._quantizedUniforms = {}; // Quantized uniforms for each program for WEB3D_quantized_attributes
+ this._programPrimitives = {};
+ this._rendererResources = { // Cached between models with the same url/cache-key
+ buffers : {},
+ vertexArrays : {},
+ programs : {},
+ pickPrograms : {},
+ classificationPrograms : {}
+ };
+ this._cachedRendererResources = undefined;
+ this._loadRendererResourcesFromCache = false;
+ this._updatedGltfVersion = false;
+
+ this._geometryByteLength = 0;
+ this._trianglesLength = 0;
+
+ this._nodeCommands = [];
+ this._pickIds = [];
+
+ // CESIUM_RTC extension
+ this._rtcCenter = undefined; // reference to either 3D or 2D
+ this._rtcCenterEye = undefined; // in eye coordinates
+ this._rtcCenter3D = undefined; // in world coordinates
+ this._rtcCenter2D = undefined; // in projected world coordinates
+ }
+
+ defineProperties(Model.prototype, {
+ /**
+ * The object for the glTF JSON, including properties with default values omitted
+ * from the JSON provided to this model.
+ *
+ * @memberof Model.prototype
+ *
+ * @type {Object}
+ * @readonly
+ *
+ * @default undefined
+ */
+ gltf : {
+ get : function() {
+ return defined(this._cachedGltf) ? this._cachedGltf.gltf : undefined;
+ }
+ },
+
+ /**
+ * When true
, the glTF JSON is not stored with the model once the model is
+ * loaded (when {@link Model#ready} is true
). This saves memory when
+ * geometry, textures, and animations are embedded in the .gltf file, which is the
+ * default for the {@link http://cesiumjs.org/convertmodel.html|Cesium model converter}.
+ * This is especially useful for cases like 3D buildings, where each .gltf model is unique
+ * and caching the glTF JSON is not effective.
+ *
+ * @memberof Model.prototype
+ *
+ * @type {Boolean}
+ * @readonly
+ *
+ * @default false
+ *
+ * @private
+ */
+ releaseGltfJson : {
+ get : function() {
+ return this._releaseGltfJson;
+ }
+ },
+
+ /**
+ * The key identifying this model in the model cache for glTF JSON, renderer resources, and animations.
+ * Caching saves memory and improves loading speed when several models with the same url are created.
+ *
+ * This key is automatically generated when the model is created with {@link Model.fromGltf}. If the model
+ * is created directly from glTF JSON using the {@link Model} constructor, this key can be manually
+ * provided; otherwise, the model will not be changed.
+ *
+ *
+ * @memberof Model.prototype
+ *
+ * @type {String}
+ * @readonly
+ *
+ * @private
+ */
+ cacheKey : {
+ get : function() {
+ return this._cacheKey;
+ }
+ },
+
+ /**
+ * The base path that paths in the glTF JSON are relative to. The base
+ * path is the same path as the path containing the .gltf file
+ * minus the .gltf file, when binary, image, and shader files are
+ * in the same directory as the .gltf. When this is ''
,
+ * the app's base path is used.
+ *
+ * @memberof Model.prototype
+ *
+ * @type {String}
+ * @readonly
+ *
+ * @default ''
+ */
+ basePath : {
+ get : function() {
+ return this._basePath;
+ }
+ },
+
+ /**
+ * The model's bounding sphere in its local coordinate system. This does not take into
+ * account glTF animations and skins nor does it take into account {@link Model#minimumPixelSize}.
+ *
+ * @memberof Model.prototype
+ *
+ * @type {BoundingSphere}
+ * @readonly
+ *
+ * @default undefined
+ *
+ * @exception {DeveloperError} The model is not loaded. Use Model.readyPromise or wait for Model.ready to be true.
+ *
+ * @example
+ * // Center in WGS84 coordinates
+ * var center = Cesium.Matrix4.multiplyByPoint(model.modelMatrix, model.boundingSphere.center, new Cesium.Cartesian3());
+ */
+ boundingSphere : {
+ get : function() {
+ //>>includeStart('debug', pragmas.debug);
+ if (this._state !== ModelState.LOADED) {
+ throw new DeveloperError('The model is not loaded. Use Model.readyPromise or wait for Model.ready to be true.');
+ }
+ //>>includeEnd('debug');
+
+ var modelMatrix = this.modelMatrix;
+ if ((this.heightReference !== HeightReference.NONE) && this._clampedModelMatrix) {
+ modelMatrix = this._clampedModelMatrix;
+ }
+
+ var nonUniformScale = Matrix4.getScale(modelMatrix, boundingSphereCartesian3Scratch);
+ var scale = defined(this.maximumScale) ? Math.min(this.maximumScale, this.scale) : this.scale;
+ Cartesian3.multiplyByScalar(nonUniformScale, scale, nonUniformScale);
+
+ var scaledBoundingSphere = this._scaledBoundingSphere;
+ scaledBoundingSphere.center = Cartesian3.multiplyComponents(this._boundingSphere.center, nonUniformScale, scaledBoundingSphere.center);
+ scaledBoundingSphere.radius = Cartesian3.maximumComponent(nonUniformScale) * this._initialRadius;
+
+ if (defined(this._rtcCenter)) {
+ Cartesian3.add(this._rtcCenter, scaledBoundingSphere.center, scaledBoundingSphere.center);
+ }
+
+ return scaledBoundingSphere;
+ }
+ },
+
+ /**
+ * When true
, this model is ready to render, i.e., the external binary, image,
+ * and shader files were downloaded and the WebGL resources were created. This is set to
+ * true
right before {@link Model#readyPromise} is resolved.
+ *
+ * @memberof Model.prototype
+ *
+ * @type {Boolean}
+ * @readonly
+ *
+ * @default false
+ */
+ ready : {
+ get : function() {
+ return this._ready;
+ }
+ },
+
+ /**
+ * Gets the promise that will be resolved when this model is ready to render, i.e., when the external binary, image,
+ * and shader files were downloaded and the WebGL resources were created.
+ *
+ * This promise is resolved at the end of the frame before the first frame the model is rendered in.
+ *
+ *
+ * @memberof Model.prototype
+ * @type {Promise.}
+ * @readonly
+ *
+ * @example
+ * // Play all animations at half-speed when the model is ready to render
+ * Cesium.when(model.readyPromise).then(function(model) {
+ * model.activeAnimations.addAll({
+ * speedup : 0.5
+ * });
+ * }).otherwise(function(error){
+ * window.alert(error);
+ * });
+ *
+ * @see Model#ready
+ */
+ readyPromise : {
+ get : function() {
+ return this._readyPromise.promise;
+ }
+ },
+
+ /**
+ * Determines if model WebGL resource creation will be spread out over several frames or
+ * block until completion once all glTF files are loaded.
+ *
+ * @memberof Model.prototype
+ *
+ * @type {Boolean}
+ * @readonly
+ *
+ * @default true
+ */
+ asynchronous : {
+ get : function() {
+ return this._asynchronous;
+ }
+ },
+
+ /**
+ * When true
, each glTF mesh and primitive is pickable with {@link Scene#pick}. When false
, GPU memory is saved.
+ *
+ * @memberof Model.prototype
+ *
+ * @type {Boolean}
+ * @readonly
+ *
+ * @default true
+ */
+ allowPicking : {
+ get : function() {
+ return this._allowPicking;
+ }
+ },
+
+ /**
+ * Determine if textures may continue to stream in after the model is loaded.
+ *
+ * @memberof Model.prototype
+ *
+ * @type {Boolean}
+ * @readonly
+ *
+ * @default true
+ */
+ incrementallyLoadTextures : {
+ get : function() {
+ return this._incrementallyLoadTextures;
+ }
+ },
+
+ /**
+ * Return the number of pending texture loads.
+ *
+ * @memberof Model.prototype
+ *
+ * @type {Number}
+ * @readonly
+ */
+ pendingTextureLoads : {
+ get : function() {
+ return defined(this._loadResources) ? this._loadResources.pendingTextureLoads : 0;
+ }
+ },
+
+ /**
+ * Returns true if the model was transformed this frame
+ *
+ * @memberof Model.prototype
+ *
+ * @type {Boolean}
+ * @readonly
+ *
+ * @private
+ */
+ dirty : {
+ get : function() {
+ return this._dirty;
+ }
+ },
+
+ /**
+ * Gets or sets the condition specifying at what distance from the camera that this model will be displayed.
+ * @memberof Model.prototype
+ * @type {DistanceDisplayCondition}
+ * @default undefined
+ */
+ distanceDisplayCondition : {
+ get : function() {
+ return this._distanceDisplayCondition;
+ },
+ set : function(value) {
+ //>>includeStart('debug', pragmas.debug);
+ if (defined(value) && value.far <= value.near) {
+ throw new DeveloperError('far must be greater than near');
+ }
+ //>>includeEnd('debug');
+ this._distanceDisplayCondition = DistanceDisplayCondition.clone(value, this._distanceDisplayCondition);
+ }
+ },
+
+ extensionsUsed : {
+ get : function() {
+ if (!defined(this._extensionsUsed)) {
+ this._extensionsUsed = getUsedExtensions(this);
+ }
+ return this._extensionsUsed;
+ }
+ },
+
+ extensionsRequired : {
+ get : function() {
+ if (!defined(this._extensionsRequired)) {
+ this._extensionsRequired = getRequiredExtensions(this);
+ }
+ return this._extensionsRequired;
+ }
+ },
+
+ /**
+ * Gets the model's up-axis.
+ * By default models are y-up according to the glTF spec, however geo-referenced models will typically be z-up.
+ *
+ * @memberof Model.prototype
+ *
+ * @type {Number}
+ * @default Axis.Y
+ * @readonly
+ *
+ * @private
+ */
+ upAxis : {
+ get : function() {
+ return this._upAxis;
+ }
+ },
+
+ /**
+ * Gets the model's triangle count.
+ *
+ * @private
+ */
+ trianglesLength : {
+ get : function() {
+ return this._trianglesLength;
+ }
+ },
+
+ /**
+ * Gets the model's geometry memory in bytes. This includes all vertex and index buffers.
+ *
+ * @private
+ */
+ geometryByteLength : {
+ get : function() {
+ return this._geometryByteLength;
+ }
+ },
+
+ /**
+ * Gets the model's texture memory in bytes.
+ *
+ * @private
+ */
+ texturesByteLength : {
+ get : function() {
+ return this._texturesByteLength;
+ }
+ },
+
+ /**
+ * Gets the model's cached geometry memory in bytes. This includes all vertex and index buffers.
+ *
+ * @private
+ */
+ cachedGeometryByteLength : {
+ get : function() {
+ return this._cachedGeometryByteLength;
+ }
+ },
+
+ /**
+ * Gets the model's cached texture memory in bytes.
+ *
+ * @private
+ */
+ cachedTexturesByteLength : {
+ get : function() {
+ return this._cachedTexturesByteLength;
+ }
+ }
+ });
+
+ /**
+ * This function differs from the normal subarray function
+ * because it takes offset and length, rather than begin and end.
+ */
+ function getSubarray(array, offset, length) {
+ return array.subarray(offset, offset + length);
+ }
+
+ function containsGltfMagic(uint8Array) {
+ var magic = getMagic(uint8Array);
+ return magic === 'glTF';
+ }
+
+ /**
+ *
+ * Creates a model from a glTF asset. When the model is ready to render, i.e., when the external binary, image,
+ * and shader files are downloaded and the WebGL resources are created, the {@link Model#readyPromise} is resolved.
+ *
+ *
+ * The model can be a traditional glTF asset with a .gltf extension or a Binary glTF using the
+ * KHR_binary_glTF extension with a .glb extension.
+ *
+ *
+ * For high-precision rendering, Cesium supports the CESIUM_RTC extension, which introduces the
+ * CESIUM_RTC_MODELVIEW parameter semantic that says the node is in WGS84 coordinates translated
+ * relative to a local origin.
+ *
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {String} options.url The url to the .gltf file.
+ * @param {Object} [options.headers] HTTP headers to send with the request.
+ * @param {String} [options.basePath] The base path that paths in the glTF JSON are relative to.
+ * @param {Boolean} [options.show=true] Determines if the model primitive will be shown.
+ * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms the model from model to world coordinates.
+ * @param {Number} [options.scale=1.0] A uniform scale applied to this model.
+ * @param {Number} [options.minimumPixelSize=0.0] The approximate minimum pixel size of the model regardless of zoom.
+ * @param {Number} [options.maximumScale] The maximum scale for the model.
+ * @param {Object} [options.id] A user-defined object to return when the model is picked with {@link Scene#pick}.
+ * @param {Boolean} [options.allowPicking=true] When true
, each glTF mesh and primitive is pickable with {@link Scene#pick}.
+ * @param {Boolean} [options.incrementallyLoadTextures=true] Determine if textures may continue to stream in after the model is loaded.
+ * @param {Boolean} [options.asynchronous=true] Determines if model WebGL resource creation will be spread out over several frames or block until completion once all glTF files are loaded.
+ * @param {Boolean} [options.clampAnimations=true] Determines if the model's animations should hold a pose over frames where no keyframes are specified.
+ * @param {ShadowMode} [options.shadows=ShadowMode.ENABLED] Determines whether the model casts or receives shadows from each light source.
+ * @param {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Draws the bounding sphere for each {@link DrawCommand} in the model.
+ * @param {Boolean} [options.debugWireframe=false] For debugging only. Draws the model in wireframe.
+ *
+ * @returns {Model} The newly created model.
+ *
+ * @exception {DeveloperError} bgltf is not a valid Binary glTF file.
+ * @exception {DeveloperError} Only glTF Binary version 1 is supported.
+ *
+ * @example
+ * // Example 1. Create a model from a glTF asset
+ * var model = scene.primitives.add(Cesium.Model.fromGltf({
+ * url : './duck/duck.gltf'
+ * }));
+ *
+ * @example
+ * // Example 2. Create model and provide all properties and events
+ * var origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0);
+ * var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);
+ *
+ * var model = scene.primitives.add(Cesium.Model.fromGltf({
+ * url : './duck/duck.gltf',
+ * show : true, // default
+ * modelMatrix : modelMatrix,
+ * scale : 2.0, // double size
+ * minimumPixelSize : 128, // never smaller than 128 pixels
+ * maximumScale: 20000, // never larger than 20000 * model size (overrides minimumPixelSize)
+ * allowPicking : false, // not pickable
+ * debugShowBoundingVolume : false, // default
+ * debugWireframe : false
+ * }));
+ *
+ * model.readyPromise.then(function(model) {
+ * // Play all animations when the model is ready to render
+ * model.activeAnimations.addAll();
+ * });
+ */
+ Model.fromGltf = function(options) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defined(options) || !defined(options.url)) {
+ throw new DeveloperError('options.url is required');
+ }
+ //>>includeEnd('debug');
+
+ var url = options.url;
+ // If no cache key is provided, use the absolute URL, since two URLs with
+ // different relative paths could point to the same model.
+ var cacheKey = defaultValue(options.cacheKey, getAbsoluteUri(url));
+ var basePath = defaultValue(options.basePath, getBaseUri(url, true));
+
+ options = clone(options);
+ if (defined(options.basePath) && !defined(options.cacheKey)) {
+ cacheKey += basePath;
+ }
+
+ options.cacheKey = cacheKey;
+ options.basePath = basePath;
+ var model = new Model(options);
+
+ options.headers = defined(options.headers) ? clone(options.headers) : {};
+ if (!defined(options.headers.Accept)) {
+ options.headers.Accept = defaultModelAccept;
+ }
+
+ var cachedGltf = gltfCache[cacheKey];
+ if (!defined(cachedGltf)) {
+ cachedGltf = new CachedGltf({
+ ready : false
+ });
+ cachedGltf.count = 1;
+ cachedGltf.modelsToLoad.push(model);
+ setCachedGltf(model, cachedGltf);
+ gltfCache[cacheKey] = cachedGltf;
+
+ loadArrayBuffer(url, options.headers).then(function(arrayBuffer) {
+ var array = new Uint8Array(arrayBuffer);
+ if (containsGltfMagic(array)) {
+ // Load binary glTF
+ var parsedGltf = parseBinaryGltf(array);
+ // KHR_binary_glTF is from the beginning of the binary section
+ cachedGltf.makeReady(parsedGltf, array);
+ } else {
+ // Load text (JSON) glTF
+ var json = getStringFromTypedArray(array);
+ cachedGltf.makeReady(JSON.parse(json));
+ }
+ }).otherwise(getFailedLoadFunction(model, 'model', url));
+ } else if (!cachedGltf.ready) {
+ // Cache hit but the loadArrayBuffer() or loadText() request is still pending
+ ++cachedGltf.count;
+ cachedGltf.modelsToLoad.push(model);
+ }
+ // else if the cached glTF is defined and ready, the
+ // model constructor will pick it up using the cache key.
+
+ return model;
+ };
+
+ /**
+ * For the unit tests to verify model caching.
+ *
+ * @private
+ */
+ Model._gltfCache = gltfCache;
+
+ function getRuntime(model, runtimeName, name) {
+ //>>includeStart('debug', pragmas.debug);
+ if (model._state !== ModelState.LOADED) {
+ throw new DeveloperError('The model is not loaded. Use Model.readyPromise or wait for Model.ready to be true.');
+ }
+
+ if (!defined(name)) {
+ throw new DeveloperError('name is required.');
+ }
+ //>>includeEnd('debug');
+
+ return (model._runtime[runtimeName])[name];
+ }
+
+ /**
+ * Returns the glTF node with the given name
property. This is used to
+ * modify a node's transform for animation outside of glTF animations.
+ *
+ * @param {String} name The glTF name of the node.
+ * @returns {ModelNode} The node or undefined
if no node with name
exists.
+ *
+ * @exception {DeveloperError} The model is not loaded. Use Model.readyPromise or wait for Model.ready to be true.
+ *
+ * @example
+ * // Apply non-uniform scale to node LOD3sp
+ * var node = model.getNode('LOD3sp');
+ * node.matrix = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(5.0, 1.0, 1.0), node.matrix);
+ */
+ Model.prototype.getNode = function(name) {
+ var node = getRuntime(this, 'nodesByName', name);
+ return defined(node) ? node.publicNode : undefined;
+ };
+
+ /**
+ * Returns the glTF mesh with the given name
property.
+ *
+ * @param {String} name The glTF name of the mesh.
+ *
+ * @returns {ModelMesh} The mesh or undefined
if no mesh with name
exists.
+ *
+ * @exception {DeveloperError} The model is not loaded. Use Model.readyPromise or wait for Model.ready to be true.
+ */
+ Model.prototype.getMesh = function(name) {
+ return getRuntime(this, 'meshesByName', name);
+ };
+
+ /**
+ * Returns the glTF material with the given name
property.
+ *
+ * @param {String} name The glTF name of the material.
+ * @returns {ModelMaterial} The material or undefined
if no material with name
exists.
+ *
+ * @exception {DeveloperError} The model is not loaded. Use Model.readyPromise or wait for Model.ready to be true.
+ */
+ Model.prototype.getMaterial = function(name) {
+ return getRuntime(this, 'materialsByName', name);
+ };
+
+ var aMinScratch = new Cartesian3();
+ var aMaxScratch = new Cartesian3();
+
+ function getAccessorMinMax(gltf, accessorId) {
+ var accessor = gltf.accessors[accessorId];
+ var extensions = accessor.extensions;
+ var accessorMin = accessor.min;
+ var accessorMax = accessor.max;
+ // If this accessor is quantized, we should use the decoded min and max
+ if (defined(extensions)) {
+ var quantizedAttributes = extensions.WEB3D_quantized_attributes;
+ if (defined(quantizedAttributes)) {
+ accessorMin = quantizedAttributes.decodedMin;
+ accessorMax = quantizedAttributes.decodedMax;
+ }
+ }
+ return {
+ min : accessorMin,
+ max : accessorMax
+ };
+ }
+
+ function computeBoundingSphere(model) {
+ var gltf = model.gltf;
+ var gltfNodes = gltf.nodes;
+ var gltfMeshes = gltf.meshes;
+ var rootNodes = gltf.scenes[gltf.scene].nodes;
+ var rootNodesLength = rootNodes.length;
+
+ var nodeStack = [];
+
+ var min = new Cartesian3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
+ var max = new Cartesian3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
+
+ for (var i = 0; i < rootNodesLength; ++i) {
+ var n = gltfNodes[rootNodes[i]];
+ n._transformToRoot = getTransform(n);
+ nodeStack.push(n);
+
+ while (nodeStack.length > 0) {
+ n = nodeStack.pop();
+ var transformToRoot = n._transformToRoot;
+
+ var meshId = n.mesh;
+ if (defined(meshId)) {
+ var mesh = gltfMeshes[meshId];
+ var primitives = mesh.primitives;
+ var primitivesLength = primitives.length;
+ for (var m = 0; m < primitivesLength; ++m) {
+ var positionAccessor = primitives[m].attributes.POSITION;
+ if (defined(positionAccessor)) {
+ var minMax = getAccessorMinMax(gltf, positionAccessor);
+ var aMin = Cartesian3.fromArray(minMax.min, 0, aMinScratch);
+ var aMax = Cartesian3.fromArray(minMax.max, 0, aMaxScratch);
+ if (defined(min) && defined(max)) {
+ Matrix4.multiplyByPoint(transformToRoot, aMin, aMin);
+ Matrix4.multiplyByPoint(transformToRoot, aMax, aMax);
+ Cartesian3.minimumByComponent(min, aMin, min);
+ Cartesian3.maximumByComponent(max, aMax, max);
+ }
+ }
+ }
+ }
+
+ var children = n.children;
+ var childrenLength = children.length;
+ for (var k = 0; k < childrenLength; ++k) {
+ var child = gltfNodes[children[k]];
+ child._transformToRoot = getTransform(child);
+ Matrix4.multiplyTransformation(transformToRoot, child._transformToRoot, child._transformToRoot);
+ nodeStack.push(child);
+ }
+ delete n._transformToRoot;
+ }
+ }
+
+ var boundingSphere = BoundingSphere.fromCornerPoints(min, max);
+ if (model._upAxis === Axis.Y) {
+ BoundingSphere.transformWithoutScale(boundingSphere, Axis.Y_UP_TO_Z_UP, boundingSphere);
+ } else if (model._upAxis === Axis.X) {
+ BoundingSphere.transformWithoutScale(boundingSphere, Axis.X_UP_TO_Z_UP, boundingSphere);
+ }
+ return boundingSphere;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+
+ function getFailedLoadFunction(model, type, path) {
+ return function() {
+ model._state = ModelState.FAILED;
+ model._readyPromise.reject(new RuntimeError('Failed to load ' + type + ': ' + path));
+ };
+ }
+
+ function addBuffersToLoadResources(model) {
+ var gltf = model.gltf;
+ var loadResources = model._loadResources;
+ ForEach.buffer(gltf, function(buffer, id) {
+ loadResources.buffers[id] = buffer.extras._pipeline.source;
+ });
+ }
+
+ function bufferLoad(model, id) {
+ return function(arrayBuffer) {
+ var loadResources = model._loadResources;
+ var buffer = new Uint8Array(arrayBuffer);
+ --loadResources.pendingBufferLoads;
+ model.gltf.buffers[id].extras._pipeline.source = buffer;
+ };
+ }
+
+ function parseBuffers(model) {
+ var loadResources = model._loadResources;
+ // Iterate this way for compatibility with objects and arrays
+ var buffers = model.gltf.buffers;
+ for (var id in buffers) {
+ if (buffers.hasOwnProperty(id)) {
+ var buffer = buffers[id];
+ buffer.extras = defaultValue(buffer.extras, {});
+ buffer.extras._pipeline = defaultValue(buffer.extras._pipeline, {});
+ if (defined(buffer.extras._pipeline.source)) {
+ loadResources.buffers[id] = buffer.extras._pipeline.source;
+ } else {
+ var bufferPath = joinUrls(model._baseUri, buffer.uri);
+ ++loadResources.pendingBufferLoads;
+ loadArrayBuffer(bufferPath).then(bufferLoad(model, id)).otherwise(getFailedLoadFunction(model, 'buffer', bufferPath));
+ }
+ }
+ }
+ }
+
+ function parseBufferViews(model) {
+ var bufferViews = model.gltf.bufferViews;
+
+ var vertexBuffersToCreate = model._loadResources.vertexBuffersToCreate;
+
+ // Only ARRAY_BUFFER here. ELEMENT_ARRAY_BUFFER created below.
+ ForEach.bufferView(model.gltf, function(bufferView, id) {
+ if (bufferView.target === WebGLConstants.ARRAY_BUFFER) {
+ vertexBuffersToCreate.enqueue(id);
+ }
+ });
+
+ var indexBuffersToCreate = model._loadResources.indexBuffersToCreate;
+ var indexBufferIds = {};
+
+ // The Cesium Renderer requires knowing the datatype for an index buffer
+ // at creation type, which is not part of the glTF bufferview so loop
+ // through glTF accessors to create the bufferview's index buffer.
+ ForEach.accessor(model.gltf, function(accessor) {
+ var bufferViewId = accessor.bufferView;
+ var bufferView = bufferViews[bufferViewId];
+
+ if ((bufferView.target === WebGLConstants.ELEMENT_ARRAY_BUFFER) && !defined(indexBufferIds[bufferViewId])) {
+ indexBufferIds[bufferViewId] = true;
+ indexBuffersToCreate.enqueue({
+ id : bufferViewId,
+ componentType : accessor.componentType
+ });
+ }
+ });
+ }
+
+ function shaderLoad(model, type, id) {
+ return function(source) {
+ var loadResources = model._loadResources;
+ loadResources.shaders[id] = {
+ source : source,
+ type : type,
+ bufferView : undefined
+ };
+ --loadResources.pendingShaderLoads;
+ model.gltf.shaders[id].extras._pipeline.source = source;
+ };
+ }
+
+ function parseShaders(model) {
+ var gltf = model.gltf;
+ var buffers = gltf.buffers;
+ var bufferViews = gltf.bufferViews;
+ ForEach.shader(gltf, function(shader, id) {
+ // Shader references either uri (external or base64-encoded) or bufferView
+ if (defined(shader.bufferView)) {
+ var bufferViewId = shader.bufferView;
+ var bufferView = bufferViews[bufferViewId];
+ var bufferId = bufferView.buffer;
+ var buffer = buffers[bufferId];
+ var source = getStringFromTypedArray(buffer.extras._pipeline.source, bufferView.byteOffset, bufferView.byteLength);
+ model._loadResources.shaders[id] = {
+ source : source,
+ bufferView : undefined
+ };
+ shader.extras._pipeline.source = source;
+ } else if (defined(shader.extras._pipeline.source)) {
+ model._loadResources.shaders[id] = {
+ source : shader.extras._pipeline.source,
+ bufferView : undefined
+ };
+ } else {
+ ++model._loadResources.pendingShaderLoads;
+ var shaderPath = joinUrls(model._baseUri, shader.uri);
+ loadText(shaderPath).then(shaderLoad(model, shader.type, id)).otherwise(getFailedLoadFunction(model, 'shader', shaderPath));
+ }
+ });
+ }
+
+ function parsePrograms(model) {
+ ForEach.program(model.gltf, function(program, id) {
+ model._loadResources.programsToCreate.enqueue(id);
+ });
+ }
+
+ var nodeTranslationScratch = new Cartesian3();
+ var nodeQuaternionScratch = new Quaternion();
+ var nodeScaleScratch = new Cartesian3();
+
+ function getTransform(node) {
+ if (defined(node.matrix)) {
+ return Matrix4.fromArray(node.matrix);
+ }
+
+ return Matrix4.fromTranslationQuaternionRotationScale(
+ Cartesian3.fromArray(node.translation, 0, nodeTranslationScratch),
+ Quaternion.unpack(node.rotation, 0, nodeQuaternionScratch),
+ Cartesian3.fromArray(node.scale, 0, nodeScaleScratch));
+ }
+
+ function parseNodes(model) {
+ var runtimeNodes = {};
+ var runtimeNodesByName = {};
+ var skinnedNodes = [];
+
+ var skinnedNodesIds = model._loadResources.skinnedNodesIds;
+
+ ForEach.node(model.gltf, function(node, id) {
+ var runtimeNode = {
+ // Animation targets
+ matrix : undefined,
+ translation : undefined,
+ rotation : undefined,
+ scale : undefined,
+
+ // Per-node show inherited from parent
+ computedShow : true,
+
+ // Computed transforms
+ transformToRoot : new Matrix4(),
+ computedMatrix : new Matrix4(),
+ dirtyNumber : 0, // The frame this node was made dirty by an animation; for graph traversal
+
+ // Rendering
+ commands : [], // empty for transform, light, and camera nodes
+
+ // Skinned node
+ inverseBindMatrices : undefined, // undefined when node is not skinned
+ bindShapeMatrix : undefined, // undefined when node is not skinned or identity
+ joints : [], // empty when node is not skinned
+ computedJointMatrices : [], // empty when node is not skinned
+
+ // Joint node
+ jointName : node.jointName, // undefined when node is not a joint
+
+ weights : [],
+
+ // Graph pointers
+ children : [], // empty for leaf nodes
+ parents : [], // empty for root nodes
+
+ // Publicly-accessible ModelNode instance to modify animation targets
+ publicNode : undefined
+ };
+ runtimeNode.publicNode = new ModelNode(model, node, runtimeNode, id, getTransform(node));
+
+ runtimeNodes[id] = runtimeNode;
+ runtimeNodesByName[node.name] = runtimeNode;
+
+ if (defined(node.skin)) {
+ skinnedNodesIds.push(id);
+ skinnedNodes.push(runtimeNode);
+ }
+ });
+
+ model._runtime.nodes = runtimeNodes;
+ model._runtime.nodesByName = runtimeNodesByName;
+ model._runtime.skinnedNodes = skinnedNodes;
+ }
+
+ function parseMaterials(model) {
+ var runtimeMaterialsByName = {};
+ var runtimeMaterialsById = {};
+ var uniformMaps = model._uniformMaps;
+
+ ForEach.material(model.gltf, function(material, id) {
+ // Allocated now so ModelMaterial can keep a reference to it.
+ uniformMaps[id] = {
+ uniformMap : undefined,
+ values : undefined,
+ jointMatrixUniformName : undefined,
+ morphWeightsUniformName : undefined
+ };
+
+ var modelMaterial = new ModelMaterial(model, material, id);
+ runtimeMaterialsByName[material.name] = modelMaterial;
+ runtimeMaterialsById[id] = modelMaterial;
+ });
+
+ model._runtime.materialsByName = runtimeMaterialsByName;
+ model._runtime.materialsById = runtimeMaterialsById;
+ }
+
+ function parseMeshes(model) {
+ var runtimeMeshesByName = {};
+ var runtimeMaterialsById = model._runtime.materialsById;
+
+ ForEach.mesh(model.gltf, function(mesh, id) {
+ runtimeMeshesByName[mesh.name] = new ModelMesh(mesh, runtimeMaterialsById, id);
+ if (defined(model.extensionsUsed.WEB3D_quantized_attributes)) {
+ // Cache primitives according to their program
+ var primitives = mesh.primitives;
+ var primitivesLength = primitives.length;
+ for (var i = 0; i < primitivesLength; i++) {
+ var primitive = primitives[i];
+ var programId = getProgramForPrimitive(model, primitive);
+ var programPrimitives = model._programPrimitives[programId];
+ if (!defined(programPrimitives)) {
+ programPrimitives = [];
+ model._programPrimitives[programId] = programPrimitives;
+ }
+ programPrimitives.push(primitive);
+ }
+ }
+ });
+
+ model._runtime.meshesByName = runtimeMeshesByName;
+ }
+
+ function getUsedExtensions(model) {
+ var extensionsUsed = model.gltf.extensionsUsed;
+ var cachedExtensionsUsed = {};
+
+ if (defined(extensionsUsed)) {
+ var extensionsUsedLength = extensionsUsed.length;
+ for (var i = 0; i < extensionsUsedLength; i++) {
+ var extension = extensionsUsed[i];
+ cachedExtensionsUsed[extension] = true;
+ }
+ }
+ return cachedExtensionsUsed;
+ }
+
+ function getRequiredExtensions(model) {
+ var extensionsRequired = model.gltf.extensionsRequired;
+ var cachedExtensionsRequired = {};
+
+ if (defined(extensionsRequired)) {
+ var extensionsRequiredLength = extensionsRequired.length;
+ for (var i = 0; i < extensionsRequiredLength; i++) {
+ var extension = extensionsRequired[i];
+ cachedExtensionsRequired[extension] = true;
+ }
+ }
+
+ return cachedExtensionsRequired;
+ }
+
+ function createVertexBuffer(bufferViewId, model, context) {
+ var loadResources = model._loadResources;
+ var bufferViews = model.gltf.bufferViews;
+ var bufferView = bufferViews[bufferViewId];
+
+ var vertexBuffer = Buffer.createVertexBuffer({
+ context : context,
+ typedArray : loadResources.getBuffer(bufferView),
+ usage : BufferUsage.STATIC_DRAW
+ });
+ vertexBuffer.vertexArrayDestroyable = false;
+ model._rendererResources.buffers[bufferViewId] = vertexBuffer;
+ model._geometryByteLength += vertexBuffer.sizeInBytes;
+ }
+
+ function createIndexBuffer(bufferViewId, componentType, model, context) {
+ var loadResources = model._loadResources;
+ var bufferViews = model.gltf.bufferViews;
+ var bufferView = bufferViews[bufferViewId];
+
+ var indexBuffer = Buffer.createIndexBuffer({
+ context : context,
+ typedArray : loadResources.getBuffer(bufferView),
+ usage : BufferUsage.STATIC_DRAW,
+ indexDatatype : componentType
+ });
+ indexBuffer.vertexArrayDestroyable = false;
+ model._rendererResources.buffers[bufferViewId] = indexBuffer;
+ model._geometryByteLength += indexBuffer.sizeInBytes;
+ }
+
+ function createBuffers(model, frameState) {
+ var loadResources = model._loadResources;
+
+ if (loadResources.pendingBufferLoads !== 0) {
+ return;
+ }
+
+ var context = frameState.context;
+ var vertexBuffersToCreate = loadResources.vertexBuffersToCreate;
+ var indexBuffersToCreate = loadResources.indexBuffersToCreate;
+
+ while (vertexBuffersToCreate.length > 0) {
+ createVertexBuffer(vertexBuffersToCreate.dequeue(), model, context);
+ }
+
+ while (indexBuffersToCreate.length > 0) {
+ var i = indexBuffersToCreate.dequeue();
+ createIndexBuffer(i.id, i.componentType, model, context);
+ }
+ }
+
+ function createAttributeLocations(model, attributes) {
+ var attributeLocations = {};
+ var length = attributes.length;
+ var i;
+
+ // Set the position attribute to the 0th index. In some WebGL implementations the shader
+ // will not work correctly if the 0th attribute is not active. For example, some glTF models
+ // list the normal attribute first but derived shaders like the cast-shadows shader do not use
+ // the normal attribute.
+ for (i = 1; i < length; ++i) {
+ var attribute = attributes[i];
+ if (/pos/i.test(attribute)) {
+ attributes[i] = attributes[0];
+ attributes[0] = attribute;
+ break;
+ }
+ }
+
+ for (i = 0; i < length; ++i) {
+ attributeLocations[attributes[i]] = i;
+ }
+
+ return attributeLocations;
+ }
+
+ function replaceAllButFirstInString(string, find, replace) {
+ var index = string.indexOf(find);
+ return string.replace(new RegExp(find, 'g'), function(match, offset, all) {
+ return index === offset ? match : replace;
+ });
+ }
+
+ function getProgramForPrimitive(model, primitive) {
+ var gltf = model.gltf;
+ var materialId = primitive.material;
+ var material = gltf.materials[materialId];
+ var techniqueId = material.technique;
+ var technique = gltf.techniques[techniqueId];
+ return technique.program;
+ }
+
+ function getQuantizedAttributes(model, accessorId) {
+ var gltf = model.gltf;
+ var accessor = gltf.accessors[accessorId];
+ var extensions = accessor.extensions;
+ if (defined(extensions)) {
+ return extensions.WEB3D_quantized_attributes;
+ }
+ return undefined;
+ }
+
+ function getAttributeVariableName(model, primitive, attributeSemantic) {
+ var gltf = model.gltf;
+ var materialId = primitive.material;
+ var material = gltf.materials[materialId];
+ var techniqueId = material.technique;
+ var technique = gltf.techniques[techniqueId];
+ for (var parameter in technique.parameters) {
+ if (technique.parameters.hasOwnProperty(parameter)) {
+ var semantic = technique.parameters[parameter].semantic;
+ if (semantic === attributeSemantic) {
+ var attributes = technique.attributes;
+ for (var attributeVarName in attributes) {
+ if (attributes.hasOwnProperty(attributeVarName)) {
+ var name = attributes[attributeVarName];
+ if (name === parameter) {
+ return attributeVarName;
+ }
+ }
+ }
+ }
+ }
+ }
+ return undefined;
+ }
+
+ function modifyShaderForQuantizedAttributes(shader, programName, model, context) {
+ var quantizedUniforms = {};
+ model._quantizedUniforms[programName] = quantizedUniforms;
+
+ var primitives = model._programPrimitives[programName];
+ for (var i = 0; i < primitives.length; i++) {
+ var primitive = primitives[i];
+ if (getProgramForPrimitive(model, primitive) === programName) {
+ for (var attributeSemantic in primitive.attributes) {
+ if (primitive.attributes.hasOwnProperty(attributeSemantic)) {
+ var attributeVarName = getAttributeVariableName(model, primitive, attributeSemantic);
+ var accessorId = primitive.attributes[attributeSemantic];
+
+ if (attributeSemantic.charAt(0) === '_') {
+ attributeSemantic = attributeSemantic.substring(1);
+ }
+ var decodeUniformVarName = 'gltf_u_dec_' + attributeSemantic.toLowerCase();
+
+ var decodeUniformVarNameScale = decodeUniformVarName + '_scale';
+ var decodeUniformVarNameTranslate = decodeUniformVarName + '_translate';
+ if (!defined(quantizedUniforms[decodeUniformVarName]) && !defined(quantizedUniforms[decodeUniformVarNameScale])) {
+ var quantizedAttributes = getQuantizedAttributes(model, accessorId);
+ if (defined(quantizedAttributes)) {
+ var decodeMatrix = quantizedAttributes.decodeMatrix;
+ var newMain = 'gltf_decoded_' + attributeSemantic;
+ var decodedAttributeVarName = attributeVarName.replace('a_', 'gltf_a_dec_');
+ var size = Math.floor(Math.sqrt(decodeMatrix.length));
+
+ // replace usages of the original attribute with the decoded version, but not the declaration
+ shader = replaceAllButFirstInString(shader, attributeVarName, decodedAttributeVarName);
+ // declare decoded attribute
+ var variableType;
+ if (size > 2) {
+ variableType = 'vec' + (size - 1);
+ } else {
+ variableType = 'float';
+ }
+ shader = variableType + ' ' + decodedAttributeVarName + ';\n' + shader;
+ // splice decode function into the shader - attributes are pre-multiplied with the decode matrix
+ // uniform in the shader (32-bit floating point)
+ var decode = '';
+ if (size === 5) {
+ // separate scale and translate since glsl doesn't have mat5
+ shader = 'uniform mat4 ' + decodeUniformVarNameScale + ';\n' + shader;
+ shader = 'uniform vec4 ' + decodeUniformVarNameTranslate + ';\n' + shader;
+ decode = '\n' +
+ 'void main() {\n' +
+ ' ' + decodedAttributeVarName + ' = ' + decodeUniformVarNameScale + ' * ' + attributeVarName + ' + ' + decodeUniformVarNameTranslate + ';\n' +
+ ' ' + newMain + '();\n' +
+ '}\n';
+
+ quantizedUniforms[decodeUniformVarNameScale] = {mat : 4};
+ quantizedUniforms[decodeUniformVarNameTranslate] = {vec : 4};
+ }
+ else {
+ shader = 'uniform mat' + size + ' ' + decodeUniformVarName + ';\n' + shader;
+ decode = '\n' +
+ 'void main() {\n' +
+ ' ' + decodedAttributeVarName + ' = ' + variableType + '(' + decodeUniformVarName + ' * vec' + size + '(' + attributeVarName + ',1.0));\n' +
+ ' ' + newMain + '();\n' +
+ '}\n';
+
+ quantizedUniforms[decodeUniformVarName] = {mat : size};
+ }
+ shader = ShaderSource.replaceMain(shader, newMain);
+ shader += decode;
+ }
+ }
+ }
+ }
+ }
+ }
+ // This is not needed after the program is processed, free the memory
+ model._programPrimitives[programName] = undefined;
+ return shader;
+ }
+
+ function modifyShaderForColor(shader, premultipliedAlpha) {
+ shader = ShaderSource.replaceMain(shader, 'gltf_blend_main');
+ shader +=
+ 'uniform vec4 gltf_color; \n' +
+ 'uniform float gltf_colorBlend; \n' +
+ 'void main() \n' +
+ '{ \n' +
+ ' gltf_blend_main(); \n';
+
+ // Un-premultiply the alpha so that blending is correct.
+
+ // Avoid divide-by-zero. The code below is equivalent to:
+ // if (gl_FragColor.a > 0.0)
+ // {
+ // gl_FragColor.rgb /= gl_FragColor.a;
+ // }
+
+ if (premultipliedAlpha) {
+ shader +=
+ ' float alpha = 1.0 - ceil(gl_FragColor.a) + gl_FragColor.a; \n' +
+ ' gl_FragColor.rgb /= alpha; \n';
+ }
+
+ shader +=
+ ' gl_FragColor.rgb = mix(gl_FragColor.rgb, gltf_color.rgb, gltf_colorBlend); \n' +
+ ' float highlight = ceil(gltf_colorBlend); \n' +
+ ' gl_FragColor.rgb *= mix(gltf_color.rgb, vec3(1.0), highlight); \n' +
+ ' gl_FragColor.a *= gltf_color.a; \n' +
+ '} \n';
+
+ return shader;
+ }
+
+ function modifyShader(shader, programName, callback) {
+ if (defined(callback)) {
+ shader = callback(shader, programName);
+ }
+ return shader;
+ }
+
+ function createProgram(id, model, context) {
+ var programs = model.gltf.programs;
+ var shaders = model.gltf.shaders;
+ var program = programs[id];
+
+ var attributeLocations = createAttributeLocations(model, program.attributes);
+ var vs = shaders[program.vertexShader].extras._pipeline.source;
+ var fs = shaders[program.fragmentShader].extras._pipeline.source;
+
+ // Add pre-created attributes to attributeLocations
+ var attributesLength = program.attributes.length;
+ var precreatedAttributes = model._precreatedAttributes;
+ if (defined(precreatedAttributes)) {
+ for (var attrName in precreatedAttributes) {
+ if (precreatedAttributes.hasOwnProperty(attrName)) {
+ attributeLocations[attrName] = attributesLength++;
+ }
+ }
+ }
+
+ if (model.extensionsUsed.WEB3D_quantized_attributes) {
+ vs = modifyShaderForQuantizedAttributes(vs, id, model, context);
+ }
+
+ var blendFS = modifyShaderForColor(fs, false);
+
+ var drawVS = modifyShader(vs, id, model._vertexShaderLoaded);
+ var drawFS = modifyShader(blendFS, id, model._fragmentShaderLoaded);
+
+ model._rendererResources.programs[id] = ShaderProgram.fromCache({
+ context : context,
+ vertexShaderSource : drawVS,
+ fragmentShaderSource : drawFS,
+ attributeLocations : attributeLocations
+ });
+
+ if (model.allowPicking) {
+ // PERFORMANCE_IDEA: Can optimize this shader with a glTF hint. https://github.com/KhronosGroup/glTF/issues/181
+ var pickVS = modifyShader(vs, id, model._pickVertexShaderLoaded);
+ var pickFS = modifyShader(fs, id, model._pickFragmentShaderLoaded);
+
+ if (!model._pickFragmentShaderLoaded) {
+ pickFS = ShaderSource.createPickFragmentShaderSource(fs, 'uniform');
+ }
+
+ model._rendererResources.pickPrograms[id] = ShaderProgram.fromCache({
+ context : context,
+ vertexShaderSource : pickVS,
+ fragmentShaderSource : pickFS,
+ attributeLocations : attributeLocations
+ });
+ }
+ }
+
+ function createPrograms(model, frameState) {
+ var loadResources = model._loadResources;
+ var programsToCreate = loadResources.programsToCreate;
+
+ if (loadResources.pendingShaderLoads !== 0) {
+ return;
+ }
+
+ // PERFORMANCE_IDEA: this could be more fine-grained by looking
+ // at the shader's bufferView's to determine the buffer dependencies.
+ if (loadResources.pendingBufferLoads !== 0) {
+ return;
+ }
+
+ var context = frameState.context;
+ // Create all loaded programs this frame
+ while (programsToCreate.length > 0) {
+ createProgram(programsToCreate.dequeue(), model, context);
+ }
+ }
+
+ function getAttributeLocations(model, primitive) {
+ var gltf = model.gltf;
+ var techniques = gltf.techniques;
+ var materials = gltf.materials;
+
+ // Retrieve the compiled shader program to assign index values to attributes
+ var attributeLocations = {};
+
+ var location;
+ var index;
+ var technique = techniques[materials[primitive.material].technique];
+ var parameters = technique.parameters;
+ var attributes = technique.attributes;
+ var program = model._rendererResources.programs[technique.program];
+ var programVertexAttributes = program.vertexAttributes;
+ var programAttributeLocations = program._attributeLocations;
+
+ // Note: WebGL shader compiler may have optimized and removed some attributes from programVertexAttributes
+ for (location in programVertexAttributes) {
+ if (programVertexAttributes.hasOwnProperty(location)) {
+ var attribute = attributes[location];
+ index = programVertexAttributes[location].index;
+ if (defined(attribute)) {
+ var parameter = parameters[attribute];
+ attributeLocations[parameter.semantic] = index;
+ }
+ }
+ }
+
+ // Always add pre-created attributes.
+ // Some pre-created attributes, like per-instance pickIds, may be compiled out of the draw program
+ // but should be included in the list of attribute locations for the pick program.
+ // This is safe to do since programVertexAttributes and programAttributeLocations are equivalent except
+ // that programVertexAttributes optimizes out unused attributes.
+ var precreatedAttributes = model._precreatedAttributes;
+ if (defined(precreatedAttributes)) {
+ for (location in precreatedAttributes) {
+ if (precreatedAttributes.hasOwnProperty(location)) {
+ index = programAttributeLocations[location];
+ attributeLocations[location] = index;
+ }
+ }
+ }
+
+ return attributeLocations;
+ }
+
+ function createVertexArrays(model, context) {
+ var loadResources = model._loadResources;
+
+ if (!loadResources.finishedBuffersCreation() || !loadResources.finishedProgramCreation()) {
+ return;
+ }
+
+ if (!loadResources.createVertexArrays) {
+ return;
+ }
+ loadResources.createVertexArrays = false;
+
+ var rendererBuffers = model._rendererResources.buffers;
+ var rendererVertexArrays = model._rendererResources.vertexArrays;
+ var gltf = model.gltf;
+ var accessors = gltf.accessors;
+ var meshes = gltf.meshes;
+
+ for (var meshId in meshes) {
+ if (meshes.hasOwnProperty(meshId)) {
+ var primitives = meshes[meshId].primitives;
+ var primitivesLength = primitives.length;
+
+ for (var i = 0; i < primitivesLength; ++i) {
+ var primitive = primitives[i];
+
+ // GLTF_SPEC: This does not take into account attribute arrays,
+ // indicated by when an attribute points to a parameter with a
+ // count property.
+ //
+ // https://github.com/KhronosGroup/glTF/issues/258
+
+ var attributeLocations = getAttributeLocations(model, primitive);
+ var attributeName;
+ var attributeLocation;
+ var attribute;
+ var attributes = [];
+ var primitiveAttributes = primitive.attributes;
+ for (attributeName in primitiveAttributes) {
+ if (primitiveAttributes.hasOwnProperty(attributeName)) {
+ attributeLocation = attributeLocations[attributeName];
+ // Skip if the attribute is not used by the material, e.g., because the asset was exported
+ // with an attribute that wasn't used and the asset wasn't optimized.
+ if (defined(attributeLocation)) {
+ var a = accessors[primitiveAttributes[attributeName]];
+ var normalize = false;
+ if (defined(a.normalized) && a.normalized) {
+ normalize = true;
+ }
+
+ attributes.push({
+ index : attributeLocation,
+ vertexBuffer : rendererBuffers[a.bufferView],
+ componentsPerAttribute : numberOfComponentsForType(a.type),
+ componentDatatype : a.componentType,
+ normalize : normalize,
+ offsetInBytes : a.byteOffset,
+ strideInBytes : getAccessorByteStride(gltf, a)
+ });
+ }
+ }
+ }
+
+ // Add pre-created attributes
+ var precreatedAttributes = model._precreatedAttributes;
+ if (defined(precreatedAttributes)) {
+ for (attributeName in precreatedAttributes) {
+ if (precreatedAttributes.hasOwnProperty(attributeName)) {
+ attributeLocation = attributeLocations[attributeName];
+ if (defined(attributeLocation)) {
+ attribute = precreatedAttributes[attributeName];
+ attribute.index = attributeLocation;
+ attributes.push(attribute);
+ }
+ }
+ }
+ }
+
+ var indexBuffer;
+ if (defined(primitive.indices)) {
+ var accessor = accessors[primitive.indices];
+ indexBuffer = rendererBuffers[accessor.bufferView];
+ }
+ rendererVertexArrays[meshId + '.primitive.' + i] = new VertexArray({
+ context : context,
+ attributes : attributes,
+ indexBuffer : indexBuffer
+ });
+ }
+ }
+ }
+ }
+
+ // This doesn't support LOCAL, which we could add if it is ever used.
+ var scratchTranslationRtc = new Cartesian3();
+ var gltfSemanticUniforms = {
+ MODEL : function(uniformState, model) {
+ return function() {
+ return uniformState.model;
+ };
+ },
+ VIEW : function(uniformState, model) {
+ return function() {
+ return uniformState.view;
+ };
+ },
+ PROJECTION : function(uniformState, model) {
+ return function() {
+ return uniformState.projection;
+ };
+ },
+ MODELVIEW : function(uniformState, model) {
+ return function() {
+ return uniformState.modelView;
+ };
+ },
+ CESIUM_RTC_MODELVIEW : function(uniformState, model) {
+ // CESIUM_RTC extension
+ var mvRtc = new Matrix4();
+ return function() {
+ if (defined(model._rtcCenter)) {
+ Matrix4.getTranslation(uniformState.model, scratchTranslationRtc);
+ Cartesian3.add(scratchTranslationRtc, model._rtcCenter, scratchTranslationRtc);
+ Matrix4.multiplyByPoint(uniformState.view, scratchTranslationRtc, scratchTranslationRtc);
+ return Matrix4.setTranslation(uniformState.modelView, scratchTranslationRtc, mvRtc);
+ }
+ return uniformState.modelView;
+ };
+ },
+ MODELVIEWPROJECTION : function(uniformState, model) {
+ return function() {
+ return uniformState.modelViewProjection;
+ };
+ },
+ MODELINVERSE : function(uniformState, model) {
+ return function() {
+ return uniformState.inverseModel;
+ };
+ },
+ VIEWINVERSE : function(uniformState, model) {
+ return function() {
+ return uniformState.inverseView;
+ };
+ },
+ PROJECTIONINVERSE : function(uniformState, model) {
+ return function() {
+ return uniformState.inverseProjection;
+ };
+ },
+ MODELVIEWINVERSE : function(uniformState, model) {
+ return function() {
+ return uniformState.inverseModelView;
+ };
+ },
+ MODELVIEWPROJECTIONINVERSE : function(uniformState, model) {
+ return function() {
+ return uniformState.inverseModelViewProjection;
+ };
+ },
+ MODELINVERSETRANSPOSE : function(uniformState, model) {
+ return function() {
+ return uniformState.inverseTransposeModel;
+ };
+ },
+ MODELVIEWINVERSETRANSPOSE : function(uniformState, model) {
+ return function() {
+ return uniformState.normal;
+ };
+ },
+ VIEWPORT : function(uniformState, model) {
+ return function() {
+ return uniformState.viewportCartesian4;
+ };
+ }
+ };
+
+ ///////////////////////////////////////////////////////////////////////////
+
+ function getScalarUniformFunction(value, model) {
+ var that = {
+ value : value,
+ clone : function(source, result) {
+ return source;
+ },
+ func : function() {
+ return that.value;
+ }
+ };
+ return that;
+ }
+
+ function getVec2UniformFunction(value, model) {
+ var that = {
+ value : Cartesian2.fromArray(value),
+ clone : Cartesian2.clone,
+ func : function() {
+ return that.value;
+ }
+ };
+ return that;
+ }
+
+ function getVec3UniformFunction(value, model) {
+ var that = {
+ value : Cartesian3.fromArray(value),
+ clone : Cartesian3.clone,
+ func : function() {
+ return that.value;
+ }
+ };
+ return that;
+ }
+
+ function getVec4UniformFunction(value, model) {
+ var that = {
+ value : Cartesian4.fromArray(value),
+ clone : Cartesian4.clone,
+ func : function() {
+ return that.value;
+ }
+ };
+ return that;
+ }
+
+ function getMat2UniformFunction(value, model) {
+ var that = {
+ value : Matrix2.fromColumnMajorArray(value),
+ clone : Matrix2.clone,
+ func : function() {
+ return that.value;
+ }
+ };
+ return that;
+ }
+
+ function getMat3UniformFunction(value, model) {
+ var that = {
+ value : Matrix3.fromColumnMajorArray(value),
+ clone : Matrix3.clone,
+ func : function() {
+ return that.value;
+ }
+ };
+ return that;
+ }
+
+ function getMat4UniformFunction(value, model) {
+ var that = {
+ value : Matrix4.fromColumnMajorArray(value),
+ clone : Matrix4.clone,
+ func : function() {
+ return that.value;
+ }
+ };
+ return that;
+ }
+
+ var gltfUniformFunctions = {};
+ gltfUniformFunctions[WebGLConstants.FLOAT] = getScalarUniformFunction;
+ gltfUniformFunctions[WebGLConstants.FLOAT_VEC2] = getVec2UniformFunction;
+ gltfUniformFunctions[WebGLConstants.FLOAT_VEC3] = getVec3UniformFunction;
+ gltfUniformFunctions[WebGLConstants.FLOAT_VEC4] = getVec4UniformFunction;
+ gltfUniformFunctions[WebGLConstants.INT] = getScalarUniformFunction;
+ gltfUniformFunctions[WebGLConstants.INT_VEC2] = getVec2UniformFunction;
+ gltfUniformFunctions[WebGLConstants.INT_VEC3] = getVec3UniformFunction;
+ gltfUniformFunctions[WebGLConstants.INT_VEC4] = getVec4UniformFunction;
+ gltfUniformFunctions[WebGLConstants.BOOL] = getScalarUniformFunction;
+ gltfUniformFunctions[WebGLConstants.BOOL_VEC2] = getVec2UniformFunction;
+ gltfUniformFunctions[WebGLConstants.BOOL_VEC3] = getVec3UniformFunction;
+ gltfUniformFunctions[WebGLConstants.BOOL_VEC4] = getVec4UniformFunction;
+ gltfUniformFunctions[WebGLConstants.FLOAT_MAT2] = getMat2UniformFunction;
+ gltfUniformFunctions[WebGLConstants.FLOAT_MAT3] = getMat3UniformFunction;
+ gltfUniformFunctions[WebGLConstants.FLOAT_MAT4] = getMat4UniformFunction;
+ // GLTF_SPEC: Support SAMPLER_CUBE. https://github.com/KhronosGroup/glTF/issues/40
+
+ var gltfUniformsFromNode = {
+ MODEL : function(uniformState, model, runtimeNode) {
+ return function() {
+ return runtimeNode.computedMatrix;
+ };
+ },
+ VIEW : function(uniformState, model, runtimeNode) {
+ return function() {
+ return uniformState.view;
+ };
+ },
+ PROJECTION : function(uniformState, model, runtimeNode) {
+ return function() {
+ return uniformState.projection;
+ };
+ },
+ MODELVIEW : function(uniformState, model, runtimeNode) {
+ var mv = new Matrix4();
+ return function() {
+ return Matrix4.multiplyTransformation(uniformState.view, runtimeNode.computedMatrix, mv);
+ };
+ },
+ CESIUM_RTC_MODELVIEW : function(uniformState, model, runtimeNode) {
+ // CESIUM_RTC extension
+ var mvRtc = new Matrix4();
+ return function() {
+ Matrix4.multiplyTransformation(uniformState.view, runtimeNode.computedMatrix, mvRtc);
+ return Matrix4.setTranslation(mvRtc, model._rtcCenterEye, mvRtc);
+ };
+ },
+ MODELVIEWPROJECTION : function(uniformState, model, runtimeNode) {
+ var mvp = new Matrix4();
+ return function() {
+ Matrix4.multiplyTransformation(uniformState.view, runtimeNode.computedMatrix, mvp);
+ return Matrix4.multiply(uniformState._projection, mvp, mvp);
+ };
+ },
+ MODELINVERSE : function(uniformState, model, runtimeNode) {
+ var mInverse = new Matrix4();
+ return function() {
+ return Matrix4.inverse(runtimeNode.computedMatrix, mInverse);
+ };
+ },
+ VIEWINVERSE : function(uniformState, model) {
+ return function() {
+ return uniformState.inverseView;
+ };
+ },
+ PROJECTIONINVERSE : function(uniformState, model, runtimeNode) {
+ return function() {
+ return uniformState.inverseProjection;
+ };
+ },
+ MODELVIEWINVERSE : function(uniformState, model, runtimeNode) {
+ var mv = new Matrix4();
+ var mvInverse = new Matrix4();
+ return function() {
+ Matrix4.multiplyTransformation(uniformState.view, runtimeNode.computedMatrix, mv);
+ return Matrix4.inverse(mv, mvInverse);
+ };
+ },
+ MODELVIEWPROJECTIONINVERSE : function(uniformState, model, runtimeNode) {
+ var mvp = new Matrix4();
+ var mvpInverse = new Matrix4();
+ return function() {
+ Matrix4.multiplyTransformation(uniformState.view, runtimeNode.computedMatrix, mvp);
+ Matrix4.multiply(uniformState._projection, mvp, mvp);
+ return Matrix4.inverse(mvp, mvpInverse);
+ };
+ },
+ MODELINVERSETRANSPOSE : function(uniformState, model, runtimeNode) {
+ var mInverse = new Matrix4();
+ var mInverseTranspose = new Matrix3();
+ return function() {
+ Matrix4.inverse(runtimeNode.computedMatrix, mInverse);
+ Matrix4.getRotation(mInverse, mInverseTranspose);
+ return Matrix3.transpose(mInverseTranspose, mInverseTranspose);
+ };
+ },
+ MODELVIEWINVERSETRANSPOSE : function(uniformState, model, runtimeNode) {
+ var mv = new Matrix4();
+ var mvInverse = new Matrix4();
+ var mvInverseTranspose = new Matrix3();
+ return function() {
+ Matrix4.multiplyTransformation(uniformState.view, runtimeNode.computedMatrix, mv);
+ Matrix4.inverse(mv, mvInverse);
+ Matrix4.getRotation(mvInverse, mvInverseTranspose);
+ return Matrix3.transpose(mvInverseTranspose, mvInverseTranspose);
+ };
+ },
+ VIEWPORT : function(uniformState, model, runtimeNode) {
+ return function() {
+ return uniformState.viewportCartesian4;
+ };
+ }
+ };
+
+ function getUniformFunctionFromSource(source, model, semantic, uniformState) {
+ var runtimeNode = model._runtime.nodes[source];
+ return gltfUniformsFromNode[semantic](uniformState, model, runtimeNode);
+ }
+
+ function createUniformMaps(model, context) {
+ var loadResources = model._loadResources;
+
+ if (!loadResources.finishedProgramCreation()) {
+ return;
+ }
+
+ if (!loadResources.createUniformMaps) {
+ return;
+ }
+ loadResources.createUniformMaps = false;
+
+ var gltf = model.gltf;
+ var materials = gltf.materials;
+ var techniques = gltf.techniques;
+ var uniformMaps = model._uniformMaps;
+
+ for (var materialId in materials) {
+ if (materials.hasOwnProperty(materialId)) {
+ var material = materials[materialId];
+ var instanceParameters;
+ instanceParameters = material.values;
+ var technique = techniques[material.technique];
+ var parameters = technique.parameters;
+ var uniforms = technique.uniforms;
+
+ var uniformMap = {};
+ var uniformValues = {};
+
+ // Uniform parameters
+ for (var name in uniforms) {
+ if (uniforms.hasOwnProperty(name) && name !== 'extras') {
+ var parameterName = uniforms[name];
+ var parameter = parameters[parameterName];
+
+ // GLTF_SPEC: This does not take into account uniform arrays,
+ // indicated by parameters with a count property.
+ //
+ // https://github.com/KhronosGroup/glTF/issues/258
+
+ // GLTF_SPEC: In this implementation, material parameters with a
+ // semantic or targeted via a source (for animation) are not
+ // targetable for material animations. Is this too strict?
+ //
+ // https://github.com/KhronosGroup/glTF/issues/142
+
+ if (defined(instanceParameters[parameterName])) {
+ // Parameter overrides by the instance technique
+ var uv = gltfUniformFunctions[parameter.type](instanceParameters[parameterName], model);
+ uniformMap[name] = uv.func;
+ uniformValues[parameterName] = uv;
+ } else if (defined(parameter.node)) {
+ uniformMap[name] = getUniformFunctionFromSource(parameter.node, model, parameter.semantic, context.uniformState);
+ } else if (defined(parameter.semantic) && parameter.semantic !== 'JOINTMATRIX' && parameter.semantic !== 'MORPHWEIGHTS') {
+ uniformMap[name] = gltfSemanticUniforms[parameter.semantic](context.uniformState, model);
+ } else if (defined(parameter.value)) {
+ // Technique value that isn't overridden by a material
+ var uv2 = gltfUniformFunctions[parameter.type](parameter.value, model);
+ uniformMap[name] = uv2.func;
+ uniformValues[parameterName] = uv2;
+ }
+ }
+ }
+
+ var u = uniformMaps[materialId];
+ u.uniformMap = uniformMap; // uniform name -> function for the renderer
+ u.values = uniformValues; // material parameter name -> ModelMaterial for modifying the parameter at runtime
+ }
+ }
+ }
+
+ function scaleFromMatrix5Array(matrix) {
+ return [matrix[0], matrix[1], matrix[2], matrix[3],
+ matrix[5], matrix[6], matrix[7], matrix[8],
+ matrix[10], matrix[11], matrix[12], matrix[13],
+ matrix[15], matrix[16], matrix[17], matrix[18]];
+ }
+
+ function translateFromMatrix5Array(matrix) {
+ return [matrix[20], matrix[21], matrix[22], matrix[23]];
+ }
+
+ function createUniformsForQuantizedAttributes(model, primitive, context) {
+ var gltf = model.gltf;
+ var accessors = gltf.accessors;
+ var programId = getProgramForPrimitive(model, primitive);
+ var quantizedUniforms = model._quantizedUniforms[programId];
+ var setUniforms = {};
+ var uniformMap = {};
+
+ for (var attribute in primitive.attributes) {
+ if (primitive.attributes.hasOwnProperty(attribute)) {
+ var accessorId = primitive.attributes[attribute];
+ var a = accessors[accessorId];
+ var extensions = a.extensions;
+
+ if (attribute.charAt(0) === '_') {
+ attribute = attribute.substring(1);
+ }
+
+ if (defined(extensions)) {
+ var quantizedAttributes = extensions.WEB3D_quantized_attributes;
+ if (defined(quantizedAttributes)) {
+ var decodeMatrix = quantizedAttributes.decodeMatrix;
+ var uniformVariable = 'gltf_u_dec_' + attribute.toLowerCase();
+
+ switch (a.type) {
+ case AttributeType.SCALAR:
+ uniformMap[uniformVariable] = getMat2UniformFunction(decodeMatrix, model).func;
+ setUniforms[uniformVariable] = true;
+ break;
+ case AttributeType.VEC2:
+ uniformMap[uniformVariable] = getMat3UniformFunction(decodeMatrix, model).func;
+ setUniforms[uniformVariable] = true;
+ break;
+ case AttributeType.VEC3:
+ uniformMap[uniformVariable] = getMat4UniformFunction(decodeMatrix, model).func;
+ setUniforms[uniformVariable] = true;
+ break;
+ case AttributeType.VEC4:
+ // VEC4 attributes are split into scale and translate because there is no mat5 in GLSL
+ var uniformVariableScale = uniformVariable + '_scale';
+ var uniformVariableTranslate = uniformVariable + '_translate';
+ uniformMap[uniformVariableScale] = getMat4UniformFunction(scaleFromMatrix5Array(decodeMatrix), model).func;
+ uniformMap[uniformVariableTranslate] = getVec4UniformFunction(translateFromMatrix5Array(decodeMatrix), model).func;
+ setUniforms[uniformVariableScale] = true;
+ setUniforms[uniformVariableTranslate] = true;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ // If there are any unset quantized uniforms in this program, they should be set to the identity
+ for (var quantizedUniform in quantizedUniforms) {
+ if (quantizedUniforms.hasOwnProperty(quantizedUniform)) {
+ if (!setUniforms[quantizedUniform]) {
+ var properties = quantizedUniforms[quantizedUniform];
+ if (defined(properties.mat)) {
+ if (properties.mat === 2) {
+ uniformMap[quantizedUniform] = getMat2UniformFunction(Matrix2.IDENTITY, model).func;
+ } else if (properties.mat === 3) {
+ uniformMap[quantizedUniform] = getMat3UniformFunction(Matrix3.IDENTITY, model).func;
+ } else if (properties.mat === 4) {
+ uniformMap[quantizedUniform] = getMat4UniformFunction(Matrix4.IDENTITY, model).func;
+ }
+ }
+ if (defined(properties.vec)) {
+ if (properties.vec === 4) {
+ uniformMap[quantizedUniform] = getVec4UniformFunction([0, 0, 0, 0], model).func;
+ }
+ }
+ }
+ }
+ }
+ return uniformMap;
+ }
+
+ function createPickColorFunction(color) {
+ return function() {
+ return color;
+ };
+ }
+
+ function createColorFunction(model) {
+ return function() {
+ return model.color;
+ };
+ }
+
+ function createColorBlendFunction(model) {
+ return function() {
+ return ColorBlendMode.getColorBlend(model.colorBlendMode, model.colorBlendAmount);
+ };
+ }
+
+ function triangleCountFromPrimitiveIndices(primitive, indicesCount) {
+ switch (primitive.mode) {
+ case PrimitiveType.TRIANGLES:
+ return (indicesCount / 3);
+ case PrimitiveType.TRIANGLE_STRIP:
+ case PrimitiveType.TRIANGLE_FAN:
+ return Math.max(indicesCount - 2, 0);
+ default:
+ return 0;
+ }
+ }
+
+ function createCommand(model, gltfNode, runtimeNode, context, scene3DOnly) {
+ var nodeCommands = model._nodeCommands;
+ var pickIds = model._pickIds;
+ var allowPicking = model.allowPicking;
+ var runtimeMeshesByName = model._runtime.meshesByName;
+
+ var resources = model._rendererResources;
+ var rendererVertexArrays = resources.vertexArrays;
+ var rendererPrograms = resources.programs;
+ var rendererPickPrograms = resources.pickPrograms;
+ var uniformMaps = model._uniformMaps;
+
+ var gltf = model.gltf;
+ var accessors = gltf.accessors;
+ var gltfMeshes = gltf.meshes;
+ var techniques = gltf.techniques;
+ var materials = gltf.materials;
+
+ var id = gltfNode.mesh;
+ var mesh = gltfMeshes[id];
+
+ var primitives = mesh.primitives;
+ var length = primitives.length;
+
+ // The glTF node hierarchy is a DAG so a node can have more than one
+ // parent, so a node may already have commands. If so, append more
+ // since they will have a different model matrix.
+
+ for (var i = 0; i < length; ++i) {
+ var primitive = primitives[i];
+ var ix = accessors[primitive.indices];
+ var material = materials[primitive.material];
+ var technique = techniques[material.technique];
+ var programId = technique.program;
+
+ var boundingSphere;
+ var positionAccessor = primitive.attributes.POSITION;
+ if (defined(positionAccessor)) {
+ var minMax = getAccessorMinMax(gltf, positionAccessor);
+ boundingSphere = BoundingSphere.fromCornerPoints(Cartesian3.fromArray(minMax.min), Cartesian3.fromArray(minMax.max));
+ }
+
+ var vertexArray = rendererVertexArrays[id + '.primitive.' + i];
+ var offset;
+ var count;
+ if (defined(ix)) {
+ count = ix.count;
+ offset = (ix.byteOffset / IndexDatatype.getSizeInBytes(ix.componentType)); // glTF has offset in bytes. Cesium has offsets in indices
+ }
+ else {
+ var positions = accessors[primitive.attributes.POSITION];
+ count = positions.count;
+ offset = 0;
+ }
+
+ // Update model triangle count using number of indices
+ model._trianglesLength += triangleCountFromPrimitiveIndices(primitive, count);
+
+ var um = uniformMaps[primitive.material];
+ var uniformMap = combine(um.uniformMap, {
+ gltf_color : createColorFunction(model),
+ gltf_colorBlend : createColorBlendFunction(model)
+ });
+
+ // Allow callback to modify the uniformMap
+ if (defined(model._uniformMapLoaded)) {
+ uniformMap = model._uniformMapLoaded(uniformMap, programId, runtimeNode);
+ }
+
+ // Add uniforms for decoding quantized attributes if used
+ if (model.extensionsUsed.WEB3D_quantized_attributes) {
+ var quantizedUniformMap = createUniformsForQuantizedAttributes(model, primitive, context);
+ uniformMap = combine(uniformMap, quantizedUniformMap);
+ }
+
+ var owner = model._pickObject;
+ if (!defined(owner)) {
+ owner = {
+ primitive : model,
+ id : model.id,
+ node : runtimeNode.publicNode,
+ mesh : runtimeMeshesByName[mesh.name]
+ };
+ }
+
+ var command = new DrawCommand({
+ boundingVolume : new BoundingSphere(), // updated in update()
+ cull : model.cull,
+ modelMatrix : new Matrix4(), // computed in update()
+ primitiveType : primitive.mode,
+ vertexArray : vertexArray,
+ count : count,
+ offset : offset,
+ shaderProgram : rendererPrograms[technique.program],
+ uniformMap : uniformMap,
+ renderState : RenderState.fromCache({
+ depthTest : {
+ enabled : true
+ }
+ }),
+ owner : owner,
+ pass : model.opaquePass
+ });
+
+ var pickCommand;
+
+ if (allowPicking) {
+ var pickUniformMap;
+
+ // Callback to override default model picking
+ if (defined(model._pickFragmentShaderLoaded)) {
+ if (defined(model._pickUniformMapLoaded)) {
+ pickUniformMap = model._pickUniformMapLoaded(uniformMap);
+ } else {
+ // This is unlikely, but could happen if the override shader does not
+ // need new uniforms since, for example, its pick ids are coming from
+ // a vertex attribute or are baked into the shader source.
+ pickUniformMap = combine(uniformMap);
+ }
+ } else {
+ var pickId = context.createPickId(owner);
+ pickIds.push(pickId);
+ var pickUniforms = {
+ czm_pickColor : createPickColorFunction(pickId.color)
+ };
+ pickUniformMap = combine(uniformMap, pickUniforms);
+ }
+
+ pickCommand = new DrawCommand({
+ boundingVolume : new BoundingSphere(), // updated in update()
+ cull : model.cull,
+ modelMatrix : new Matrix4(), // computed in update()
+ primitiveType : primitive.mode,
+ vertexArray : vertexArray,
+ count : count,
+ offset : offset,
+ shaderProgram : rendererPickPrograms[technique.program],
+ uniformMap : pickUniformMap,
+ renderState : RenderState.fromCache(),
+ owner : owner,
+ pass : model.opaquePass
+ });
+ }
+
+ var command2D;
+ var pickCommand2D;
+ if (!scene3DOnly) {
+ command2D = DrawCommand.shallowClone(command);
+ command2D.boundingVolume = new BoundingSphere(); // updated in update()
+ command2D.modelMatrix = new Matrix4(); // updated in update()
+
+ if (allowPicking) {
+ pickCommand2D = DrawCommand.shallowClone(pickCommand);
+ pickCommand2D.boundingVolume = new BoundingSphere(); // updated in update()
+ pickCommand2D.modelMatrix = new Matrix4(); // updated in update()
+ }
+ }
+
+ var nodeCommand = {
+ show : true,
+ boundingSphere : boundingSphere,
+ command : command,
+ pickCommand : pickCommand,
+ command2D : command2D,
+ pickCommand2D : pickCommand2D,
+ // Generated on demand when the model is set as a classifier
+ classificationPreloadCommand : undefined,
+ classificationStencilCommand : undefined,
+ classificationColorCommand : undefined,
+ classificationPreloadCommand2D : undefined,
+ classificationStencilCommand2D : undefined,
+ classificationColorCommand2D : undefined
+ };
+ runtimeNode.commands.push(nodeCommand);
+ nodeCommands.push(nodeCommand);
+ }
+
+ }
+
+ function createRuntimeNodes(model, context, scene3DOnly) {
+ var loadResources = model._loadResources;
+
+ if (!loadResources.finishedEverythingButTextureCreation()) {
+ return;
+ }
+
+ if (!loadResources.createRuntimeNodes) {
+ return;
+ }
+ loadResources.createRuntimeNodes = false;
+
+ var rootNodes = [];
+ var runtimeNodes = model._runtime.nodes;
+
+ var gltf = model.gltf;
+ var nodes = gltf.nodes;
+ var skins = gltf.skins;
+
+ var scene = gltf.scenes[gltf.scene];
+ var sceneNodes = scene.nodes;
+ var length = sceneNodes.length;
+
+ var stack = [];
+ var seen = {};
+
+ for (var i = 0; i < length; ++i) {
+ stack.push({
+ parentRuntimeNode : undefined,
+ gltfNode : nodes[sceneNodes[i]],
+ id : sceneNodes[i]
+ });
+
+ var skeletonIds = [];
+ while (stack.length > 0) {
+ var n = stack.pop();
+ seen[n.id] = true;
+ var parentRuntimeNode = n.parentRuntimeNode;
+ var gltfNode = n.gltfNode;
+
+ // Node hierarchy is a DAG so a node can have more than one parent so it may already exist
+ var runtimeNode = runtimeNodes[n.id];
+ if (runtimeNode.parents.length === 0) {
+ if (defined(gltfNode.matrix)) {
+ runtimeNode.matrix = Matrix4.fromColumnMajorArray(gltfNode.matrix);
+ } else {
+ // TRS converted to Cesium types
+ var rotation = gltfNode.rotation;
+ runtimeNode.translation = Cartesian3.fromArray(gltfNode.translation);
+ runtimeNode.rotation = Quaternion.unpack(rotation);
+ runtimeNode.scale = Cartesian3.fromArray(gltfNode.scale);
+ }
+ }
+
+ if (defined(parentRuntimeNode)) {
+ parentRuntimeNode.children.push(runtimeNode);
+ runtimeNode.parents.push(parentRuntimeNode);
+ } else {
+ rootNodes.push(runtimeNode);
+ }
+
+ if (defined(gltfNode.mesh)) {
+ createCommand(model, gltfNode, runtimeNode, context, scene3DOnly);
+ }
+
+ var children = gltfNode.children;
+ var childrenLength = children.length;
+ for (var j = 0; j < childrenLength; j++) {
+ var childId = children[j];
+ if (!seen[childId]) {
+ stack.push({
+ parentRuntimeNode : runtimeNode,
+ gltfNode : nodes[childId],
+ id : children[j]
+ });
+ }
+ }
+
+ var skin = gltfNode.skin;
+ if (defined(skin)) {
+ skeletonIds.push(skins[skin].skeleton);
+ }
+
+ if (stack.length === 0) {
+ for (var k = 0; k < skeletonIds.length; k++) {
+ var skeleton = skeletonIds[k];
+ if (!seen[skeleton]) {
+ stack.push({
+ parentRuntimeNode : undefined,
+ gltfNode : nodes[skeleton],
+ id : skeleton
+ });
+ }
+ }
+ }
+ }
+ }
+
+ model._runtime.rootNodes = rootNodes;
+ model._runtime.nodes = runtimeNodes;
+ }
+
+ function createResources(model, frameState) {
+ var context = frameState.context;
+ var scene3DOnly = frameState.scene3DOnly;
+
+ checkSupportedGlExtensions(model, context);
+ createBuffers(model, frameState); // using glTF bufferViews
+ createPrograms(model, frameState);
+
+ if (!model._loadRendererResourcesFromCache) {
+ createVertexArrays(model, context); // using glTF meshes
+ // Long-term, we might not cache render states if they could change
+ // due to an animation, e.g., a uniform going from opaque to transparent.
+ // Could use copy-on-write if it is worth it. Probably overkill.
+ }
+
+ createUniformMaps(model, context); // using glTF materials/techniques
+ createRuntimeNodes(model, context, scene3DOnly); // using glTF scene
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+
+ function getNodeMatrix(node, result) {
+ var publicNode = node.publicNode;
+ var publicMatrix = publicNode.matrix;
+
+ if (publicNode.useMatrix && defined(publicMatrix)) {
+ // Public matrix overrides orginial glTF matrix and glTF animations
+ Matrix4.clone(publicMatrix, result);
+ } else if (defined(node.matrix)) {
+ Matrix4.clone(node.matrix, result);
+ } else {
+ Matrix4.fromTranslationQuaternionRotationScale(node.translation, node.rotation, node.scale, result);
+ // Keep matrix returned by the node in-sync if the node is targeted by an animation. Only TRS nodes can be targeted.
+ publicNode.setMatrix(result);
+ }
+ }
+
+ var scratchNodeStack = [];
+ var scratchComputedTranslation = new Cartesian4();
+ var scratchComputedMatrixIn2D = new Matrix4();
+
+ function updateNodeHierarchyModelMatrix(model, modelTransformChanged, justLoaded, projection) {
+ var maxDirtyNumber = model._maxDirtyNumber;
+ var allowPicking = model.allowPicking;
+
+ var rootNodes = model._runtime.rootNodes;
+ var length = rootNodes.length;
+
+ var nodeStack = scratchNodeStack;
+ var computedModelMatrix = model._computedModelMatrix;
+
+ if ((model._mode !== SceneMode.SCENE3D) && !model._ignoreCommands) {
+ var translation = Matrix4.getColumn(computedModelMatrix, 3, scratchComputedTranslation);
+ if (!Cartesian4.equals(translation, Cartesian4.UNIT_W)) {
+ computedModelMatrix = Transforms.basisTo2D(projection, computedModelMatrix, scratchComputedMatrixIn2D);
+ model._rtcCenter = model._rtcCenter3D;
+ } else {
+ var center = model.boundingSphere.center;
+ var to2D = Transforms.wgs84To2DModelMatrix(projection, center, scratchComputedMatrixIn2D);
+ computedModelMatrix = Matrix4.multiply(to2D, computedModelMatrix, scratchComputedMatrixIn2D);
+
+ if (defined(model._rtcCenter)) {
+ Matrix4.setTranslation(computedModelMatrix, Cartesian4.UNIT_W, computedModelMatrix);
+ model._rtcCenter = model._rtcCenter2D;
+ }
+ }
+ }
+
+ for (var i = 0; i < length; ++i) {
+ var n = rootNodes[i];
+
+ getNodeMatrix(n, n.transformToRoot);
+ nodeStack.push(n);
+
+ while (nodeStack.length > 0) {
+ n = nodeStack.pop();
+ var transformToRoot = n.transformToRoot;
+ var commands = n.commands;
+
+ if ((n.dirtyNumber === maxDirtyNumber) || modelTransformChanged || justLoaded) {
+ var nodeMatrix = Matrix4.multiplyTransformation(computedModelMatrix, transformToRoot, n.computedMatrix);
+ var commandsLength = commands.length;
+ if (commandsLength > 0) {
+ // Node has meshes, which has primitives. Update their commands.
+ for (var j = 0; j < commandsLength; ++j) {
+ var primitiveCommand = commands[j];
+ var command = primitiveCommand.command;
+ Matrix4.clone(nodeMatrix, command.modelMatrix);
+
+ // PERFORMANCE_IDEA: Can use transformWithoutScale if no node up to the root has scale (including animation)
+ BoundingSphere.transform(primitiveCommand.boundingSphere, command.modelMatrix, command.boundingVolume);
+
+ if (defined(model._rtcCenter)) {
+ Cartesian3.add(model._rtcCenter, command.boundingVolume.center, command.boundingVolume.center);
+ }
+
+ if (allowPicking) {
+ var pickCommand = primitiveCommand.pickCommand;
+ Matrix4.clone(command.modelMatrix, pickCommand.modelMatrix);
+ BoundingSphere.clone(command.boundingVolume, pickCommand.boundingVolume);
+ }
+
+ // If the model crosses the IDL in 2D, it will be drawn in one viewport, but part of it
+ // will be clipped by the viewport. We create a second command that translates the model
+ // model matrix to the opposite side of the map so the part that was clipped in one viewport
+ // is drawn in the other.
+ command = primitiveCommand.command2D;
+ if (defined(command) && model._mode === SceneMode.SCENE2D) {
+ Matrix4.clone(nodeMatrix, command.modelMatrix);
+ command.modelMatrix[13] -= CesiumMath.sign(command.modelMatrix[13]) * 2.0 * CesiumMath.PI * projection.ellipsoid.maximumRadius;
+ BoundingSphere.transform(primitiveCommand.boundingSphere, command.modelMatrix, command.boundingVolume);
+
+ if (allowPicking) {
+ var pickCommand2D = primitiveCommand.pickCommand2D;
+ Matrix4.clone(command.modelMatrix, pickCommand2D.modelMatrix);
+ BoundingSphere.clone(command.boundingVolume, pickCommand2D.boundingVolume);
+ }
+ }
+ }
+ }
+ }
+
+ var children = n.children;
+ var childrenLength = children.length;
+ for (var k = 0; k < childrenLength; ++k) {
+ var child = children[k];
+
+ // A node's transform needs to be updated if
+ // - It was targeted for animation this frame, or
+ // - Any of its ancestors were targeted for animation this frame
+
+ // PERFORMANCE_IDEA: if a child has multiple parents and only one of the parents
+ // is dirty, all the subtrees for each child instance will be dirty; we probably
+ // won't see this in the wild often.
+ child.dirtyNumber = Math.max(child.dirtyNumber, n.dirtyNumber);
+
+ if ((child.dirtyNumber === maxDirtyNumber) || justLoaded) {
+ // Don't check for modelTransformChanged since if only the model's model matrix changed,
+ // we do not need to rebuild the local transform-to-root, only the final
+ // [model's-model-matrix][transform-to-root] above.
+ getNodeMatrix(child, child.transformToRoot);
+ Matrix4.multiplyTransformation(transformToRoot, child.transformToRoot, child.transformToRoot);
+ }
+
+ nodeStack.push(child);
+ }
+ }
+ }
+
+ ++model._maxDirtyNumber;
+ }
+
+ function updatePerNodeShow(model) {
+ // Totally not worth it, but we could optimize this:
+ // http://blogs.agi.com/insight3d/index.php/2008/02/13/deletion-in-bounding-volume-hierarchies/
+
+ var rootNodes = model._runtime.rootNodes;
+ var length = rootNodes.length;
+
+ var nodeStack = scratchNodeStack;
+
+ for (var i = 0; i < length; ++i) {
+ var n = rootNodes[i];
+ n.computedShow = n.publicNode.show;
+ nodeStack.push(n);
+
+ while (nodeStack.length > 0) {
+ n = nodeStack.pop();
+ var show = n.computedShow;
+
+ var nodeCommands = n.commands;
+ var nodeCommandsLength = nodeCommands.length;
+ for (var j = 0; j < nodeCommandsLength; ++j) {
+ nodeCommands[j].show = show;
+ }
+ // if commandsLength is zero, the node has a light or camera
+
+ var children = n.children;
+ var childrenLength = children.length;
+ for (var k = 0; k < childrenLength; ++k) {
+ var child = children[k];
+ // Parent needs to be shown for child to be shown.
+ child.computedShow = show && child.publicNode.show;
+ nodeStack.push(child);
+ }
+ }
+ }
+ }
+
+ function updatePickIds(model, context) {
+ var id = model.id;
+ if (model._id !== id) {
+ model._id = id;
+
+ var pickIds = model._pickIds;
+ var length = pickIds.length;
+ for (var i = 0; i < length; ++i) {
+ pickIds[i].object.id = id;
+ }
+ }
+ }
+
+ function updateWireframe(model) {
+ if (model._debugWireframe !== model.debugWireframe) {
+ model._debugWireframe = model.debugWireframe;
+
+ // This assumes the original primitive was TRIANGLES and that the triangles
+ // are connected for the wireframe to look perfect.
+ var primitiveType = model.debugWireframe ? PrimitiveType.LINES : PrimitiveType.TRIANGLES;
+ var nodeCommands = model._nodeCommands;
+ var length = nodeCommands.length;
+
+ for (var i = 0; i < length; ++i) {
+ nodeCommands[i].command.primitiveType = primitiveType;
+ }
+ }
+ }
+
+ function updateShowBoundingVolume(model) {
+ if (model.debugShowBoundingVolume !== model._debugShowBoundingVolume) {
+ model._debugShowBoundingVolume = model.debugShowBoundingVolume;
+
+ var debugShowBoundingVolume = model.debugShowBoundingVolume;
+ var nodeCommands = model._nodeCommands;
+ var length = nodeCommands.length;
+
+ for (var i = 0; i < length; ++i) {
+ nodeCommands[i].command.debugShowBoundingVolume = debugShowBoundingVolume;
+ }
+ }
+ }
+
+ function getProgramId(model, program) {
+ var programs = model._rendererResources.programs;
+ for (var id in programs) {
+ if (programs.hasOwnProperty(id)) {
+ if (programs[id] === program) {
+ return id;
+ }
+ }
+ }
+ }
+
+ function isClassification(model, frameState) {
+ return frameState.context.stencilBuffer && defined(model.classificationType);
+ }
+
+ var stencilMask = 0x0F;
+ var stencilReference = 0;
+
+ var classificationPreloadRS = {
+ colorMask : {
+ red : false,
+ green : false,
+ blue : false,
+ alpha : false
+ },
+ stencilTest : {
+ enabled : true,
+ frontFunction : StencilFunction.ALWAYS,
+ frontOperation : {
+ fail : StencilOperation.KEEP,
+ zFail : StencilOperation.DECREMENT_WRAP,
+ zPass : StencilOperation.DECREMENT_WRAP
+ },
+ backFunction : StencilFunction.ALWAYS,
+ backOperation : {
+ fail : StencilOperation.KEEP,
+ zFail : StencilOperation.INCREMENT_WRAP,
+ zPass : StencilOperation.INCREMENT_WRAP
+ },
+ reference : stencilReference,
+ mask : stencilMask
+ },
+ depthTest : {
+ enabled : false
+ },
+ depthMask : false
+ };
+
+ var classificationStencilRS = {
+ colorMask : {
+ red : false,
+ green : false,
+ blue : false,
+ alpha : false
+ },
+ stencilTest : {
+ enabled : true,
+ frontFunction : StencilFunction.ALWAYS,
+ frontOperation : {
+ fail : StencilOperation.KEEP,
+ zFail : StencilOperation.KEEP,
+ zPass : StencilOperation.INCREMENT_WRAP
+ },
+ backFunction : StencilFunction.ALWAYS,
+ backOperation : {
+ fail : StencilOperation.KEEP,
+ zFail : StencilOperation.KEEP,
+ zPass : StencilOperation.DECREMENT_WRAP
+ },
+ reference : stencilReference,
+ mask : stencilMask
+ },
+ depthTest : {
+ enabled : true,
+ func : DepthFunction.LESS_OR_EQUAL
+ },
+ depthMask : false
+ };
+
+ var classificationColorRS = {
+ stencilTest : {
+ enabled : true,
+ frontFunction : StencilFunction.NOT_EQUAL,
+ frontOperation : {
+ fail : StencilOperation.KEEP,
+ zFail : StencilOperation.KEEP,
+ zPass : StencilOperation.DECREMENT_WRAP
+ },
+ backFunction : StencilFunction.NOT_EQUAL,
+ backOperation : {
+ fail : StencilOperation.KEEP,
+ zFail : StencilOperation.KEEP,
+ zPass : StencilOperation.DECREMENT_WRAP
+ },
+ reference : stencilReference,
+ mask : stencilMask
+ },
+ depthTest : {
+ enabled : false
+ },
+ depthMask : false,
+ blending : BlendingState.ALPHA_BLEND
+ };
+
+ function createClassificationProgram(model, id, program, frameState) {
+ var vs = program.vertexShaderSource;
+ var attributeLocations = program._attributeLocations;
+ var fs =
+ 'void main() \n' +
+ '{ \n' +
+ ' gl_FragColor = vec4(1.0); \n' +
+ '}';
+
+ fs = modifyShader(fs, id, model._classificationShaderLoaded);
+
+ return ShaderProgram.fromCache({
+ context : frameState.context,
+ vertexShaderSource : vs,
+ fragmentShaderSource : fs,
+ attributeLocations : attributeLocations
+ });
+ }
+
+ function createClassificationCommands(model, frameState) {
+ var scene3DOnly = frameState.scene3DOnly;
+ var classificationPrograms = model._rendererResources.classificationPrograms;
+ var nodeCommands = model._nodeCommands;
+ var length = nodeCommands.length;
+ for (var i = 0; i < length; ++i) {
+ var nodeCommand = nodeCommands[i];
+ var command = nodeCommand.command;
+
+ var program = command.shaderProgram;
+ var id = getProgramId(model, program);
+ var classificationProgram = classificationPrograms[id];
+ if (!defined(classificationProgram)) {
+ classificationProgram = createClassificationProgram(model, id, program, frameState);
+ classificationPrograms[id] = classificationProgram;
+ }
+
+ var preloadCommand = DrawCommand.shallowClone(command);
+ preloadCommand.renderState = RenderState.fromCache(classificationPreloadRS);
+ preloadCommand.shaderProgram = classificationProgram;
+ preloadCommand.castShadows = false;
+ preloadCommand.receiveShadows = false;
+ nodeCommand.classificationPreloadCommand = preloadCommand;
+
+ var stencilCommand = DrawCommand.shallowClone(command);
+ stencilCommand.renderState = RenderState.fromCache(classificationStencilRS);
+ stencilCommand.shaderProgram = classificationProgram;
+ stencilCommand.castShadows = false;
+ stencilCommand.receiveShadows = false;
+ nodeCommand.classificationStencilCommand = stencilCommand;
+
+ var colorCommand = DrawCommand.shallowClone(command);
+ colorCommand.renderState = RenderState.fromCache(classificationColorRS);
+ colorCommand.shaderProgram = classificationProgram;
+ colorCommand.castShadows = false;
+ colorCommand.receiveShadows = false;
+ nodeCommand.classificationColorCommand = colorCommand;
+
+ if (!scene3DOnly) {
+ var command2D = nodeCommand.command2D;
+ var preloadCommand2D = DrawCommand.shallowClone(preloadCommand);
+ preloadCommand2D.boundingVolume = command2D.boundingVolume;
+ preloadCommand2D.modelMatrix = command2D.modelMatrix;
+ nodeCommand.classificationPreloadCommand2D = preloadCommand2D;
+
+ var stencilCommand2D = DrawCommand.shallowClone(stencilCommand);
+ stencilCommand2D.boundingVolume = command2D.boundingVolume;
+ stencilCommand2D.modelMatrix = command2D.modelMatrix;
+ nodeCommand.classificationStencilCommand2D = stencilCommand2D;
+
+ var colorCommand2D = DrawCommand.shallowClone(colorCommand);
+ colorCommand2D.boundingVolume = command2D.boundingVolume;
+ colorCommand2D.modelMatrix = command2D.modelMatrix;
+ nodeCommand.classificationColorCommand2D = colorCommand2D;
+ }
+ }
+ }
+
+ function updateClassification(model, frameState) {
+ var dirty = model._classificationType !== model.classificationType || model._dirty;
+ model._classificationType = model.classificationType;
+
+ if (!isClassification(model, frameState)) {
+ return;
+ }
+
+ var nodeCommands = model._nodeCommands;
+ if (!defined(nodeCommands[0].classificationPreloadCommand)) {
+ createClassificationCommands(model, frameState);
+ }
+
+ if (!dirty) {
+ return;
+ }
+
+ var pass;
+ switch (model._classificationType) {
+ case ClassificationType.TERRAIN:
+ pass = Pass.TERRAIN_CLASSIFICATION;
+ break;
+ case ClassificationType.CESIUM_3D_TILE:
+ pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;
+ break;
+ default:
+ pass = Pass.CLASSIFICATION;
+ }
+
+ var scene3DOnly = frameState.scene3DOnly;
+ var length = nodeCommands.length;
+ for (var i = 0; i < length; ++i) {
+ var nodeCommand = nodeCommands[i];
+
+ nodeCommand.classificationPreloadCommand.pass = pass;
+ nodeCommand.classificationStencilCommand.pass = pass;
+ nodeCommand.classificationColorCommand.pass = pass;
+
+ if (!scene3DOnly) {
+ nodeCommand.classificationPreloadCommand2D.pass = pass;
+ nodeCommand.classificationStencilCommand2D.pass = pass;
+ nodeCommand.classificationColorCommand2D.pass = pass;
+ }
+ }
+ }
+
+ var scratchBoundingSphere = new BoundingSphere();
+
+ function scaleInPixels(positionWC, radius, frameState) {
+ scratchBoundingSphere.center = positionWC;
+ scratchBoundingSphere.radius = radius;
+ return frameState.camera.getPixelSize(scratchBoundingSphere, frameState.context.drawingBufferWidth, frameState.context.drawingBufferHeight);
+ }
+
+ var scratchPosition = new Cartesian3();
+ var scratchCartographic = new Cartographic();
+
+ function getScale(model, frameState) {
+ var scale = model.scale;
+
+ if (model.minimumPixelSize !== 0.0) {
+ // Compute size of bounding sphere in pixels
+ var context = frameState.context;
+ var maxPixelSize = Math.max(context.drawingBufferWidth, context.drawingBufferHeight);
+ var m = defined(model._clampedModelMatrix) ? model._clampedModelMatrix : model.modelMatrix;
+ scratchPosition.x = m[12];
+ scratchPosition.y = m[13];
+ scratchPosition.z = m[14];
+
+ if (defined(model._rtcCenter)) {
+ Cartesian3.add(model._rtcCenter, scratchPosition, scratchPosition);
+ }
+
+ if (model._mode !== SceneMode.SCENE3D) {
+ var projection = frameState.mapProjection;
+ var cartographic = projection.ellipsoid.cartesianToCartographic(scratchPosition, scratchCartographic);
+ projection.project(cartographic, scratchPosition);
+ Cartesian3.fromElements(scratchPosition.z, scratchPosition.x, scratchPosition.y, scratchPosition);
+ }
+
+ var radius = model.boundingSphere.radius;
+ var metersPerPixel = scaleInPixels(scratchPosition, radius, frameState);
+
+ // metersPerPixel is always > 0.0
+ var pixelsPerMeter = 1.0 / metersPerPixel;
+ var diameterInPixels = Math.min(pixelsPerMeter * (2.0 * radius), maxPixelSize);
+
+ // Maintain model's minimum pixel size
+ if (diameterInPixels < model.minimumPixelSize) {
+ scale = (model.minimumPixelSize * metersPerPixel) / (2.0 * model._initialRadius);
+ }
+ }
+
+ return defined(model.maximumScale) ? Math.min(model.maximumScale, scale) : scale;
+ }
+
+ function releaseCachedGltf(model) {
+ if (defined(model._cacheKey) && defined(model._cachedGltf) && (--model._cachedGltf.count === 0)) {
+ delete gltfCache[model._cacheKey];
+ }
+ model._cachedGltf = undefined;
+ }
+
+ function checkSupportedExtensions(model) {
+ var extensionsRequired = model.extensionsRequired;
+ for (var extension in extensionsRequired) {
+ if (extensionsRequired.hasOwnProperty(extension)) {
+ if (extension !== 'CESIUM_RTC' &&
+ extension !== 'KHR_technique_webgl' &&
+ extension !== 'KHR_binary_glTF' &&
+ extension !== 'KHR_materials_common' &&
+ extension !== 'WEB3D_quantized_attributes') {
+ throw new RuntimeError('Unsupported glTF Extension: ' + extension);
+ }
+ }
+ }
+ }
+
+ function checkSupportedGlExtensions(model, context) {
+ var glExtensionsUsed = model.gltf.glExtensionsUsed;
+ if (defined(glExtensionsUsed)) {
+ var glExtensionsUsedLength = glExtensionsUsed.length;
+ for (var i = 0; i < glExtensionsUsedLength; i++) {
+ var extension = glExtensionsUsed[i];
+ if (extension !== 'OES_element_index_uint') {
+ throw new RuntimeError('Unsupported WebGL Extension: ' + extension);
+ } else if (!context.elementIndexUint) {
+ throw new RuntimeError('OES_element_index_uint WebGL extension is not enabled.');
+ }
+ }
+ }
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+
+ function CachedRendererResources(context, cacheKey) {
+ this.buffers = undefined;
+ this.vertexArrays = undefined;
+ this.programs = undefined;
+ this.pickPrograms = undefined;
+ this.classificationPrograms = undefined;
+ this.renderStates = undefined;
+ this.ready = false;
+
+ this.context = context;
+ this.cacheKey = cacheKey;
+ this.count = 0;
+ }
+
+ function destroy(property) {
+ for (var name in property) {
+ if (property.hasOwnProperty(name)) {
+ property[name].destroy();
+ }
+ }
+ }
+
+ function destroyCachedRendererResources(resources) {
+ destroy(resources.buffers);
+ destroy(resources.vertexArrays);
+ destroy(resources.programs);
+ destroy(resources.pickPrograms);
+ destroy(resources.classificationPrograms);
+ }
+
+ CachedRendererResources.prototype.release = function() {
+ if (--this.count === 0) {
+ if (defined(this.cacheKey)) {
+ // Remove if this was cached
+ delete this.context.cache.modelRendererResourceCache[this.cacheKey];
+ }
+ destroyCachedRendererResources(this);
+ return destroyObject(this);
+ }
+
+ return undefined;
+ };
+
+ ///////////////////////////////////////////////////////////////////////////
+
+ function getUpdateHeightCallback(model, ellipsoid, cartoPosition) {
+ return function(clampedPosition) {
+ if (model.heightReference === HeightReference.RELATIVE_TO_GROUND) {
+ var clampedCart = ellipsoid.cartesianToCartographic(clampedPosition, scratchCartographic);
+ clampedCart.height += cartoPosition.height;
+ ellipsoid.cartographicToCartesian(clampedCart, clampedPosition);
+ }
+
+ var clampedModelMatrix = model._clampedModelMatrix;
+
+ // Modify clamped model matrix to use new height
+ Matrix4.clone(model.modelMatrix, clampedModelMatrix);
+ clampedModelMatrix[12] = clampedPosition.x;
+ clampedModelMatrix[13] = clampedPosition.y;
+ clampedModelMatrix[14] = clampedPosition.z;
+
+ model._heightChanged = true;
+ };
+ }
+
+ function updateClamping(model) {
+ if (defined(model._removeUpdateHeightCallback)) {
+ model._removeUpdateHeightCallback();
+ model._removeUpdateHeightCallback = undefined;
+ }
+
+ var scene = model._scene;
+ if (!defined(scene) || (model.heightReference === HeightReference.NONE)) {
+ //>>includeStart('debug', pragmas.debug);
+ if (model.heightReference !== HeightReference.NONE) {
+ throw new DeveloperError('Height reference is not supported without a scene.');
+ }
+ //>>includeEnd('debug');
+ model._clampedModelMatrix = undefined;
+ return;
+ }
+
+ var globe = scene.globe;
+ var ellipsoid = globe.ellipsoid;
+
+ // Compute cartographic position so we don't recompute every update
+ var modelMatrix = model.modelMatrix;
+ scratchPosition.x = modelMatrix[12];
+ scratchPosition.y = modelMatrix[13];
+ scratchPosition.z = modelMatrix[14];
+ var cartoPosition = ellipsoid.cartesianToCartographic(scratchPosition);
+
+ if (!defined(model._clampedModelMatrix)) {
+ model._clampedModelMatrix = Matrix4.clone(modelMatrix, new Matrix4());
+ }
+
+ // Install callback to handle updating of terrain tiles
+ var surface = globe._surface;
+ model._removeUpdateHeightCallback = surface.updateHeight(cartoPosition, getUpdateHeightCallback(model, ellipsoid, cartoPosition));
+
+ // Set the correct height now
+ var height = globe.getHeight(cartoPosition);
+ if (defined(height)) {
+ // Get callback with cartoPosition being the non-clamped position
+ var cb = getUpdateHeightCallback(model, ellipsoid, cartoPosition);
+
+ // Compute the clamped cartesian and call updateHeight callback
+ Cartographic.clone(cartoPosition, scratchCartographic);
+ scratchCartographic.height = height;
+ ellipsoid.cartographicToCartesian(scratchCartographic, scratchPosition);
+ cb(scratchPosition);
+ }
+ }
+
+ var scratchDisplayConditionCartesian = new Cartesian3();
+ var scratchDistanceDisplayConditionCartographic = new Cartographic();
+
+ function distanceDisplayConditionVisible(model, frameState) {
+ var distance2;
+ var ddc = model.distanceDisplayCondition;
+ var nearSquared = ddc.near * ddc.near;
+ var farSquared = ddc.far * ddc.far;
+
+ if (frameState.mode === SceneMode.SCENE2D) {
+ var frustum2DWidth = frameState.camera.frustum.right - frameState.camera.frustum.left;
+ distance2 = frustum2DWidth * 0.5;
+ distance2 = distance2 * distance2;
+ } else {
+ // Distance to center of primitive's reference frame
+ var position = Matrix4.getTranslation(model.modelMatrix, scratchDisplayConditionCartesian);
+ if (frameState.mode === SceneMode.COLUMBUS_VIEW) {
+ var projection = frameState.mapProjection;
+ var ellipsoid = projection.ellipsoid;
+ var cartographic = ellipsoid.cartesianToCartographic(position, scratchDistanceDisplayConditionCartographic);
+ position = projection.project(cartographic, position);
+ Cartesian3.fromElements(position.z, position.x, position.y, position);
+ }
+ distance2 = Cartesian3.distanceSquared(position, frameState.camera.positionWC);
+ }
+
+ return (distance2 >= nearSquared) && (distance2 <= farSquared);
+ }
+
+ /**
+ * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
+ * get the draw commands needed to render this primitive.
+ *
+ * Do not call this function directly. This is documented just to
+ * list the exceptions that may be propagated when the scene is rendered:
+ *
+ *
+ * @exception {RuntimeError} Failed to load external reference.
+ */
+ Model.prototype.update = function(frameState) {
+ if (frameState.mode === SceneMode.MORPHING) {
+ return;
+ }
+
+ var context = frameState.context;
+
+ if ((this._state === ModelState.NEEDS_LOAD) && defined(this.gltf)) {
+ this._state = ModelState.LOADING;
+ if (this._state !== ModelState.FAILED) {
+ var extensions = this.gltf.extensions;
+ if (defined(extensions) && defined(extensions.CESIUM_RTC)) {
+ var center = Cartesian3.fromArray(extensions.CESIUM_RTC.center);
+ if (!Cartesian3.equals(center, Cartesian3.ZERO)) {
+ this._rtcCenter3D = center;
+
+ var projection = frameState.mapProjection;
+ var ellipsoid = projection.ellipsoid;
+ var cartographic = ellipsoid.cartesianToCartographic(this._rtcCenter3D);
+ var projectedCart = projection.project(cartographic);
+ Cartesian3.fromElements(projectedCart.z, projectedCart.x, projectedCart.y, projectedCart);
+ this._rtcCenter2D = projectedCart;
+
+ this._rtcCenterEye = new Cartesian3();
+ this._rtcCenter = this._rtcCenter3D;
+ }
+ }
+
+ this._loadResources = new LoadResources();
+ if (!this._loadRendererResourcesFromCache) {
+ // Buffers are required to updateVersion
+ parseBuffers(this);
+ }
+ }
+ }
+
+ var loadResources = this._loadResources;
+ var justLoaded = false;
+
+ if (this._state === ModelState.LOADING) {
+ // Transition from LOADING -> LOADED once resources are downloaded and created.
+ // Textures may continue to stream in while in the LOADED state.
+ if (loadResources.pendingBufferLoads === 0) {
+ if (!this._updatedGltfVersion) {
+ var options = {
+ optimizeForCesium: true,
+ addBatchIdToGeneratedShaders : this._addBatchIdToGeneratedShaders
+ };
+ frameState.brdfLutGenerator.update(frameState);
+ updateVersion(this.gltf);
+ checkSupportedExtensions(this);
+ addPipelineExtras(this.gltf);
+ addDefaults(this.gltf);
+ processModelMaterialsCommon(this.gltf, options);
+ processPbrMetallicRoughness(this.gltf, options);
+ // We do this after to make sure that the ids don't change
+ addBuffersToLoadResources(this);
+
+ parseBufferViews(this);
+ parseShaders(this);
+ parsePrograms(this);
+ parseMaterials(this);
+ parseMeshes(this);
+ parseNodes(this);
+
+ this._boundingSphere = computeBoundingSphere(this);
+ this._initialRadius = this._boundingSphere.radius;
+ this._updatedGltfVersion = true;
+ }
+ if (this._updatedGltfVersion && loadResources.pendingShaderLoads === 0) {
+ createResources(this, frameState);
+ }
+ }
+ if (loadResources.finished()) {
+ this._state = ModelState.LOADED;
+ justLoaded = true;
+ }
+ }
+
+ // Incrementally stream textures.
+ if (defined(loadResources) && (this._state === ModelState.LOADED)) {
+ if (!justLoaded) {
+ createResources(this, frameState);
+ }
+
+ if (loadResources.finished()) {
+ this._loadResources = undefined; // Clear CPU memory since WebGL resources were created.
+
+ // The normal attribute name is required for silhouettes, so get it before the gltf JSON is released
+ this._normalAttributeName = getAttributeOrUniformBySemantic(this.gltf, 'NORMAL');
+
+ if (this.releaseGltfJson) {
+ releaseCachedGltf(this);
+ }
+ }
+ }
+
+ var classification = isClassification(this, frameState);
+ var displayConditionPassed = defined(this.distanceDisplayCondition) ? distanceDisplayConditionVisible(this, frameState) : true;
+ var show = this.show && displayConditionPassed && (this.scale !== 0.0);
+
+ if ((show && this._state === ModelState.LOADED) || justLoaded) {
+ this._dirty = false;
+ var modelMatrix = this.modelMatrix;
+
+ var modeChanged = frameState.mode !== this._mode;
+ this._mode = frameState.mode;
+
+ // Model's model matrix needs to be updated
+ var modelTransformChanged = !Matrix4.equals(this._modelMatrix, modelMatrix) ||
+ (this._scale !== this.scale) ||
+ (this._minimumPixelSize !== this.minimumPixelSize) || (this.minimumPixelSize !== 0.0) || // Minimum pixel size changed or is enabled
+ (this._maximumScale !== this.maximumScale) ||
+ (this._heightReference !== this.heightReference) || this._heightChanged ||
+ modeChanged;
+
+ if (modelTransformChanged || justLoaded) {
+ Matrix4.clone(modelMatrix, this._modelMatrix);
+
+ updateClamping(this);
+
+ if (defined(this._clampedModelMatrix)) {
+ modelMatrix = this._clampedModelMatrix;
+ }
+
+ this._scale = this.scale;
+ this._minimumPixelSize = this.minimumPixelSize;
+ this._maximumScale = this.maximumScale;
+ this._heightReference = this.heightReference;
+ this._heightChanged = false;
+
+ var scale = getScale(this, frameState);
+ var computedModelMatrix = this._computedModelMatrix;
+ Matrix4.multiplyByUniformScale(modelMatrix, scale, computedModelMatrix);
+ if (this._upAxis === Axis.Y) {
+ Matrix4.multiplyTransformation(computedModelMatrix, Axis.Y_UP_TO_Z_UP, computedModelMatrix);
+ } else if (this._upAxis === Axis.X) {
+ Matrix4.multiplyTransformation(computedModelMatrix, Axis.X_UP_TO_Z_UP, computedModelMatrix);
+ }
+ }
+
+ // Update modelMatrix throughout the graph as needed
+ if (modelTransformChanged || justLoaded) {
+ updateNodeHierarchyModelMatrix(this, modelTransformChanged, justLoaded, frameState.mapProjection);
+ this._dirty = true;
+ }
+
+ if (this._perNodeShowDirty) {
+ this._perNodeShowDirty = false;
+ updatePerNodeShow(this);
+ }
+ updatePickIds(this, context);
+ updateWireframe(this);
+ updateShowBoundingVolume(this);
+ updateClassification(this, frameState);
+ }
+
+ if (justLoaded) {
+ // Called after modelMatrix update.
+ var model = this;
+ frameState.afterRender.push(function() {
+ model._ready = true;
+ model._readyPromise.resolve(model);
+ });
+ return;
+ }
+
+ // We don't check show at the top of the function since we
+ // want to be able to progressively load models when they are not shown,
+ // and then have them visible immediately when show is set to true.
+ if (show && !this._ignoreCommands) {
+ // PERFORMANCE_IDEA: This is terrible
+ var commandList = frameState.commandList;
+ var passes = frameState.passes;
+ var nodeCommands = this._nodeCommands;
+ var length = nodeCommands.length;
+ var i;
+ var nc;
+
+ var idl2D = frameState.mapProjection.ellipsoid.maximumRadius * CesiumMath.PI;
+ var boundingVolume;
+
+ if (passes.render) {
+ if (!classification) {
+ for (i = 0; i < length; ++i) {
+ nc = nodeCommands[i];
+ if (nc.show) {
+ var command = nc.command;
+ commandList.push(command);
+ boundingVolume = nc.command.boundingVolume;
+ if (frameState.mode === SceneMode.SCENE2D &&
+ (boundingVolume.center.y + boundingVolume.radius > idl2D || boundingVolume.center.y - boundingVolume.radius < idl2D)) {
+ var command2D = nc.command2D;
+ commandList.push(command2D);
+ }
+ }
+ }
+ } else {
+ for (i = 0; i < length; ++i) {
+ nc = nodeCommands[i];
+ if (nc.show) {
+ var originalCommand = nc.command;
+ boundingVolume = originalCommand.boundingVolume;
+ if (frameState.mode === SceneMode.SCENE2D &&
+ (boundingVolume.center.y + boundingVolume.radius > idl2D || boundingVolume.center.y - boundingVolume.radius < idl2D)) {
+ commandList.push(nc.classificationPreloadCommand2D);
+ commandList.push(nc.classificationStencilCommand2D);
+ commandList.push(nc.classificationColorCommand2D);
+ } else {
+ commandList.push(nc.classificationPreloadCommand);
+ commandList.push(nc.classificationStencilCommand);
+ commandList.push(nc.classificationColorCommand);
+ }
+ }
+ }
+ }
+ }
+
+ if (passes.pick && this.allowPicking) {
+ for (i = 0; i < length; ++i) {
+ nc = nodeCommands[i];
+ if (nc.show) {
+ var pickCommand = nc.pickCommand;
+ commandList.push(pickCommand);
+
+ boundingVolume = pickCommand.boundingVolume;
+ if (frameState.mode === SceneMode.SCENE2D &&
+ (boundingVolume.center.y + boundingVolume.radius > idl2D || boundingVolume.center.y - boundingVolume.radius < idl2D)) {
+ commandList.push(nc.pickCommand2D);
+ }
+ }
+ }
+ }
+ }
+ };
+
+ /**
+ * Returns true if this object was destroyed; otherwise, false.
+ *
+ * If this object was destroyed, it should not be used; calling any function other than
+ * isDestroyed
will result in a {@link DeveloperError} exception.
+ *
+ * @returns {Boolean} true
if this object was destroyed; otherwise, false
.
+ *
+ * @see Model#destroy
+ */
+ Model.prototype.isDestroyed = function() {
+ return false;
+ };
+
+ /**
+ * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
+ * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
+ *
+ * Once an object is destroyed, it should not be used; calling any function other than
+ * isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
+ * assign the return value (undefined
) to the object as done in the example.
+ *
+ * @returns {undefined}
+ *
+ * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
+ *
+ *
+ * @example
+ * model = model && model.destroy();
+ *
+ * @see Model#isDestroyed
+ */
+ Model.prototype.destroy = function() {
+ // Vertex arrays are unique to this model, destroy here.
+ if (defined(this._precreatedAttributes)) {
+ destroy(this._rendererResources.vertexArrays);
+ }
+
+ if (defined(this._removeUpdateHeightCallback)) {
+ this._removeUpdateHeightCallback();
+ this._removeUpdateHeightCallback = undefined;
+ }
+
+ if (defined(this._terrainProviderChangedCallback)) {
+ this._terrainProviderChangedCallback();
+ this._terrainProviderChangedCallback = undefined;
+ }
+
+ this._rendererResources = undefined;
+ this._cachedRendererResources = this._cachedRendererResources && this._cachedRendererResources.release();
+
+ var pickIds = this._pickIds;
+ var length = pickIds.length;
+ for (var i = 0; i < length; ++i) {
+ pickIds[i].destroy();
+ }
+
+ releaseCachedGltf(this);
+
+ return destroyObject(this);
+ };
+
+ return Model;
+});
diff --git a/Source/Scene/Model.js b/Source/Scene/Model.js
index 5cf25fad7c33..c7cca1194ef6 100644
--- a/Source/Scene/Model.js
+++ b/Source/Scene/Model.js
@@ -63,9 +63,7 @@ define([
'./AttributeType',
'./Axis',
'./BlendingState',
- './ClassificationType',
'./ColorBlendMode',
- './DepthFunction',
'./getAttributeOrUniformBySemantic',
'./HeightReference',
'./JobType',
@@ -75,9 +73,7 @@ define([
'./ModelMesh',
'./ModelNode',
'./SceneMode',
- './ShadowMode',
- './StencilFunction',
- './StencilOperation'
+ './ShadowMode'
], function(
BoundingSphere,
Cartesian2,
@@ -143,9 +139,7 @@ define([
AttributeType,
Axis,
BlendingState,
- ClassificationType,
ColorBlendMode,
- DepthFunction,
getAttributeOrUniformBySemantic,
HeightReference,
JobType,
@@ -155,9 +149,7 @@ define([
ModelMesh,
ModelNode,
SceneMode,
- ShadowMode,
- StencilFunction,
- StencilOperation) {
+ ShadowMode) {
'use strict';
// Bail out if the browser doesn't support typed arrays, to prevent the setup function
@@ -435,9 +427,6 @@ define([
*/
this.silhouetteSize = defaultValue(options.silhouetteSize, 0.0);
- this.classificationType = options.classificationType;
- this._classificationType = undefined;
-
/**
* The 4x4 transformation matrix that transforms the model from model to world coordinates.
* When this is the identity matrix, the model is drawn in world coordinates, i.e., Earth's WGS84 coordinates.
@@ -627,7 +616,6 @@ define([
this._precreatedAttributes = options.precreatedAttributes;
this._vertexShaderLoaded = options.vertexShaderLoaded;
this._fragmentShaderLoaded = options.fragmentShaderLoaded;
- this._classificationShaderLoaded = options.classificationShaderLoaded;
this._uniformMapLoaded = options.uniformMapLoaded;
this._pickVertexShaderLoaded = options.pickVertexShaderLoaded;
this._pickFragmentShaderLoaded = options.pickFragmentShaderLoaded;
@@ -684,7 +672,6 @@ define([
programs : {},
pickPrograms : {},
silhouettePrograms : {},
- classificationPrograms : {},
textures : {},
samplers : {},
renderStates : {}
@@ -3525,14 +3512,7 @@ define([
silhouetteColorCommand2D : undefined,
// Generated on demand when color alpha is less than 1.0
translucentCommand : undefined,
- translucentCommand2D : undefined,
- // Generated on demand when the model is set as a classifier
- classificationPreloadCommand : undefined,
- classificationStencilCommand : undefined,
- classificationColorCommand : undefined,
- classificationPreloadCommand2D : undefined,
- classificationStencilCommand2D : undefined,
- classificationColorCommand2D : undefined
+ translucentCommand2D : undefined
};
runtimeNode.commands.push(nodeCommand);
nodeCommands.push(nodeCommand);
@@ -3676,7 +3656,6 @@ define([
resources.programs = cachedResources.programs;
resources.pickPrograms = cachedResources.pickPrograms;
resources.silhouettePrograms = cachedResources.silhouettePrograms;
- resources.classificationPrograms = cachedResources.classificationPrograms;
resources.textures = cachedResources.textures;
resources.samplers = cachedResources.samplers;
resources.renderStates = cachedResources.renderStates;
@@ -4061,10 +4040,6 @@ define([
return silhouetteSupported(frameState.context) && (model.silhouetteSize > 0.0) && (model.silhouetteColor.alpha > 0.0) && defined(model._normalAttributeName);
}
- function isClassification(model, frameState) {
- return frameState.context.stencilBuffer && defined(model.classificationType);
- }
-
function hasTranslucentCommands(model) {
var nodeCommands = model._nodeCommands;
var length = nodeCommands.length;
@@ -4236,218 +4211,6 @@ define([
}
}
- var stencilMask = 0x0F;
- var stencilReference = 0;
-
- var classificationPreloadRS = {
- colorMask : {
- red : false,
- green : false,
- blue : false,
- alpha : false
- },
- stencilTest : {
- enabled : true,
- frontFunction : StencilFunction.ALWAYS,
- frontOperation : {
- fail : StencilOperation.KEEP,
- zFail : StencilOperation.DECREMENT_WRAP,
- zPass : StencilOperation.DECREMENT_WRAP
- },
- backFunction : StencilFunction.ALWAYS,
- backOperation : {
- fail : StencilOperation.KEEP,
- zFail : StencilOperation.INCREMENT_WRAP,
- zPass : StencilOperation.INCREMENT_WRAP
- },
- reference : stencilReference,
- mask : stencilMask
- },
- depthTest : {
- enabled : false
- },
- depthMask : false
- };
-
- var classificationStencilRS = {
- colorMask : {
- red : false,
- green : false,
- blue : false,
- alpha : false
- },
- stencilTest : {
- enabled : true,
- frontFunction : StencilFunction.ALWAYS,
- frontOperation : {
- fail : StencilOperation.KEEP,
- zFail : StencilOperation.KEEP,
- zPass : StencilOperation.INCREMENT_WRAP
- },
- backFunction : StencilFunction.ALWAYS,
- backOperation : {
- fail : StencilOperation.KEEP,
- zFail : StencilOperation.KEEP,
- zPass : StencilOperation.DECREMENT_WRAP
- },
- reference : stencilReference,
- mask : stencilMask
- },
- depthTest : {
- enabled : true,
- func : DepthFunction.LESS_OR_EQUAL
- },
- depthMask : false
- };
-
- var classificationColorRS = {
- stencilTest : {
- enabled : true,
- frontFunction : StencilFunction.NOT_EQUAL,
- frontOperation : {
- fail : StencilOperation.KEEP,
- zFail : StencilOperation.KEEP,
- zPass : StencilOperation.DECREMENT_WRAP
- },
- backFunction : StencilFunction.NOT_EQUAL,
- backOperation : {
- fail : StencilOperation.KEEP,
- zFail : StencilOperation.KEEP,
- zPass : StencilOperation.DECREMENT_WRAP
- },
- reference : stencilReference,
- mask : stencilMask
- },
- depthTest : {
- enabled : false
- },
- depthMask : false,
- blending : BlendingState.ALPHA_BLEND
- };
-
- function createClassificationProgram(model, id, program, frameState) {
- var vs = program.vertexShaderSource;
- var attributeLocations = program._attributeLocations;
- var fs =
- 'void main() \n' +
- '{ \n' +
- ' gl_FragColor = vec4(1.0); \n' +
- '}';
-
- fs = modifyShader(fs, id, model._classificationShaderLoaded);
-
- return ShaderProgram.fromCache({
- context : frameState.context,
- vertexShaderSource : vs,
- fragmentShaderSource : fs,
- attributeLocations : attributeLocations
- });
- }
-
- function createClassificationCommands(model, frameState) {
- var scene3DOnly = frameState.scene3DOnly;
- var classificationPrograms = model._rendererResources.classificationPrograms;
- var nodeCommands = model._nodeCommands;
- var length = nodeCommands.length;
- for (var i = 0; i < length; ++i) {
- var nodeCommand = nodeCommands[i];
- var command = nodeCommand.command;
-
- var program = command.shaderProgram;
- var id = getProgramId(model, program);
- var classificationProgram = classificationPrograms[id];
- if (!defined(classificationProgram)) {
- classificationProgram = createClassificationProgram(model, id, program, frameState);
- classificationPrograms[id] = classificationProgram;
- }
-
- var preloadCommand = DrawCommand.shallowClone(command);
- preloadCommand.renderState = RenderState.fromCache(classificationPreloadRS);
- preloadCommand.shaderProgram = classificationProgram;
- preloadCommand.castShadows = false;
- preloadCommand.receiveShadows = false;
- nodeCommand.classificationPreloadCommand = preloadCommand;
-
- var stencilCommand = DrawCommand.shallowClone(command);
- stencilCommand.renderState = RenderState.fromCache(classificationStencilRS);
- stencilCommand.shaderProgram = classificationProgram;
- stencilCommand.castShadows = false;
- stencilCommand.receiveShadows = false;
- nodeCommand.classificationStencilCommand = stencilCommand;
-
- var colorCommand = DrawCommand.shallowClone(command);
- colorCommand.renderState = RenderState.fromCache(classificationColorRS);
- colorCommand.shaderProgram = classificationProgram;
- colorCommand.castShadows = false;
- colorCommand.receiveShadows = false;
- nodeCommand.classificationColorCommand = colorCommand;
-
- if (!scene3DOnly) {
- var command2D = nodeCommand.command2D;
- var preloadCommand2D = DrawCommand.shallowClone(preloadCommand);
- preloadCommand2D.boundingVolume = command2D.boundingVolume;
- preloadCommand2D.modelMatrix = command2D.modelMatrix;
- nodeCommand.classificationPreloadCommand2D = preloadCommand2D;
-
- var stencilCommand2D = DrawCommand.shallowClone(stencilCommand);
- stencilCommand2D.boundingVolume = command2D.boundingVolume;
- stencilCommand2D.modelMatrix = command2D.modelMatrix;
- nodeCommand.classificationStencilCommand2D = stencilCommand2D;
-
- var colorCommand2D = DrawCommand.shallowClone(colorCommand);
- colorCommand2D.boundingVolume = command2D.boundingVolume;
- colorCommand2D.modelMatrix = command2D.modelMatrix;
- nodeCommand.classificationColorCommand2D = colorCommand2D;
- }
- }
- }
-
- function updateClassification(model, frameState) {
- var dirty = model._classificationType !== model.classificationType || model._dirty;
- model._classificationType = model.classificationType;
-
- if (!isClassification(model, frameState)) {
- return;
- }
-
- var nodeCommands = model._nodeCommands;
- if (!defined(nodeCommands[0].classificationPreloadCommand)) {
- createClassificationCommands(model, frameState);
- }
-
- if (!dirty) {
- return;
- }
-
- var pass;
- switch (model._classificationType) {
- case ClassificationType.TERRAIN:
- pass = Pass.TERRAIN_CLASSIFICATION;
- break;
- case ClassificationType.CESIUM_3D_TILE:
- pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;
- break;
- default:
- pass = Pass.CLASSIFICATION;
- }
-
- var scene3DOnly = frameState.scene3DOnly;
- var length = nodeCommands.length;
- for (var i = 0; i < length; ++i) {
- var nodeCommand = nodeCommands[i];
-
- nodeCommand.classificationPreloadCommand.pass = pass;
- nodeCommand.classificationStencilCommand.pass = pass;
- nodeCommand.classificationColorCommand.pass = pass;
-
- if (!scene3DOnly) {
- nodeCommand.classificationPreloadCommand2D.pass = pass;
- nodeCommand.classificationStencilCommand2D.pass = pass;
- nodeCommand.classificationColorCommand2D.pass = pass;
- }
- }
- }
-
var scratchBoundingSphere = new BoundingSphere();
function scaleInPixels(positionWC, radius, frameState) {
@@ -4543,7 +4306,6 @@ define([
this.programs = undefined;
this.pickPrograms = undefined;
this.silhouettePrograms = undefined;
- this.classificationPrograms = undefined;
this.textures = undefined;
this.samplers = undefined;
this.renderStates = undefined;
@@ -4568,7 +4330,6 @@ define([
destroy(resources.programs);
destroy(resources.pickPrograms);
destroy(resources.silhouettePrograms);
- destroy(resources.classificationPrograms);
destroy(resources.textures);
}
@@ -4826,7 +4587,6 @@ define([
cachedResources.programs = resources.programs;
cachedResources.pickPrograms = resources.pickPrograms;
cachedResources.silhouettePrograms = resources.silhouettePrograms;
- cachedResources.classificationPrograms = resources.classificationPrograms;
cachedResources.textures = resources.textures;
cachedResources.samplers = resources.samplers;
cachedResources.renderStates = resources.renderStates;
@@ -4849,9 +4609,8 @@ define([
var silhouette = hasSilhouette(this, frameState);
var translucent = isTranslucent(this);
var invisible = isInvisible(this);
- var classification = isClassification(this, frameState);
var displayConditionPassed = defined(this.distanceDisplayCondition) ? distanceDisplayConditionVisible(this, frameState) : true;
- var show = this.show && displayConditionPassed && (this.scale !== 0.0) && (!invisible || silhouette || classification);
+ var show = this.show && displayConditionPassed && (this.scale !== 0.0) && (!invisible || silhouette);
if ((show && this._state === ModelState.LOADED) || justLoaded) {
var animated = this.activeAnimations.update(frameState) || this._cesiumAnimationsDirty;
@@ -4916,7 +4675,6 @@ define([
updateShadows(this);
updateColor(this, frameState);
updateSilhouette(this, frameState);
- updateClassification(this, frameState);
}
if (justLoaded) {
@@ -4945,52 +4703,32 @@ define([
var boundingVolume;
if (passes.render) {
- if (!classification) {
- for (i = 0; i < length; ++i) {
- nc = nodeCommands[i];
- if (nc.show) {
- var command = translucent ? nc.translucentCommand : nc.command;
- command = silhouette ? nc.silhouetteModelCommand : command;
- commandList.push(command);
- boundingVolume = nc.command.boundingVolume;
- if (frameState.mode === SceneMode.SCENE2D &&
- (boundingVolume.center.y + boundingVolume.radius > idl2D || boundingVolume.center.y - boundingVolume.radius < idl2D)) {
- var command2D = translucent ? nc.translucentCommand2D : nc.command2D;
- command2D = silhouette ? nc.silhouetteModelCommand2D : command2D;
- commandList.push(command2D);
- }
+ for (i = 0; i < length; ++i) {
+ nc = nodeCommands[i];
+ if (nc.show) {
+ var command = translucent ? nc.translucentCommand : nc.command;
+ command = silhouette ? nc.silhouetteModelCommand : command;
+ commandList.push(command);
+ boundingVolume = nc.command.boundingVolume;
+ if (frameState.mode === SceneMode.SCENE2D &&
+ (boundingVolume.center.y + boundingVolume.radius > idl2D || boundingVolume.center.y - boundingVolume.radius < idl2D)) {
+ var command2D = translucent ? nc.translucentCommand2D : nc.command2D;
+ command2D = silhouette ? nc.silhouetteModelCommand2D : command2D;
+ commandList.push(command2D);
}
}
+ }
- if (silhouette) {
- // Render second silhouette pass
- for (i = 0; i < length; ++i) {
- nc = nodeCommands[i];
- if (nc.show) {
- commandList.push(nc.silhouetteColorCommand);
- boundingVolume = nc.command.boundingVolume;
- if (frameState.mode === SceneMode.SCENE2D &&
- (boundingVolume.center.y + boundingVolume.radius > idl2D || boundingVolume.center.y - boundingVolume.radius < idl2D)) {
- commandList.push(nc.silhouetteColorCommand2D);
- }
- }
- }
- }
- } else {
+ if (silhouette) {
+ // Render second silhouette pass
for (i = 0; i < length; ++i) {
nc = nodeCommands[i];
if (nc.show) {
- var originalCommand = nc.command;
- boundingVolume = originalCommand.boundingVolume;
+ commandList.push(nc.silhouetteColorCommand);
+ boundingVolume = nc.command.boundingVolume;
if (frameState.mode === SceneMode.SCENE2D &&
(boundingVolume.center.y + boundingVolume.radius > idl2D || boundingVolume.center.y - boundingVolume.radius < idl2D)) {
- commandList.push(nc.classificationPreloadCommand2D);
- commandList.push(nc.classificationStencilCommand2D);
- commandList.push(nc.classificationColorCommand2D);
- } else {
- commandList.push(nc.classificationPreloadCommand);
- commandList.push(nc.classificationStencilCommand);
- commandList.push(nc.classificationColorCommand);
+ commandList.push(nc.silhouetteColorCommand2D);
}
}
}
From f1ab457eb4711d57edbb54ea30703afb62e4fbf1 Mon Sep 17 00:00:00 2001
From: Dan Bagnell
Date: Mon, 4 Dec 2017 14:59:23 -0500
Subject: [PATCH 05/51] Remove unneeded code.
---
Source/Scene/ClassificationModel.js | 57 ++---------------------------
1 file changed, 3 insertions(+), 54 deletions(-)
diff --git a/Source/Scene/ClassificationModel.js b/Source/Scene/ClassificationModel.js
index 32145c0dd411..d5821ffd8b6b 100644
--- a/Source/Scene/ClassificationModel.js
+++ b/Source/Scene/ClassificationModel.js
@@ -188,17 +188,7 @@ define([
this.shaders = {};
this.pendingShaderLoads = 0;
- this.texturesToCreate = new Queue();
- this.pendingTextureLoads = 0;
-
- this.texturesToCreateFromBufferView = new Queue();
- this.pendingBufferViewToImage = 0;
-
- this.createSamplers = true;
- this.createSkins = true;
- this.createRuntimeAnimations = true;
this.createVertexArrays = true;
- this.createRenderStates = true;
this.createUniformMaps = true;
this.createRuntimeNodes = true;
@@ -223,15 +213,6 @@ define([
return ((this.pendingShaderLoads === 0) && (this.programsToCreate.length === 0));
};
- LoadResources.prototype.finishedTextureCreation = function() {
- var finishedPendingLoads = (this.pendingTextureLoads === 0);
- var finishedResourceCreation =
- (this.texturesToCreate.length === 0) &&
- (this.texturesToCreateFromBufferView.length === 0);
-
- return finishedPendingLoads && finishedResourceCreation;
- };
-
LoadResources.prototype.finishedEverythingButTextureCreation = function() {
var finishedPendingLoads =
(this.pendingBufferLoads === 0) &&
@@ -239,14 +220,13 @@ define([
var finishedResourceCreation =
(this.vertexBuffersToCreate.length === 0) &&
(this.indexBuffersToCreate.length === 0) &&
- (this.programsToCreate.length === 0) &&
- (this.pendingBufferViewToImage === 0);
+ (this.programsToCreate.length === 0);
return finishedPendingLoads && finishedResourceCreation;
};
LoadResources.prototype.finished = function() {
- return this.finishedTextureCreation() && this.finishedEverythingButTextureCreation();
+ return this.finishedEverythingButTextureCreation();
};
///////////////////////////////////////////////////////////////////////////
@@ -332,10 +312,8 @@ define([
* @param {Number} [options.maximumScale] The maximum scale size of a model. An upper limit for minimumPixelSize.
* @param {Object} [options.id] A user-defined object to return when the model is picked with {@link Scene#pick}.
* @param {Boolean} [options.allowPicking=true] When true
, each glTF mesh and primitive is pickable with {@link Scene#pick}.
- * @param {Boolean} [options.incrementallyLoadTextures=true] Determine if textures may continue to stream in after the model is loaded.
* @param {Boolean} [options.asynchronous=true] Determines if model WebGL resource creation will be spread out over several frames or block until completion once all glTF files are loaded.
* @param {Boolean} [options.clampAnimations=true] Determines if the model's animations should hold a pose over frames where no keyframes are specified.
- * @param {ShadowMode} [options.shadows=ShadowMode.ENABLED] Determines whether the model casts or receives shadows from each light source.
* @param {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Draws the bounding sphere for each draw command in the model.
* @param {Boolean} [options.debugWireframe=false] For debugging only. Draws the model in wireframe.
* @param {HeightReference} [options.heightReference] Determines how the model is drawn relative to terrain.
@@ -344,8 +322,6 @@ define([
* @param {Color} [options.color=Color.WHITE] A color that blends with the model's rendered color.
* @param {ColorBlendMode} [options.colorBlendMode=ColorBlendMode.HIGHLIGHT] Defines how the color blends with the model.
* @param {Number} [options.colorBlendAmount=0.5] Value used to determine the color strength when the colorBlendMode
is MIX
. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two.
- * @param {Color} [options.silhouetteColor=Color.RED] The silhouette color. If more than 256 models have silhouettes enabled, there is a small chance that overlapping models will have minor artifacts.
- * @param {Number} [options.silhouetteSize=0.0] The size of the silhouette in pixels.
*
* @exception {DeveloperError} bgltf is not a valid Binary glTF file.
* @exception {DeveloperError} Only glTF Binary version 1 is supported.
@@ -360,7 +336,6 @@ define([
var cacheKey = options.cacheKey;
this._cacheKey = cacheKey;
this._cachedGltf = undefined;
- this._releaseGltfJson = defaultValue(options.releaseGltfJson, false);
var cachedGltf;
if (defined(cacheKey) && defined(gltfCache[cacheKey]) && gltfCache[cacheKey].ready) {
@@ -672,29 +647,6 @@ define([
}
},
- /**
- * When true
, the glTF JSON is not stored with the model once the model is
- * loaded (when {@link Model#ready} is true
). This saves memory when
- * geometry, textures, and animations are embedded in the .gltf file, which is the
- * default for the {@link http://cesiumjs.org/convertmodel.html|Cesium model converter}.
- * This is especially useful for cases like 3D buildings, where each .gltf model is unique
- * and caching the glTF JSON is not effective.
- *
- * @memberof Model.prototype
- *
- * @type {Boolean}
- * @readonly
- *
- * @default false
- *
- * @private
- */
- releaseGltfJson : {
- get : function() {
- return this._releaseGltfJson;
- }
- },
-
/**
* The key identifying this model in the model cache for glTF JSON, renderer resources, and animations.
* Caching saves memory and improves loading speed when several models with the same url are created.
@@ -3596,10 +3548,7 @@ define([
// The normal attribute name is required for silhouettes, so get it before the gltf JSON is released
this._normalAttributeName = getAttributeOrUniformBySemantic(this.gltf, 'NORMAL');
-
- if (this.releaseGltfJson) {
- releaseCachedGltf(this);
- }
+ releaseCachedGltf(this);
}
}
From 33ff56e40593f27a41585d886038ba72b1906969 Mon Sep 17 00:00:00 2001
From: Dan Bagnell
Date: Mon, 4 Dec 2017 16:36:17 -0500
Subject: [PATCH 06/51] Only create classification commands. Only create basic
vertex and fragment shaders.
---
Source/Scene/Batched3DModel3DTileContent.js | 5 -
Source/Scene/ClassificationModel.js | 563 ++++++++------------
2 files changed, 218 insertions(+), 350 deletions(-)
diff --git a/Source/Scene/Batched3DModel3DTileContent.js b/Source/Scene/Batched3DModel3DTileContent.js
index 05dacde8888b..6c6d58c54edd 100644
--- a/Source/Scene/Batched3DModel3DTileContent.js
+++ b/Source/Scene/Batched3DModel3DTileContent.js
@@ -393,23 +393,18 @@ define([
content._model = new ClassificationModel({
gltf : gltfView,
cull : false, // The model is already culled by 3D Tiles
- releaseGltfJson : true, // Models are unique and will not benefit from caching so save memory
opaquePass : Pass.CESIUM_3D_TILE, // Draw opaque portions of the model during the 3D Tiles pass
basePath : basePath,
requestType : RequestType.TILES3D,
modelMatrix : tile.computedTransform,
upAxis : tileset._gltfUpAxis,
- shadows : tileset.shadows,
debugWireframe : tileset.debugWireframe,
- incrementallyLoadTextures : false,
vertexShaderLoaded : getVertexShaderCallback(content),
- fragmentShaderLoaded : getFragmentShaderCallback(content),
classificationShaderLoaded : getClassificationFragmentShaderCallback(content),
uniformMapLoaded : batchTable.getUniformMapCallback(),
pickVertexShaderLoaded : getPickVertexShaderCallback(content),
pickFragmentShaderLoaded : batchTable.getPickFragmentShaderCallback(),
pickUniformMapLoaded : batchTable.getPickUniformMapCallback(),
- addBatchIdToGeneratedShaders : (batchLength > 0), // If the batch table has values in it, generated shaders will need a batchId attribute
pickObject : pickObject
});
}
diff --git a/Source/Scene/ClassificationModel.js b/Source/Scene/ClassificationModel.js
index d5821ffd8b6b..6a9168e0c55f 100644
--- a/Source/Scene/ClassificationModel.js
+++ b/Source/Scene/ClassificationModel.js
@@ -556,7 +556,6 @@ define([
this._addBatchIdToGeneratedShaders = options.addBatchIdToGeneratedShaders;
this._precreatedAttributes = options.precreatedAttributes;
this._vertexShaderLoaded = options.vertexShaderLoaded;
- this._fragmentShaderLoaded = options.fragmentShaderLoaded;
this._classificationShaderLoaded = options.classificationShaderLoaded;
this._uniformMapLoaded = options.uniformMapLoaded;
this._pickVertexShaderLoaded = options.pickVertexShaderLoaded;
@@ -1748,39 +1747,6 @@ define([
return shader;
}
- function modifyShaderForColor(shader, premultipliedAlpha) {
- shader = ShaderSource.replaceMain(shader, 'gltf_blend_main');
- shader +=
- 'uniform vec4 gltf_color; \n' +
- 'uniform float gltf_colorBlend; \n' +
- 'void main() \n' +
- '{ \n' +
- ' gltf_blend_main(); \n';
-
- // Un-premultiply the alpha so that blending is correct.
-
- // Avoid divide-by-zero. The code below is equivalent to:
- // if (gl_FragColor.a > 0.0)
- // {
- // gl_FragColor.rgb /= gl_FragColor.a;
- // }
-
- if (premultipliedAlpha) {
- shader +=
- ' float alpha = 1.0 - ceil(gl_FragColor.a) + gl_FragColor.a; \n' +
- ' gl_FragColor.rgb /= alpha; \n';
- }
-
- shader +=
- ' gl_FragColor.rgb = mix(gl_FragColor.rgb, gltf_color.rgb, gltf_colorBlend); \n' +
- ' float highlight = ceil(gltf_colorBlend); \n' +
- ' gl_FragColor.rgb *= mix(gltf_color.rgb, vec3(1.0), highlight); \n' +
- ' gl_FragColor.a *= gltf_color.a; \n' +
- '} \n';
-
- return shader;
- }
-
function modifyShader(shader, programName, callback) {
if (defined(callback)) {
shader = callback(shader, programName);
@@ -1790,32 +1756,52 @@ define([
function createProgram(id, model, context) {
var programs = model.gltf.programs;
- var shaders = model.gltf.shaders;
var program = programs[id];
var attributeLocations = createAttributeLocations(model, program.attributes);
- var vs = shaders[program.vertexShader].extras._pipeline.source;
- var fs = shaders[program.fragmentShader].extras._pipeline.source;
- // Add pre-created attributes to attributeLocations
- var attributesLength = program.attributes.length;
- var precreatedAttributes = model._precreatedAttributes;
- if (defined(precreatedAttributes)) {
- for (var attrName in precreatedAttributes) {
- if (precreatedAttributes.hasOwnProperty(attrName)) {
- attributeLocations[attrName] = attributesLength++;
- }
+ var positionName = getAttributeOrUniformBySemantic(model.gltf, 'POSITION');
+ var batchIdName = getAttributeOrUniformBySemantic(model.gltf, '_BATCHID');
+ var modelViewProjectionName = getAttributeOrUniformBySemantic(model.gltf, 'MODELVIEWPROJECTION');
+
+ var uniformDecl;
+ var computePosition;
+
+ if (!defined(modelViewProjectionName)) {
+ var projectionName = getAttributeOrUniformBySemantic(model.gltf, 'PROJECTION');
+ var modelViewName = getAttributeOrUniformBySemantic(model.gltf, 'MODELVIEW');
+ if (!defined(modelViewName)) {
+ modelViewName = getAttributeOrUniformBySemantic(model.gltf, 'CESIUM_RTC_MODELVIEW');
}
+
+ uniformDecl =
+ 'uniform mat4 ' + modelViewName + ';\n' +
+ 'uniform mat4 ' + projectionName + ';\n';
+ computePosition = ' gl_Position = ' + projectionName + ' * ' + modelViewName + ' * ' + positionName + ';\n';
+ } else {
+ uniformDecl = 'uniform mat4 ' + modelViewProjectionName + ';\n';
+ computePosition = ' gl_Position = ' + modelViewProjectionName + ' * ' + positionName + ';\n';
}
+ var vs =
+ 'attribute vec4 ' + positionName + ';\n' +
+ 'attribute float ' + batchIdName + ';\n' +
+ uniformDecl +
+ 'void main() {\n' +
+ computePosition +
+ '}\n';
+ var fs =
+ 'void main() \n' +
+ '{ \n' +
+ ' gl_FragColor = vec4(1.0); \n' +
+ '}';
+
if (model.extensionsUsed.WEB3D_quantized_attributes) {
vs = modifyShaderForQuantizedAttributes(vs, id, model, context);
}
- var blendFS = modifyShaderForColor(fs, false);
-
var drawVS = modifyShader(vs, id, model._vertexShaderLoaded);
- var drawFS = modifyShader(blendFS, id, model._fragmentShaderLoaded);
+ var drawFS = modifyShader(fs, id, model._classificationShaderLoaded);
model._rendererResources.programs[id] = ShaderProgram.fromCache({
context : context,
@@ -1829,10 +1815,6 @@ define([
var pickVS = modifyShader(vs, id, model._pickVertexShaderLoaded);
var pickFS = modifyShader(fs, id, model._pickFragmentShaderLoaded);
- if (!model._pickFragmentShaderLoaded) {
- pickFS = ShaderSource.createPickFragmentShaderSource(fs, 'uniform');
- }
-
model._rendererResources.pickPrograms[id] = ShaderProgram.fromCache({
context : context,
vertexShaderSource : pickVS,
@@ -2452,18 +2434,6 @@ define([
};
}
- function createColorFunction(model) {
- return function() {
- return model.color;
- };
- }
-
- function createColorBlendFunction(model) {
- return function() {
- return ColorBlendMode.getColorBlend(model.colorBlendMode, model.colorBlendAmount);
- };
- }
-
function triangleCountFromPrimitiveIndices(primitive, indicesCount) {
switch (primitive.mode) {
case PrimitiveType.TRIANGLES:
@@ -2476,6 +2446,119 @@ define([
}
}
+ var stencilMask = 0x0F;
+ var stencilReference = 0;
+
+ var classificationPreloadRS = {
+ colorMask : {
+ red : false,
+ green : false,
+ blue : false,
+ alpha : false
+ },
+ stencilTest : {
+ enabled : true,
+ frontFunction : StencilFunction.ALWAYS,
+ frontOperation : {
+ fail : StencilOperation.KEEP,
+ zFail : StencilOperation.DECREMENT_WRAP,
+ zPass : StencilOperation.DECREMENT_WRAP
+ },
+ backFunction : StencilFunction.ALWAYS,
+ backOperation : {
+ fail : StencilOperation.KEEP,
+ zFail : StencilOperation.INCREMENT_WRAP,
+ zPass : StencilOperation.INCREMENT_WRAP
+ },
+ reference : stencilReference,
+ mask : stencilMask
+ },
+ depthTest : {
+ enabled : false
+ },
+ depthMask : false
+ };
+
+ var classificationStencilRS = {
+ colorMask : {
+ red : false,
+ green : false,
+ blue : false,
+ alpha : false
+ },
+ stencilTest : {
+ enabled : true,
+ frontFunction : StencilFunction.ALWAYS,
+ frontOperation : {
+ fail : StencilOperation.KEEP,
+ zFail : StencilOperation.KEEP,
+ zPass : StencilOperation.INCREMENT_WRAP
+ },
+ backFunction : StencilFunction.ALWAYS,
+ backOperation : {
+ fail : StencilOperation.KEEP,
+ zFail : StencilOperation.KEEP,
+ zPass : StencilOperation.DECREMENT_WRAP
+ },
+ reference : stencilReference,
+ mask : stencilMask
+ },
+ depthTest : {
+ enabled : true,
+ func : DepthFunction.LESS_OR_EQUAL
+ },
+ depthMask : false
+ };
+
+ var classificationColorRS = {
+ stencilTest : {
+ enabled : true,
+ frontFunction : StencilFunction.NOT_EQUAL,
+ frontOperation : {
+ fail : StencilOperation.KEEP,
+ zFail : StencilOperation.KEEP,
+ zPass : StencilOperation.DECREMENT_WRAP
+ },
+ backFunction : StencilFunction.NOT_EQUAL,
+ backOperation : {
+ fail : StencilOperation.KEEP,
+ zFail : StencilOperation.KEEP,
+ zPass : StencilOperation.DECREMENT_WRAP
+ },
+ reference : stencilReference,
+ mask : stencilMask
+ },
+ depthTest : {
+ enabled : false
+ },
+ depthMask : false,
+ blending : BlendingState.ALPHA_BLEND
+ };
+
+ var pickRenderState = {
+ stencilTest : {
+ enabled : true,
+ frontFunction : StencilFunction.NOT_EQUAL,
+ frontOperation : {
+ fail : StencilOperation.KEEP,
+ zFail : StencilOperation.KEEP,
+ zPass : StencilOperation.DECREMENT_WRAP
+ },
+ backFunction : StencilFunction.NOT_EQUAL,
+ backOperation : {
+ fail : StencilOperation.KEEP,
+ zFail : StencilOperation.KEEP,
+ zPass : StencilOperation.DECREMENT_WRAP
+ },
+ reference : stencilReference,
+ mask : stencilMask
+ },
+ depthTest : {
+ enabled : false
+ },
+ depthMask : false
+ };
+
function createCommand(model, gltfNode, runtimeNode, context, scene3DOnly) {
var nodeCommands = model._nodeCommands;
var pickIds = model._pickIds;
@@ -2534,11 +2617,7 @@ define([
// Update model triangle count using number of indices
model._trianglesLength += triangleCountFromPrimitiveIndices(primitive, count);
- var um = uniformMaps[primitive.material];
- var uniformMap = combine(um.uniformMap, {
- gltf_color : createColorFunction(model),
- gltf_colorBlend : createColorBlendFunction(model)
- });
+ var uniformMap = uniformMaps[primitive.material].uniformMap;
// Allow callback to modify the uniformMap
if (defined(model._uniformMapLoaded)) {
@@ -2561,7 +2640,7 @@ define([
};
}
- var command = new DrawCommand({
+ var preloadCommand = new DrawCommand({
boundingVolume : new BoundingSphere(), // updated in update()
cull : model.cull,
modelMatrix : new Matrix4(), // computed in update()
@@ -2571,15 +2650,17 @@ define([
offset : offset,
shaderProgram : rendererPrograms[technique.program],
uniformMap : uniformMap,
- renderState : RenderState.fromCache({
- depthTest : {
- enabled : true
- }
- }),
+ renderState : RenderState.fromCache(classificationPreloadRS),
owner : owner,
pass : model.opaquePass
});
+ var stencilCommand = DrawCommand.shallowClone(preloadCommand);
+ stencilCommand.renderState = RenderState.fromCache(classificationStencilRS);
+
+ var colorCommand = DrawCommand.shallowClone(preloadCommand);
+ colorCommand.renderState = RenderState.fromCache(classificationColorRS);
+
var pickCommand;
if (allowPicking) {
@@ -2614,40 +2695,47 @@ define([
offset : offset,
shaderProgram : rendererPickPrograms[technique.program],
uniformMap : pickUniformMap,
- renderState : RenderState.fromCache(),
+ renderState : RenderState.fromCache(pickRenderState),
owner : owner,
pass : model.opaquePass
});
}
- var command2D;
+ var preloadCommand2D;
+ var stencilCommand2D;
+ var colorCommand2D;
var pickCommand2D;
if (!scene3DOnly) {
- command2D = DrawCommand.shallowClone(command);
- command2D.boundingVolume = new BoundingSphere(); // updated in update()
- command2D.modelMatrix = new Matrix4(); // updated in update()
+ preloadCommand2D = DrawCommand.shallowClone(preloadCommand);
+ preloadCommand2D.boundingVolume = new BoundingSphere(); // updated in update()
+ preloadCommand2D.modelMatrix = new Matrix4(); // updated in update()
+
+ stencilCommand2D = DrawCommand.shallowClone(stencilCommand);
+ stencilCommand2D.boundingVolume = preloadCommand2D.boundingVolume;
+ stencilCommand2D.modelMatrix = preloadCommand2D.modelMatrix;
+
+ colorCommand2D = DrawCommand.shallowClone(colorCommand);
+ colorCommand2D.boundingVolume = preloadCommand2D.boundingVolume;
+ colorCommand2D.modelMatrix = preloadCommand2D.modelMatrix;
if (allowPicking) {
pickCommand2D = DrawCommand.shallowClone(pickCommand);
- pickCommand2D.boundingVolume = new BoundingSphere(); // updated in update()
- pickCommand2D.modelMatrix = new Matrix4(); // updated in update()
+ pickCommand2D.boundingVolume = preloadCommand2D.boundingVolume;
+ pickCommand2D.modelMatrix = preloadCommand2D.modelMatrix;
}
}
var nodeCommand = {
show : true,
boundingSphere : boundingSphere,
- command : command,
+ preloadCommand : preloadCommand,
+ stencilCommand : stencilCommand,
+ colorCommand : colorCommand,
pickCommand : pickCommand,
- command2D : command2D,
- pickCommand2D : pickCommand2D,
- // Generated on demand when the model is set as a classifier
- classificationPreloadCommand : undefined,
- classificationStencilCommand : undefined,
- classificationColorCommand : undefined,
- classificationPreloadCommand2D : undefined,
- classificationStencilCommand2D : undefined,
- classificationColorCommand2D : undefined
+ preloadCommand2D : preloadCommand2D,
+ stencilCommand2D : stencilCommand2D,
+ colorCommand2D : colorCommand2D,
+ pickCommand2D : pickCommand2D
};
runtimeNode.commands.push(nodeCommand);
nodeCommands.push(nodeCommand);
@@ -2672,7 +2760,6 @@ define([
var gltf = model.gltf;
var nodes = gltf.nodes;
- var skins = gltf.skins;
var scene = gltf.scenes[gltf.scene];
var sceneNodes = scene.nodes;
@@ -2688,7 +2775,6 @@ define([
id : sceneNodes[i]
});
- var skeletonIds = [];
while (stack.length > 0) {
var n = stack.pop();
seen[n.id] = true;
@@ -2732,24 +2818,6 @@ define([
});
}
}
-
- var skin = gltfNode.skin;
- if (defined(skin)) {
- skeletonIds.push(skins[skin].skeleton);
- }
-
- if (stack.length === 0) {
- for (var k = 0; k < skeletonIds.length; k++) {
- var skeleton = skeletonIds[k];
- if (!seen[skeleton]) {
- stack.push({
- parentRuntimeNode : undefined,
- gltfNode : nodes[skeleton],
- id : skeleton
- });
- }
- }
- }
}
}
@@ -2843,7 +2911,7 @@ define([
// Node has meshes, which has primitives. Update their commands.
for (var j = 0; j < commandsLength; ++j) {
var primitiveCommand = commands[j];
- var command = primitiveCommand.command;
+ var command = primitiveCommand.preloadCommand;
Matrix4.clone(nodeMatrix, command.modelMatrix);
// PERFORMANCE_IDEA: Can use transformWithoutScale if no node up to the root has scale (including animation)
@@ -2863,7 +2931,7 @@ define([
// will be clipped by the viewport. We create a second command that translates the model
// model matrix to the opposite side of the map so the part that was clipped in one viewport
// is drawn in the other.
- command = primitiveCommand.command2D;
+ command = primitiveCommand.preloadCommand2D;
if (defined(command) && model._mode === SceneMode.SCENE2D) {
Matrix4.clone(nodeMatrix, command.modelMatrix);
command.modelMatrix[13] -= CesiumMath.sign(command.modelMatrix[13]) * 2.0 * CesiumMath.PI * projection.ellipsoid.maximumRadius;
@@ -2989,200 +3057,10 @@ define([
}
}
- function getProgramId(model, program) {
- var programs = model._rendererResources.programs;
- for (var id in programs) {
- if (programs.hasOwnProperty(id)) {
- if (programs[id] === program) {
- return id;
- }
- }
- }
- }
-
- function isClassification(model, frameState) {
- return frameState.context.stencilBuffer && defined(model.classificationType);
- }
-
- var stencilMask = 0x0F;
- var stencilReference = 0;
-
- var classificationPreloadRS = {
- colorMask : {
- red : false,
- green : false,
- blue : false,
- alpha : false
- },
- stencilTest : {
- enabled : true,
- frontFunction : StencilFunction.ALWAYS,
- frontOperation : {
- fail : StencilOperation.KEEP,
- zFail : StencilOperation.DECREMENT_WRAP,
- zPass : StencilOperation.DECREMENT_WRAP
- },
- backFunction : StencilFunction.ALWAYS,
- backOperation : {
- fail : StencilOperation.KEEP,
- zFail : StencilOperation.INCREMENT_WRAP,
- zPass : StencilOperation.INCREMENT_WRAP
- },
- reference : stencilReference,
- mask : stencilMask
- },
- depthTest : {
- enabled : false
- },
- depthMask : false
- };
-
- var classificationStencilRS = {
- colorMask : {
- red : false,
- green : false,
- blue : false,
- alpha : false
- },
- stencilTest : {
- enabled : true,
- frontFunction : StencilFunction.ALWAYS,
- frontOperation : {
- fail : StencilOperation.KEEP,
- zFail : StencilOperation.KEEP,
- zPass : StencilOperation.INCREMENT_WRAP
- },
- backFunction : StencilFunction.ALWAYS,
- backOperation : {
- fail : StencilOperation.KEEP,
- zFail : StencilOperation.KEEP,
- zPass : StencilOperation.DECREMENT_WRAP
- },
- reference : stencilReference,
- mask : stencilMask
- },
- depthTest : {
- enabled : true,
- func : DepthFunction.LESS_OR_EQUAL
- },
- depthMask : false
- };
-
- var classificationColorRS = {
- stencilTest : {
- enabled : true,
- frontFunction : StencilFunction.NOT_EQUAL,
- frontOperation : {
- fail : StencilOperation.KEEP,
- zFail : StencilOperation.KEEP,
- zPass : StencilOperation.DECREMENT_WRAP
- },
- backFunction : StencilFunction.NOT_EQUAL,
- backOperation : {
- fail : StencilOperation.KEEP,
- zFail : StencilOperation.KEEP,
- zPass : StencilOperation.DECREMENT_WRAP
- },
- reference : stencilReference,
- mask : stencilMask
- },
- depthTest : {
- enabled : false
- },
- depthMask : false,
- blending : BlendingState.ALPHA_BLEND
- };
-
- function createClassificationProgram(model, id, program, frameState) {
- var vs = program.vertexShaderSource;
- var attributeLocations = program._attributeLocations;
- var fs =
- 'void main() \n' +
- '{ \n' +
- ' gl_FragColor = vec4(1.0); \n' +
- '}';
-
- fs = modifyShader(fs, id, model._classificationShaderLoaded);
-
- return ShaderProgram.fromCache({
- context : frameState.context,
- vertexShaderSource : vs,
- fragmentShaderSource : fs,
- attributeLocations : attributeLocations
- });
- }
-
- function createClassificationCommands(model, frameState) {
- var scene3DOnly = frameState.scene3DOnly;
- var classificationPrograms = model._rendererResources.classificationPrograms;
- var nodeCommands = model._nodeCommands;
- var length = nodeCommands.length;
- for (var i = 0; i < length; ++i) {
- var nodeCommand = nodeCommands[i];
- var command = nodeCommand.command;
-
- var program = command.shaderProgram;
- var id = getProgramId(model, program);
- var classificationProgram = classificationPrograms[id];
- if (!defined(classificationProgram)) {
- classificationProgram = createClassificationProgram(model, id, program, frameState);
- classificationPrograms[id] = classificationProgram;
- }
-
- var preloadCommand = DrawCommand.shallowClone(command);
- preloadCommand.renderState = RenderState.fromCache(classificationPreloadRS);
- preloadCommand.shaderProgram = classificationProgram;
- preloadCommand.castShadows = false;
- preloadCommand.receiveShadows = false;
- nodeCommand.classificationPreloadCommand = preloadCommand;
-
- var stencilCommand = DrawCommand.shallowClone(command);
- stencilCommand.renderState = RenderState.fromCache(classificationStencilRS);
- stencilCommand.shaderProgram = classificationProgram;
- stencilCommand.castShadows = false;
- stencilCommand.receiveShadows = false;
- nodeCommand.classificationStencilCommand = stencilCommand;
-
- var colorCommand = DrawCommand.shallowClone(command);
- colorCommand.renderState = RenderState.fromCache(classificationColorRS);
- colorCommand.shaderProgram = classificationProgram;
- colorCommand.castShadows = false;
- colorCommand.receiveShadows = false;
- nodeCommand.classificationColorCommand = colorCommand;
-
- if (!scene3DOnly) {
- var command2D = nodeCommand.command2D;
- var preloadCommand2D = DrawCommand.shallowClone(preloadCommand);
- preloadCommand2D.boundingVolume = command2D.boundingVolume;
- preloadCommand2D.modelMatrix = command2D.modelMatrix;
- nodeCommand.classificationPreloadCommand2D = preloadCommand2D;
-
- var stencilCommand2D = DrawCommand.shallowClone(stencilCommand);
- stencilCommand2D.boundingVolume = command2D.boundingVolume;
- stencilCommand2D.modelMatrix = command2D.modelMatrix;
- nodeCommand.classificationStencilCommand2D = stencilCommand2D;
-
- var colorCommand2D = DrawCommand.shallowClone(colorCommand);
- colorCommand2D.boundingVolume = command2D.boundingVolume;
- colorCommand2D.modelMatrix = command2D.modelMatrix;
- nodeCommand.classificationColorCommand2D = colorCommand2D;
- }
- }
- }
-
function updateClassification(model, frameState) {
var dirty = model._classificationType !== model.classificationType || model._dirty;
model._classificationType = model.classificationType;
- if (!isClassification(model, frameState)) {
- return;
- }
-
- var nodeCommands = model._nodeCommands;
- if (!defined(nodeCommands[0].classificationPreloadCommand)) {
- createClassificationCommands(model, frameState);
- }
-
if (!dirty) {
return;
}
@@ -3200,18 +3078,28 @@ define([
}
var scene3DOnly = frameState.scene3DOnly;
+ var allowPicking = model.allowPicking;
+ var nodeCommands = model._nodeCommands;
var length = nodeCommands.length;
for (var i = 0; i < length; ++i) {
var nodeCommand = nodeCommands[i];
- nodeCommand.classificationPreloadCommand.pass = pass;
- nodeCommand.classificationStencilCommand.pass = pass;
- nodeCommand.classificationColorCommand.pass = pass;
+ nodeCommand.preloadCommand.pass = pass;
+ nodeCommand.stencilCommand.pass = pass;
+ nodeCommand.colorCommand.pass = pass;
+
+ if (allowPicking) {
+ nodeCommand.pickCommand.pass = pass;
+ }
if (!scene3DOnly) {
- nodeCommand.classificationPreloadCommand2D.pass = pass;
- nodeCommand.classificationStencilCommand2D.pass = pass;
- nodeCommand.classificationColorCommand2D.pass = pass;
+ nodeCommand.preloadCommand2D.pass = pass;
+ nodeCommand.stencilCommand2D.pass = pass;
+ nodeCommand.colorCommand2D.pass = pass;
+
+ if (allowPicking) {
+ nodeCommand.pickCommand2D.pass = pass;
+ }
}
}
}
@@ -3552,7 +3440,6 @@ define([
}
}
- var classification = isClassification(this, frameState);
var displayConditionPassed = defined(this.distanceDisplayCondition) ? distanceDisplayConditionVisible(this, frameState) : true;
var show = this.show && displayConditionPassed && (this.scale !== 0.0);
@@ -3638,36 +3525,19 @@ define([
var boundingVolume;
if (passes.render) {
- if (!classification) {
- for (i = 0; i < length; ++i) {
- nc = nodeCommands[i];
- if (nc.show) {
- var command = nc.command;
- commandList.push(command);
- boundingVolume = nc.command.boundingVolume;
- if (frameState.mode === SceneMode.SCENE2D &&
- (boundingVolume.center.y + boundingVolume.radius > idl2D || boundingVolume.center.y - boundingVolume.radius < idl2D)) {
- var command2D = nc.command2D;
- commandList.push(command2D);
- }
- }
- }
- } else {
- for (i = 0; i < length; ++i) {
- nc = nodeCommands[i];
- if (nc.show) {
- var originalCommand = nc.command;
- boundingVolume = originalCommand.boundingVolume;
- if (frameState.mode === SceneMode.SCENE2D &&
- (boundingVolume.center.y + boundingVolume.radius > idl2D || boundingVolume.center.y - boundingVolume.radius < idl2D)) {
- commandList.push(nc.classificationPreloadCommand2D);
- commandList.push(nc.classificationStencilCommand2D);
- commandList.push(nc.classificationColorCommand2D);
- } else {
- commandList.push(nc.classificationPreloadCommand);
- commandList.push(nc.classificationStencilCommand);
- commandList.push(nc.classificationColorCommand);
- }
+ for (i = 0; i < length; ++i) {
+ nc = nodeCommands[i];
+ if (nc.show) {
+ boundingVolume = nc.boundingVolume;
+ if (frameState.mode === SceneMode.SCENE2D &&
+ (boundingVolume.center.y + boundingVolume.radius > idl2D || boundingVolume.center.y - boundingVolume.radius < idl2D)) {
+ commandList.push(nc.preloadCommand2D);
+ commandList.push(nc.stencilCommand2D);
+ commandList.push(nc.colorCommand2D);
+ } else {
+ commandList.push(nc.preloadCommand);
+ commandList.push(nc.stencilCommand);
+ commandList.push(nc.colorCommand);
}
}
}
@@ -3677,13 +3547,16 @@ define([
for (i = 0; i < length; ++i) {
nc = nodeCommands[i];
if (nc.show) {
- var pickCommand = nc.pickCommand;
- commandList.push(pickCommand);
-
- boundingVolume = pickCommand.boundingVolume;
+ boundingVolume = nc.boundingVolume;
if (frameState.mode === SceneMode.SCENE2D &&
(boundingVolume.center.y + boundingVolume.radius > idl2D || boundingVolume.center.y - boundingVolume.radius < idl2D)) {
+ commandList.push(nc.preloadCommand2D);
+ commandList.push(nc.stencilCommand2D);
commandList.push(nc.pickCommand2D);
+ } else {
+ commandList.push(nc.preloadCommand);
+ commandList.push(nc.stencilCommand);
+ commandList.push(nc.pickCommand);
}
}
}
From 7fe3e37980e4ce8fc95fbffba085bfa27daaf974 Mon Sep 17 00:00:00 2001
From: Dan Bagnell
Date: Mon, 4 Dec 2017 16:47:18 -0500
Subject: [PATCH 07/51] Only use position and batch id attributes.
---
Source/Scene/ClassificationModel.js | 62 ++++++-----------------------
1 file changed, 13 insertions(+), 49 deletions(-)
diff --git a/Source/Scene/ClassificationModel.js b/Source/Scene/ClassificationModel.js
index 6a9168e0c55f..c5ccb236abc2 100644
--- a/Source/Scene/ClassificationModel.js
+++ b/Source/Scene/ClassificationModel.js
@@ -1670,7 +1670,7 @@ define([
return undefined;
}
- function modifyShaderForQuantizedAttributes(shader, programName, model, context) {
+ function modifyShaderForQuantizedAttributes(shader, programName, model) {
var quantizedUniforms = {};
model._quantizedUniforms[programName] = quantizedUniforms;
@@ -1755,13 +1755,13 @@ define([
}
function createProgram(id, model, context) {
- var programs = model.gltf.programs;
- var program = programs[id];
-
- var attributeLocations = createAttributeLocations(model, program.attributes);
-
var positionName = getAttributeOrUniformBySemantic(model.gltf, 'POSITION');
var batchIdName = getAttributeOrUniformBySemantic(model.gltf, '_BATCHID');
+
+ var attributeLocations = {};
+ attributeLocations[positionName] = 0;
+ attributeLocations[batchIdName] = 1;
+
var modelViewProjectionName = getAttributeOrUniformBySemantic(model.gltf, 'MODELVIEWPROJECTION');
var uniformDecl;
@@ -1797,7 +1797,7 @@ define([
'}';
if (model.extensionsUsed.WEB3D_quantized_attributes) {
- vs = modifyShaderForQuantizedAttributes(vs, id, model, context);
+ vs = modifyShaderForQuantizedAttributes(vs, id, model);
}
var drawVS = modifyShader(vs, id, model._vertexShaderLoaded);
@@ -1845,49 +1845,13 @@ define([
}
}
- function getAttributeLocations(model, primitive) {
- var gltf = model.gltf;
- var techniques = gltf.techniques;
- var materials = gltf.materials;
+ function getAttributeLocations(model) {
+ var positionName = getAttributeOrUniformBySemantic(model.gltf, 'POSITION');
+ var batchIdName = getAttributeOrUniformBySemantic(model.gltf, '_BATCHID');
- // Retrieve the compiled shader program to assign index values to attributes
var attributeLocations = {};
-
- var location;
- var index;
- var technique = techniques[materials[primitive.material].technique];
- var parameters = technique.parameters;
- var attributes = technique.attributes;
- var program = model._rendererResources.programs[technique.program];
- var programVertexAttributes = program.vertexAttributes;
- var programAttributeLocations = program._attributeLocations;
-
- // Note: WebGL shader compiler may have optimized and removed some attributes from programVertexAttributes
- for (location in programVertexAttributes) {
- if (programVertexAttributes.hasOwnProperty(location)) {
- var attribute = attributes[location];
- index = programVertexAttributes[location].index;
- if (defined(attribute)) {
- var parameter = parameters[attribute];
- attributeLocations[parameter.semantic] = index;
- }
- }
- }
-
- // Always add pre-created attributes.
- // Some pre-created attributes, like per-instance pickIds, may be compiled out of the draw program
- // but should be included in the list of attribute locations for the pick program.
- // This is safe to do since programVertexAttributes and programAttributeLocations are equivalent except
- // that programVertexAttributes optimizes out unused attributes.
- var precreatedAttributes = model._precreatedAttributes;
- if (defined(precreatedAttributes)) {
- for (location in precreatedAttributes) {
- if (precreatedAttributes.hasOwnProperty(location)) {
- index = programAttributeLocations[location];
- attributeLocations[location] = index;
- }
- }
- }
+ attributeLocations[positionName] = 0;
+ attributeLocations[batchIdName] = 1;
return attributeLocations;
}
@@ -1924,7 +1888,7 @@ define([
//
// https://github.com/KhronosGroup/glTF/issues/258
- var attributeLocations = getAttributeLocations(model, primitive);
+ var attributeLocations = getAttributeLocations(model);
var attributeName;
var attributeLocation;
var attribute;
From b3993b5c48517195b9d62515ee0dd6c0856ddc9d Mon Sep 17 00:00:00 2001
From: Dan Bagnell
Date: Mon, 4 Dec 2017 16:51:51 -0500
Subject: [PATCH 08/51] Remove more unneeded code.
---
Source/Scene/ClassificationModel.js | 47 -----------------------------
1 file changed, 47 deletions(-)
diff --git a/Source/Scene/ClassificationModel.js b/Source/Scene/ClassificationModel.js
index c5ccb236abc2..8e27ff10bed6 100644
--- a/Source/Scene/ClassificationModel.js
+++ b/Source/Scene/ClassificationModel.js
@@ -554,7 +554,6 @@ define([
// Undocumented options
this._addBatchIdToGeneratedShaders = options.addBatchIdToGeneratedShaders;
- this._precreatedAttributes = options.precreatedAttributes;
this._vertexShaderLoaded = options.vertexShaderLoaded;
this._classificationShaderLoaded = options.classificationShaderLoaded;
this._uniformMapLoaded = options.uniformMapLoaded;
@@ -1594,31 +1593,6 @@ define([
}
}
- function createAttributeLocations(model, attributes) {
- var attributeLocations = {};
- var length = attributes.length;
- var i;
-
- // Set the position attribute to the 0th index. In some WebGL implementations the shader
- // will not work correctly if the 0th attribute is not active. For example, some glTF models
- // list the normal attribute first but derived shaders like the cast-shadows shader do not use
- // the normal attribute.
- for (i = 1; i < length; ++i) {
- var attribute = attributes[i];
- if (/pos/i.test(attribute)) {
- attributes[i] = attributes[0];
- attributes[0] = attribute;
- break;
- }
- }
-
- for (i = 0; i < length; ++i) {
- attributeLocations[attributes[i]] = i;
- }
-
- return attributeLocations;
- }
-
function replaceAllButFirstInString(string, find, replace) {
var index = string.indexOf(find);
return string.replace(new RegExp(find, 'g'), function(match, offset, all) {
@@ -1891,7 +1865,6 @@ define([
var attributeLocations = getAttributeLocations(model);
var attributeName;
var attributeLocation;
- var attribute;
var attributes = [];
var primitiveAttributes = primitive.attributes;
for (attributeName in primitiveAttributes) {
@@ -1919,21 +1892,6 @@ define([
}
}
- // Add pre-created attributes
- var precreatedAttributes = model._precreatedAttributes;
- if (defined(precreatedAttributes)) {
- for (attributeName in precreatedAttributes) {
- if (precreatedAttributes.hasOwnProperty(attributeName)) {
- attributeLocation = attributeLocations[attributeName];
- if (defined(attributeLocation)) {
- attribute = precreatedAttributes[attributeName];
- attribute.index = attributeLocation;
- attributes.push(attribute);
- }
- }
- }
- }
-
var indexBuffer;
if (defined(primitive.indices)) {
var accessor = accessors[primitive.indices];
@@ -3561,11 +3519,6 @@ define([
* @see Model#isDestroyed
*/
Model.prototype.destroy = function() {
- // Vertex arrays are unique to this model, destroy here.
- if (defined(this._precreatedAttributes)) {
- destroy(this._rendererResources.vertexArrays);
- }
-
if (defined(this._removeUpdateHeightCallback)) {
this._removeUpdateHeightCallback();
this._removeUpdateHeightCallback = undefined;
From cc7a22833f9f0400b89495f402f0eda5b79838e7 Mon Sep 17 00:00:00 2001
From: Dan Bagnell
Date: Mon, 4 Dec 2017 17:19:23 -0500
Subject: [PATCH 09/51] Remove shader parsing.
---
Source/Scene/ClassificationModel.js | 72 +++--------------------------
1 file changed, 6 insertions(+), 66 deletions(-)
diff --git a/Source/Scene/ClassificationModel.js b/Source/Scene/ClassificationModel.js
index 8e27ff10bed6..470f2c201b28 100644
--- a/Source/Scene/ClassificationModel.js
+++ b/Source/Scene/ClassificationModel.js
@@ -185,7 +185,6 @@ define([
this.pendingBufferLoads = 0;
this.programsToCreate = new Queue();
- this.shaders = {};
this.pendingShaderLoads = 0;
this.createVertexArrays = true;
@@ -553,7 +552,6 @@ define([
this._distanceDisplayCondition = options.distanceDisplayCondition;
// Undocumented options
- this._addBatchIdToGeneratedShaders = options.addBatchIdToGeneratedShaders;
this._vertexShaderLoaded = options.vertexShaderLoaded;
this._classificationShaderLoaded = options.classificationShaderLoaded;
this._uniformMapLoaded = options.uniformMapLoaded;
@@ -1339,49 +1337,6 @@ define([
});
}
- function shaderLoad(model, type, id) {
- return function(source) {
- var loadResources = model._loadResources;
- loadResources.shaders[id] = {
- source : source,
- type : type,
- bufferView : undefined
- };
- --loadResources.pendingShaderLoads;
- model.gltf.shaders[id].extras._pipeline.source = source;
- };
- }
-
- function parseShaders(model) {
- var gltf = model.gltf;
- var buffers = gltf.buffers;
- var bufferViews = gltf.bufferViews;
- ForEach.shader(gltf, function(shader, id) {
- // Shader references either uri (external or base64-encoded) or bufferView
- if (defined(shader.bufferView)) {
- var bufferViewId = shader.bufferView;
- var bufferView = bufferViews[bufferViewId];
- var bufferId = bufferView.buffer;
- var buffer = buffers[bufferId];
- var source = getStringFromTypedArray(buffer.extras._pipeline.source, bufferView.byteOffset, bufferView.byteLength);
- model._loadResources.shaders[id] = {
- source : source,
- bufferView : undefined
- };
- shader.extras._pipeline.source = source;
- } else if (defined(shader.extras._pipeline.source)) {
- model._loadResources.shaders[id] = {
- source : shader.extras._pipeline.source,
- bufferView : undefined
- };
- } else {
- ++model._loadResources.pendingShaderLoads;
- var shaderPath = joinUrls(model._baseUri, shader.uri);
- loadText(shaderPath).then(shaderLoad(model, shader.type, id)).otherwise(getFailedLoadFunction(model, 'shader', shaderPath));
- }
- });
- }
-
function parsePrograms(model) {
ForEach.program(model.gltf, function(program, id) {
model._loadResources.programsToCreate.enqueue(id);
@@ -1819,15 +1774,11 @@ define([
}
}
- function getAttributeLocations(model) {
- var positionName = getAttributeOrUniformBySemantic(model.gltf, 'POSITION');
- var batchIdName = getAttributeOrUniformBySemantic(model.gltf, '_BATCHID');
-
- var attributeLocations = {};
- attributeLocations[positionName] = 0;
- attributeLocations[batchIdName] = 1;
-
- return attributeLocations;
+ function getAttributeLocations() {
+ return {
+ POSITION : 0,
+ _BATCHID : 1
+ };
}
function createVertexArrays(model, context) {
@@ -1862,7 +1813,7 @@ define([
//
// https://github.com/KhronosGroup/glTF/issues/258
- var attributeLocations = getAttributeLocations(model);
+ var attributeLocations = getAttributeLocations();
var attributeName;
var attributeLocation;
var attributes = [];
@@ -3312,22 +3263,11 @@ define([
// Textures may continue to stream in while in the LOADED state.
if (loadResources.pendingBufferLoads === 0) {
if (!this._updatedGltfVersion) {
- var options = {
- optimizeForCesium: true,
- addBatchIdToGeneratedShaders : this._addBatchIdToGeneratedShaders
- };
- frameState.brdfLutGenerator.update(frameState);
- updateVersion(this.gltf);
checkSupportedExtensions(this);
- addPipelineExtras(this.gltf);
- addDefaults(this.gltf);
- processModelMaterialsCommon(this.gltf, options);
- processPbrMetallicRoughness(this.gltf, options);
// We do this after to make sure that the ids don't change
addBuffersToLoadResources(this);
parseBufferViews(this);
- parseShaders(this);
parsePrograms(this);
parseMaterials(this);
parseMeshes(this);
From fad8860d1151f369e3034e6d936781045f721820 Mon Sep 17 00:00:00 2001
From: Dan Bagnell
Date: Mon, 4 Dec 2017 17:40:07 -0500
Subject: [PATCH 10/51] Remove unused uniform semantics.
---
Source/Scene/ClassificationModel.js | 215 ++--------------------------
1 file changed, 12 insertions(+), 203 deletions(-)
diff --git a/Source/Scene/ClassificationModel.js b/Source/Scene/ClassificationModel.js
index 470f2c201b28..1296215ce22f 100644
--- a/Source/Scene/ClassificationModel.js
+++ b/Source/Scene/ClassificationModel.js
@@ -1676,9 +1676,9 @@ define([
return shader;
}
- function modifyShader(shader, programName, callback) {
+ function modifyShader(shader, callback) {
if (defined(callback)) {
- shader = callback(shader, programName);
+ shader = callback(shader);
}
return shader;
}
@@ -1729,8 +1729,8 @@ define([
vs = modifyShaderForQuantizedAttributes(vs, id, model);
}
- var drawVS = modifyShader(vs, id, model._vertexShaderLoaded);
- var drawFS = modifyShader(fs, id, model._classificationShaderLoaded);
+ var drawVS = modifyShader(vs, model._vertexShaderLoaded);
+ var drawFS = modifyShader(fs, model._classificationShaderLoaded);
model._rendererResources.programs[id] = ShaderProgram.fromCache({
context : context,
@@ -1741,8 +1741,8 @@ define([
if (model.allowPicking) {
// PERFORMANCE_IDEA: Can optimize this shader with a glTF hint. https://github.com/KhronosGroup/glTF/issues/181
- var pickVS = modifyShader(vs, id, model._pickVertexShaderLoaded);
- var pickFS = modifyShader(fs, id, model._pickFragmentShaderLoaded);
+ var pickVS = modifyShader(vs, model._pickVertexShaderLoaded);
+ var pickFS = modifyShader(fs, model._pickFragmentShaderLoaded);
model._rendererResources.pickPrograms[id] = ShaderProgram.fromCache({
context : context,
@@ -1861,16 +1861,6 @@ define([
// This doesn't support LOCAL, which we could add if it is ever used.
var scratchTranslationRtc = new Cartesian3();
var gltfSemanticUniforms = {
- MODEL : function(uniformState, model) {
- return function() {
- return uniformState.model;
- };
- },
- VIEW : function(uniformState, model) {
- return function() {
- return uniformState.view;
- };
- },
PROJECTION : function(uniformState, model) {
return function() {
return uniformState.projection;
@@ -1898,85 +1888,9 @@ define([
return function() {
return uniformState.modelViewProjection;
};
- },
- MODELINVERSE : function(uniformState, model) {
- return function() {
- return uniformState.inverseModel;
- };
- },
- VIEWINVERSE : function(uniformState, model) {
- return function() {
- return uniformState.inverseView;
- };
- },
- PROJECTIONINVERSE : function(uniformState, model) {
- return function() {
- return uniformState.inverseProjection;
- };
- },
- MODELVIEWINVERSE : function(uniformState, model) {
- return function() {
- return uniformState.inverseModelView;
- };
- },
- MODELVIEWPROJECTIONINVERSE : function(uniformState, model) {
- return function() {
- return uniformState.inverseModelViewProjection;
- };
- },
- MODELINVERSETRANSPOSE : function(uniformState, model) {
- return function() {
- return uniformState.inverseTransposeModel;
- };
- },
- MODELVIEWINVERSETRANSPOSE : function(uniformState, model) {
- return function() {
- return uniformState.normal;
- };
- },
- VIEWPORT : function(uniformState, model) {
- return function() {
- return uniformState.viewportCartesian4;
- };
}
};
- ///////////////////////////////////////////////////////////////////////////
-
- function getScalarUniformFunction(value, model) {
- var that = {
- value : value,
- clone : function(source, result) {
- return source;
- },
- func : function() {
- return that.value;
- }
- };
- return that;
- }
-
- function getVec2UniformFunction(value, model) {
- var that = {
- value : Cartesian2.fromArray(value),
- clone : Cartesian2.clone,
- func : function() {
- return that.value;
- }
- };
- return that;
- }
-
- function getVec3UniformFunction(value, model) {
- var that = {
- value : Cartesian3.fromArray(value),
- clone : Cartesian3.clone,
- func : function() {
- return that.value;
- }
- };
- return that;
- }
function getVec4UniformFunction(value, model) {
var that = {
@@ -2022,35 +1936,7 @@ define([
return that;
}
- var gltfUniformFunctions = {};
- gltfUniformFunctions[WebGLConstants.FLOAT] = getScalarUniformFunction;
- gltfUniformFunctions[WebGLConstants.FLOAT_VEC2] = getVec2UniformFunction;
- gltfUniformFunctions[WebGLConstants.FLOAT_VEC3] = getVec3UniformFunction;
- gltfUniformFunctions[WebGLConstants.FLOAT_VEC4] = getVec4UniformFunction;
- gltfUniformFunctions[WebGLConstants.INT] = getScalarUniformFunction;
- gltfUniformFunctions[WebGLConstants.INT_VEC2] = getVec2UniformFunction;
- gltfUniformFunctions[WebGLConstants.INT_VEC3] = getVec3UniformFunction;
- gltfUniformFunctions[WebGLConstants.INT_VEC4] = getVec4UniformFunction;
- gltfUniformFunctions[WebGLConstants.BOOL] = getScalarUniformFunction;
- gltfUniformFunctions[WebGLConstants.BOOL_VEC2] = getVec2UniformFunction;
- gltfUniformFunctions[WebGLConstants.BOOL_VEC3] = getVec3UniformFunction;
- gltfUniformFunctions[WebGLConstants.BOOL_VEC4] = getVec4UniformFunction;
- gltfUniformFunctions[WebGLConstants.FLOAT_MAT2] = getMat2UniformFunction;
- gltfUniformFunctions[WebGLConstants.FLOAT_MAT3] = getMat3UniformFunction;
- gltfUniformFunctions[WebGLConstants.FLOAT_MAT4] = getMat4UniformFunction;
- // GLTF_SPEC: Support SAMPLER_CUBE. https://github.com/KhronosGroup/glTF/issues/40
-
var gltfUniformsFromNode = {
- MODEL : function(uniformState, model, runtimeNode) {
- return function() {
- return runtimeNode.computedMatrix;
- };
- },
- VIEW : function(uniformState, model, runtimeNode) {
- return function() {
- return uniformState.view;
- };
- },
PROJECTION : function(uniformState, model, runtimeNode) {
return function() {
return uniformState.projection;
@@ -2076,64 +1962,6 @@ define([
Matrix4.multiplyTransformation(uniformState.view, runtimeNode.computedMatrix, mvp);
return Matrix4.multiply(uniformState._projection, mvp, mvp);
};
- },
- MODELINVERSE : function(uniformState, model, runtimeNode) {
- var mInverse = new Matrix4();
- return function() {
- return Matrix4.inverse(runtimeNode.computedMatrix, mInverse);
- };
- },
- VIEWINVERSE : function(uniformState, model) {
- return function() {
- return uniformState.inverseView;
- };
- },
- PROJECTIONINVERSE : function(uniformState, model, runtimeNode) {
- return function() {
- return uniformState.inverseProjection;
- };
- },
- MODELVIEWINVERSE : function(uniformState, model, runtimeNode) {
- var mv = new Matrix4();
- var mvInverse = new Matrix4();
- return function() {
- Matrix4.multiplyTransformation(uniformState.view, runtimeNode.computedMatrix, mv);
- return Matrix4.inverse(mv, mvInverse);
- };
- },
- MODELVIEWPROJECTIONINVERSE : function(uniformState, model, runtimeNode) {
- var mvp = new Matrix4();
- var mvpInverse = new Matrix4();
- return function() {
- Matrix4.multiplyTransformation(uniformState.view, runtimeNode.computedMatrix, mvp);
- Matrix4.multiply(uniformState._projection, mvp, mvp);
- return Matrix4.inverse(mvp, mvpInverse);
- };
- },
- MODELINVERSETRANSPOSE : function(uniformState, model, runtimeNode) {
- var mInverse = new Matrix4();
- var mInverseTranspose = new Matrix3();
- return function() {
- Matrix4.inverse(runtimeNode.computedMatrix, mInverse);
- Matrix4.getRotation(mInverse, mInverseTranspose);
- return Matrix3.transpose(mInverseTranspose, mInverseTranspose);
- };
- },
- MODELVIEWINVERSETRANSPOSE : function(uniformState, model, runtimeNode) {
- var mv = new Matrix4();
- var mvInverse = new Matrix4();
- var mvInverseTranspose = new Matrix3();
- return function() {
- Matrix4.multiplyTransformation(uniformState.view, runtimeNode.computedMatrix, mv);
- Matrix4.inverse(mv, mvInverse);
- Matrix4.getRotation(mvInverse, mvInverseTranspose);
- return Matrix3.transpose(mvInverseTranspose, mvInverseTranspose);
- };
- },
- VIEWPORT : function(uniformState, model, runtimeNode) {
- return function() {
- return uniformState.viewportCartesian4;
- };
}
};
@@ -2162,8 +1990,6 @@ define([
for (var materialId in materials) {
if (materials.hasOwnProperty(materialId)) {
var material = materials[materialId];
- var instanceParameters;
- instanceParameters = material.values;
var technique = techniques[material.technique];
var parameters = technique.parameters;
var uniforms = technique.uniforms;
@@ -2177,31 +2003,14 @@ define([
var parameterName = uniforms[name];
var parameter = parameters[parameterName];
- // GLTF_SPEC: This does not take into account uniform arrays,
- // indicated by parameters with a count property.
- //
- // https://github.com/KhronosGroup/glTF/issues/258
-
- // GLTF_SPEC: In this implementation, material parameters with a
- // semantic or targeted via a source (for animation) are not
- // targetable for material animations. Is this too strict?
- //
- // https://github.com/KhronosGroup/glTF/issues/142
-
- if (defined(instanceParameters[parameterName])) {
- // Parameter overrides by the instance technique
- var uv = gltfUniformFunctions[parameter.type](instanceParameters[parameterName], model);
- uniformMap[name] = uv.func;
- uniformValues[parameterName] = uv;
- } else if (defined(parameter.node)) {
+ if (!defined(parameter.semantic) || !defined(gltfUniformsFromNode[parameter.semantic])) {
+ continue;
+ }
+
+ if (defined(parameter.node)) {
uniformMap[name] = getUniformFunctionFromSource(parameter.node, model, parameter.semantic, context.uniformState);
- } else if (defined(parameter.semantic) && parameter.semantic !== 'JOINTMATRIX' && parameter.semantic !== 'MORPHWEIGHTS') {
+ } else if (defined(parameter.semantic)) {
uniformMap[name] = gltfSemanticUniforms[parameter.semantic](context.uniformState, model);
- } else if (defined(parameter.value)) {
- // Technique value that isn't overridden by a material
- var uv2 = gltfUniformFunctions[parameter.type](parameter.value, model);
- uniformMap[name] = uv2.func;
- uniformValues[parameterName] = uv2;
}
}
}
From a2a1e2f89fc5d89961e54ccac01bb328c99a2869 Mon Sep 17 00:00:00 2001
From: Dan Bagnell
Date: Tue, 5 Dec 2017 16:04:02 -0500
Subject: [PATCH 11/51] Mostly working. Needs clean up. There are issues with
model matrices, picking and rebatching.
---
Source/Scene/ClassificationModel.js | 514 +++++++++++++++++---------
Source/Scene/Vector3DTilePrimitive.js | 48 ++-
2 files changed, 380 insertions(+), 182 deletions(-)
diff --git a/Source/Scene/ClassificationModel.js b/Source/Scene/ClassificationModel.js
index 1296215ce22f..9da79e2fec5c 100644
--- a/Source/Scene/ClassificationModel.js
+++ b/Source/Scene/ClassificationModel.js
@@ -1,163 +1,169 @@
define([
- '../Core/BoundingSphere',
- '../Core/Cartesian2',
- '../Core/Cartesian3',
- '../Core/Cartesian4',
- '../Core/Cartographic',
- '../Core/clone',
- '../Core/Color',
- '../Core/combine',
- '../Core/defaultValue',
- '../Core/defined',
- '../Core/defineProperties',
- '../Core/destroyObject',
- '../Core/DeveloperError',
- '../Core/DistanceDisplayCondition',
- '../Core/FeatureDetection',
- '../Core/getAbsoluteUri',
- '../Core/getBaseUri',
- '../Core/getMagic',
- '../Core/getStringFromTypedArray',
- '../Core/IndexDatatype',
- '../Core/joinUrls',
- '../Core/loadArrayBuffer',
- '../Core/loadCRN',
- '../Core/loadImage',
- '../Core/loadImageFromTypedArray',
- '../Core/loadKTX',
- '../Core/loadText',
- '../Core/Math',
- '../Core/Matrix2',
- '../Core/Matrix3',
- '../Core/Matrix4',
- '../Core/PixelFormat',
- '../Core/PrimitiveType',
- '../Core/Quaternion',
- '../Core/Queue',
- '../Core/RuntimeError',
- '../Core/Transforms',
- '../Core/WebGLConstants',
- '../Renderer/Buffer',
- '../Renderer/BufferUsage',
- '../Renderer/DrawCommand',
- '../Renderer/Pass',
- '../Renderer/RenderState',
- '../Renderer/Sampler',
- '../Renderer/ShaderProgram',
- '../Renderer/ShaderSource',
- '../Renderer/Texture',
- '../Renderer/TextureMinificationFilter',
- '../Renderer/TextureWrap',
- '../Renderer/VertexArray',
- '../ThirdParty/GltfPipeline/addDefaults',
- '../ThirdParty/GltfPipeline/addPipelineExtras',
- '../ThirdParty/GltfPipeline/ForEach',
- '../ThirdParty/GltfPipeline/getAccessorByteStride',
- '../ThirdParty/GltfPipeline/numberOfComponentsForType',
- '../ThirdParty/GltfPipeline/parseBinaryGltf',
- '../ThirdParty/GltfPipeline/processModelMaterialsCommon',
- '../ThirdParty/GltfPipeline/processPbrMetallicRoughness',
- '../ThirdParty/GltfPipeline/updateVersion',
- '../ThirdParty/Uri',
- '../ThirdParty/when',
- './AttributeType',
- './Axis',
- './BlendingState',
- './ClassificationType',
- './ColorBlendMode',
- './DepthFunction',
- './getAttributeOrUniformBySemantic',
- './HeightReference',
- './JobType',
- './ModelAnimationCache',
- './ModelAnimationCollection',
- './ModelMaterial',
- './ModelMesh',
- './ModelNode',
- './SceneMode',
- './ShadowMode',
- './StencilFunction',
- './StencilOperation'
-], function(
- BoundingSphere,
- Cartesian2,
- Cartesian3,
- Cartesian4,
- Cartographic,
- clone,
- Color,
- combine,
- defaultValue,
- defined,
- defineProperties,
- destroyObject,
- DeveloperError,
- DistanceDisplayCondition,
- FeatureDetection,
- getAbsoluteUri,
- getBaseUri,
- getMagic,
- getStringFromTypedArray,
- IndexDatatype,
- joinUrls,
- loadArrayBuffer,
- loadCRN,
- loadImage,
- loadImageFromTypedArray,
- loadKTX,
- loadText,
- CesiumMath,
- Matrix2,
- Matrix3,
- Matrix4,
- PixelFormat,
- PrimitiveType,
- Quaternion,
- Queue,
- RuntimeError,
- Transforms,
- WebGLConstants,
- Buffer,
- BufferUsage,
- DrawCommand,
- Pass,
- RenderState,
- Sampler,
- ShaderProgram,
- ShaderSource,
- Texture,
- TextureMinificationFilter,
- TextureWrap,
- VertexArray,
- addDefaults,
- addPipelineExtras,
- ForEach,
- getAccessorByteStride,
- numberOfComponentsForType,
- parseBinaryGltf,
- processModelMaterialsCommon,
- processPbrMetallicRoughness,
- updateVersion,
- Uri,
- when,
- AttributeType,
- Axis,
- BlendingState,
- ClassificationType,
- ColorBlendMode,
- DepthFunction,
- getAttributeOrUniformBySemantic,
- HeightReference,
- JobType,
- ModelAnimationCache,
- ModelAnimationCollection,
- ModelMaterial,
- ModelMesh,
- ModelNode,
- SceneMode,
- ShadowMode,
- StencilFunction,
- StencilOperation) {
+ '../Core/arraySlice',
+ '../Core/BoundingSphere',
+ '../Core/Cartesian2',
+ '../Core/Cartesian3',
+ '../Core/Cartesian4',
+ '../Core/Cartographic',
+ '../Core/clone',
+ '../Core/Color',
+ '../Core/combine',
+ '../Core/defaultValue',
+ '../Core/defined',
+ '../Core/defineProperties',
+ '../Core/destroyObject',
+ '../Core/DeveloperError',
+ '../Core/DistanceDisplayCondition',
+ '../Core/FeatureDetection',
+ '../Core/getAbsoluteUri',
+ '../Core/getBaseUri',
+ '../Core/getMagic',
+ '../Core/getStringFromTypedArray',
+ '../Core/IndexDatatype',
+ '../Core/joinUrls',
+ '../Core/loadArrayBuffer',
+ '../Core/loadCRN',
+ '../Core/loadImage',
+ '../Core/loadImageFromTypedArray',
+ '../Core/loadKTX',
+ '../Core/loadText',
+ '../Core/Math',
+ '../Core/Matrix2',
+ '../Core/Matrix3',
+ '../Core/Matrix4',
+ '../Core/PixelFormat',
+ '../Core/PrimitiveType',
+ '../Core/Quaternion',
+ '../Core/Queue',
+ '../Core/RuntimeError',
+ '../Core/Transforms',
+ '../Core/WebGLConstants',
+ '../Renderer/Buffer',
+ '../Renderer/BufferUsage',
+ '../Renderer/DrawCommand',
+ '../Renderer/Pass',
+ '../Renderer/RenderState',
+ '../Renderer/Sampler',
+ '../Renderer/ShaderProgram',
+ '../Renderer/ShaderSource',
+ '../Renderer/Texture',
+ '../Renderer/TextureMinificationFilter',
+ '../Renderer/TextureWrap',
+ '../Renderer/VertexArray',
+ '../ThirdParty/GltfPipeline/addDefaults',
+ '../ThirdParty/GltfPipeline/addPipelineExtras',
+ '../ThirdParty/GltfPipeline/ForEach',
+ '../ThirdParty/GltfPipeline/getAccessorByteStride',
+ '../ThirdParty/GltfPipeline/numberOfComponentsForType',
+ '../ThirdParty/GltfPipeline/parseBinaryGltf',
+ '../ThirdParty/GltfPipeline/processModelMaterialsCommon',
+ '../ThirdParty/GltfPipeline/processPbrMetallicRoughness',
+ '../ThirdParty/GltfPipeline/updateVersion',
+ '../ThirdParty/Uri',
+ '../ThirdParty/when',
+ './AttributeType',
+ './Axis',
+ './BlendingState',
+ './ClassificationType',
+ './ColorBlendMode',
+ './DepthFunction',
+ './getAttributeOrUniformBySemantic',
+ './HeightReference',
+ './JobType',
+ './ModelAnimationCache',
+ './ModelAnimationCollection',
+ './ModelMaterial',
+ './ModelMesh',
+ './ModelNode',
+ './SceneMode',
+ './ShadowMode',
+ './StencilFunction',
+ './StencilOperation',
+ './Vector3DTileBatch',
+ './Vector3DTilePrimitive'
+ ], function(
+ arraySlice,
+ BoundingSphere,
+ Cartesian2,
+ Cartesian3,
+ Cartesian4,
+ Cartographic,
+ clone,
+ Color,
+ combine,
+ defaultValue,
+ defined,
+ defineProperties,
+ destroyObject,
+ DeveloperError,
+ DistanceDisplayCondition,
+ FeatureDetection,
+ getAbsoluteUri,
+ getBaseUri,
+ getMagic,
+ getStringFromTypedArray,
+ IndexDatatype,
+ joinUrls,
+ loadArrayBuffer,
+ loadCRN,
+ loadImage,
+ loadImageFromTypedArray,
+ loadKTX,
+ loadText,
+ CesiumMath,
+ Matrix2,
+ Matrix3,
+ Matrix4,
+ PixelFormat,
+ PrimitiveType,
+ Quaternion,
+ Queue,
+ RuntimeError,
+ Transforms,
+ WebGLConstants,
+ Buffer,
+ BufferUsage,
+ DrawCommand,
+ Pass,
+ RenderState,
+ Sampler,
+ ShaderProgram,
+ ShaderSource,
+ Texture,
+ TextureMinificationFilter,
+ TextureWrap,
+ VertexArray,
+ addDefaults,
+ addPipelineExtras,
+ ForEach,
+ getAccessorByteStride,
+ numberOfComponentsForType,
+ parseBinaryGltf,
+ processModelMaterialsCommon,
+ processPbrMetallicRoughness,
+ updateVersion,
+ Uri,
+ when,
+ AttributeType,
+ Axis,
+ BlendingState,
+ ClassificationType,
+ ColorBlendMode,
+ DepthFunction,
+ getAttributeOrUniformBySemantic,
+ HeightReference,
+ JobType,
+ ModelAnimationCache,
+ ModelAnimationCollection,
+ ModelMaterial,
+ ModelMesh,
+ ModelNode,
+ SceneMode,
+ ShadowMode,
+ StencilFunction,
+ StencilOperation,
+ Vector3DTileBatch,
+ Vector3DTilePrimitive) {
'use strict';
// Bail out if the browser doesn't support typed arrays, to prevent the setup function
@@ -1501,14 +1507,17 @@ define([
var bufferViews = model.gltf.bufferViews;
var bufferView = bufferViews[bufferViewId];
+ /*
var vertexBuffer = Buffer.createVertexBuffer({
context : context,
typedArray : loadResources.getBuffer(bufferView),
usage : BufferUsage.STATIC_DRAW
});
vertexBuffer.vertexArrayDestroyable = false;
+ */
+ var vertexBuffer = loadResources.getBuffer(bufferView);
model._rendererResources.buffers[bufferViewId] = vertexBuffer;
- model._geometryByteLength += vertexBuffer.sizeInBytes;
+ model._geometryByteLength += vertexBuffer.byteLength;
}
function createIndexBuffer(bufferViewId, componentType, model, context) {
@@ -1516,6 +1525,7 @@ define([
var bufferViews = model.gltf.bufferViews;
var bufferView = bufferViews[bufferViewId];
+ /*
var indexBuffer = Buffer.createIndexBuffer({
context : context,
typedArray : loadResources.getBuffer(bufferView),
@@ -1523,8 +1533,13 @@ define([
indexDatatype : componentType
});
indexBuffer.vertexArrayDestroyable = false;
+ */
+ var indexBuffer = {
+ typedArray : loadResources.getBuffer(bufferView),
+ indexDatatype : componentType
+ };
model._rendererResources.buffers[bufferViewId] = indexBuffer;
- model._geometryByteLength += indexBuffer.sizeInBytes;
+ model._geometryByteLength += indexBuffer.typedArray.byteLength;
}
function createBuffers(model, frameState) {
@@ -1732,24 +1747,38 @@ define([
var drawVS = modifyShader(vs, model._vertexShaderLoaded);
var drawFS = modifyShader(fs, model._classificationShaderLoaded);
+ /*
model._rendererResources.programs[id] = ShaderProgram.fromCache({
context : context,
vertexShaderSource : drawVS,
fragmentShaderSource : drawFS,
attributeLocations : attributeLocations
});
+ */
+ model._rendererResources.programs[id] = {
+ vertexShaderSource : drawVS,
+ fragmentShaderSource : drawFS,
+ attributeLocations : attributeLocations
+ };
if (model.allowPicking) {
// PERFORMANCE_IDEA: Can optimize this shader with a glTF hint. https://github.com/KhronosGroup/glTF/issues/181
var pickVS = modifyShader(vs, model._pickVertexShaderLoaded);
var pickFS = modifyShader(fs, model._pickFragmentShaderLoaded);
+ /*
model._rendererResources.pickPrograms[id] = ShaderProgram.fromCache({
context : context,
vertexShaderSource : pickVS,
fragmentShaderSource : pickFS,
attributeLocations : attributeLocations
});
+ */
+ model._rendererResources.pickPrograms[id] = {
+ vertexShaderSource : pickVS,
+ fragmentShaderSource : pickFS,
+ attributeLocations : attributeLocations
+ };
}
}
@@ -1816,7 +1845,8 @@ define([
var attributeLocations = getAttributeLocations();
var attributeName;
var attributeLocation;
- var attributes = [];
+ //var attributes = [];
+ var attributes = {};
var primitiveAttributes = primitive.attributes;
for (attributeName in primitiveAttributes) {
if (primitiveAttributes.hasOwnProperty(attributeName)) {
@@ -1825,20 +1855,24 @@ define([
// with an attribute that wasn't used and the asset wasn't optimized.
if (defined(attributeLocation)) {
var a = accessors[primitiveAttributes[attributeName]];
- var normalize = false;
- if (defined(a.normalized) && a.normalized) {
- normalize = true;
- }
-
+ /*
attributes.push({
index : attributeLocation,
vertexBuffer : rendererBuffers[a.bufferView],
componentsPerAttribute : numberOfComponentsForType(a.type),
componentDatatype : a.componentType,
- normalize : normalize,
offsetInBytes : a.byteOffset,
strideInBytes : getAccessorByteStride(gltf, a)
});
+ */
+ attributes[attributeName] = {
+ index : attributeLocation,
+ vertexBuffer : rendererBuffers[a.bufferView],
+ componentsPerAttribute : numberOfComponentsForType(a.type),
+ componentDatatype : a.componentType,
+ offsetInBytes : a.byteOffset,
+ strideInBytes : getAccessorByteStride(gltf, a)
+ };
}
}
}
@@ -1848,11 +1882,17 @@ define([
var accessor = accessors[primitive.indices];
indexBuffer = rendererBuffers[accessor.bufferView];
}
+ /*
rendererVertexArrays[meshId + '.primitive.' + i] = new VertexArray({
context : context,
attributes : attributes,
indexBuffer : indexBuffer
});
+ */
+ rendererVertexArrays[meshId + '.primitive.' + i] = {
+ attributes : attributes,
+ indexBuffer : indexBuffer
+ };
}
}
}
@@ -2242,6 +2282,8 @@ define([
};
function createCommand(model, gltfNode, runtimeNode, context, scene3DOnly) {
+ var batchTable = model._batchTable;
+
var nodeCommands = model._nodeCommands;
var pickIds = model._pickIds;
var allowPicking = model.allowPicking;
@@ -2322,6 +2364,7 @@ define([
};
}
+ /*
var preloadCommand = new DrawCommand({
boundingVolume : new BoundingSphere(), // updated in update()
cull : model.cull,
@@ -2419,6 +2462,111 @@ define([
colorCommand2D : colorCommand2D,
pickCommand2D : pickCommand2D
};
+ */
+
+ var buffer = vertexArray.attributes.POSITION.vertexBuffer;
+ var positionsBuffer = new Float32Array(buffer.buffer, buffer.byteOffset, buffer.byteLength / Float32Array.BYTES_PER_ELEMENT);
+
+ buffer = vertexArray.attributes._BATCHID.vertexBuffer;
+ var vertexBatchIds = new Uint16Array(buffer.buffer, buffer.byteOffset, buffer.byteLength / Uint16Array.BYTES_PER_ELEMENT);
+
+ buffer = vertexArray.indexBuffer.typedArray;
+ var indices;
+ if (vertexArray.indexBuffer.indexDatatype === IndexDatatype.UNSIGNED_SHORT) {
+ indices = new Uint16Array(buffer.buffer, buffer.byteOffset, buffer.byteLength / Uint16Array.BYTES_PER_ELEMENT);
+ } else {
+ indices = new Uint32Array(buffer.buffer, buffer.byteOffset, buffer.byteLength / Uint32Array.BYTES_PER_ELEMENT);
+ }
+
+ positionsBuffer = arraySlice(positionsBuffer);
+ vertexBatchIds = arraySlice(vertexBatchIds);
+ indices = arraySlice(indices, offset, offset + count);
+
+ var batchIds = [];
+ var indexCounts = [];
+ var indexOffsets = [];
+ var batchedIndices = [];
+
+ var currentId = vertexBatchIds[indices[0]];
+ batchIds.push(currentId);
+ indexOffsets.push(0);
+
+ var indicesLength = indices.length;
+ for (var j = 1; j < indicesLength; ++j) {
+ var batchId = vertexBatchIds[indices[j]];
+ if (batchId !== currentId) {
+ var indexOffset = indexOffsets[indexOffsets.length - 1];
+ var indexCount = j - indexOffset;
+
+ batchIds.push(batchId);
+ indexCounts.push(indexCount);
+ indexOffsets.push(j);
+
+ batchedIndices.push(new Vector3DTileBatch({
+ offset : indexOffset,
+ count : indexCount,
+ batchIds : [currentId],
+ color : Color.WHITE
+ }));
+
+ currentId = batchId;
+ }
+ }
+
+ var shader = rendererPrograms[technique.program];
+ var vertexShaderSource = shader.vertexShaderSource;
+ var fragmentShaderSource = shader.fragmentShaderSource;
+ var attributeLocations = shader.attributeLocations;
+
+ var pickVertexShaderSource;
+ var pickFragmentShaderSource;
+ var pickUniformMap;
+ if (allowPicking) {
+ var pickShader = rendererPickPrograms[technique.program];
+ pickVertexShaderSource = pickShader.vertexShaderSource;
+ pickFragmentShaderSource = pickShader.fragmentShaderSource;
+
+ // Callback to override default model picking
+ if (defined(model._pickFragmentShaderLoaded)) {
+ if (defined(model._pickUniformMapLoaded)) {
+ pickUniformMap = model._pickUniformMapLoaded(uniformMap);
+ } else {
+ // This is unlikely, but could happen if the override shader does not
+ // need new uniforms since, for example, its pick ids are coming from
+ // a vertex attribute or are baked into the shader source.
+ pickUniformMap = combine(uniformMap);
+ }
+ } else {
+ var pickId = context.createPickId(owner);
+ pickIds.push(pickId);
+ var pickUniforms = {
+ czm_pickColor : createPickColorFunction(pickId.color)
+ };
+ pickUniformMap = combine(uniformMap, pickUniforms);
+ }
+ }
+
+ var nodeCommand = new Vector3DTilePrimitive({
+ positions : positionsBuffer,
+ indices : indices,
+ indexOffsets : indexOffsets,
+ indexCounts : indexCounts,
+ batchIds : batchIds,
+ vertexBatchIds : vertexBatchIds,
+ batchedIndices : batchedIndices,
+ batchTable : batchTable,
+ boundingVolume : new BoundingSphere(), // updated in update()
+ boundingVolumes : [], // TODO
+ _vertexShaderSource : vertexShaderSource,
+ _fragmentShaderSource : fragmentShaderSource,
+ _attributeLocations : attributeLocations,
+ _pickVertexShaderSource : pickVertexShaderSource,
+ _pickFragmentShaderSource : pickFragmentShaderSource,
+ _uniformMap : uniformMap,
+ _pickUniformMap : pickUniformMap,
+ _modelMatrix : new Matrix4(), // updated in update()
+ _boundingSphere : boundingSphere // used to update boundingVolume
+ });
runtimeNode.commands.push(nodeCommand);
nodeCommands.push(nodeCommand);
}
@@ -2593,16 +2741,20 @@ define([
// Node has meshes, which has primitives. Update their commands.
for (var j = 0; j < commandsLength; ++j) {
var primitiveCommand = commands[j];
- var command = primitiveCommand.preloadCommand;
- Matrix4.clone(nodeMatrix, command.modelMatrix);
+ //var command = primitiveCommand.preloadCommand;
+ //Matrix4.clone(nodeMatrix, command.modelMatrix);
+ Matrix4.clone(nodeMatrix, primitiveCommand._modelMatrix);
// PERFORMANCE_IDEA: Can use transformWithoutScale if no node up to the root has scale (including animation)
- BoundingSphere.transform(primitiveCommand.boundingSphere, command.modelMatrix, command.boundingVolume);
+ //BoundingSphere.transform(primitiveCommand.boundingSphere, command.modelMatrix, command.boundingVolume);
+ BoundingSphere.transform(primitiveCommand._boundingSphere, primitiveCommand._modelMatrix, primitiveCommand._boundingVolume);
if (defined(model._rtcCenter)) {
- Cartesian3.add(model._rtcCenter, command.boundingVolume.center, command.boundingVolume.center);
+ //Cartesian3.add(model._rtcCenter, command.boundingVolume.center, command.boundingVolume.center);
+ Cartesian3.add(model._rtcCenter, primitiveCommand._boundingVolume.center, primitiveCommand._boundingVolume.center);
}
+ /*
if (allowPicking) {
var pickCommand = primitiveCommand.pickCommand;
Matrix4.clone(command.modelMatrix, pickCommand.modelMatrix);
@@ -2625,6 +2777,7 @@ define([
BoundingSphere.clone(command.boundingVolume, pickCommand2D.boundingVolume);
}
}
+ */
}
}
}
@@ -3033,7 +3186,7 @@ define([
return;
}
- var context = frameState.context;
+ //var context = frameState.context;
if ((this._state === ModelState.NEEDS_LOAD) && defined(this.gltf)) {
this._state = ModelState.LOADING;
@@ -3160,6 +3313,7 @@ define([
this._dirty = true;
}
+ /*
if (this._perNodeShowDirty) {
this._perNodeShowDirty = false;
updatePerNodeShow(this);
@@ -3168,6 +3322,7 @@ define([
updateWireframe(this);
updateShowBoundingVolume(this);
updateClassification(this, frameState);
+ */
}
if (justLoaded) {
@@ -3185,13 +3340,14 @@ define([
// and then have them visible immediately when show is set to true.
if (show && !this._ignoreCommands) {
// PERFORMANCE_IDEA: This is terrible
- var commandList = frameState.commandList;
- var passes = frameState.passes;
+ //var commandList = frameState.commandList;
+ //var passes = frameState.passes;
var nodeCommands = this._nodeCommands;
var length = nodeCommands.length;
var i;
var nc;
+ /*
var idl2D = frameState.mapProjection.ellipsoid.maximumRadius * CesiumMath.PI;
var boundingVolume;
@@ -3232,6 +3388,14 @@ define([
}
}
}
+ */
+
+ for (i = 0; i < length; ++i) {
+ nc = nodeCommands[i];
+ //if (nc.show) {
+ nc.update(frameState);
+ //}
+ }
}
};
diff --git a/Source/Scene/Vector3DTilePrimitive.js b/Source/Scene/Vector3DTilePrimitive.js
index 0978d8886c28..4fdad27595e4 100644
--- a/Source/Scene/Vector3DTilePrimitive.js
+++ b/Source/Scene/Vector3DTilePrimitive.js
@@ -155,6 +155,17 @@ define([
*/
this.classificationType = ClassificationType.CESIUM_3D_TILE;
+ // Hidden options
+ this._vertexShaderSource = options._vertexShaderSource;
+ this._fragmentShaderSource = options._fragmentShaderSource;
+ this._attributeLocations = options._attributeLocations;
+ this._pickVertexShaderSource = options._pickVertexShaderSource;
+ this._pickFragmentShaderSource = options._pickFragmentShaderSource;
+ this._uniformMap = options._uniformMap;
+ this._pickUniformMap = options._pickUniformMap;
+ this._modelMatrix = options._modelMatrix;
+ this._boundingSphere = options._boundingSphere;
+
this._batchIdLookUp = {};
var length = this._batchIds.length;
@@ -194,7 +205,7 @@ define([
}
});
- var attributeLocations = {
+ var defaultAttributeLocations = {
position : 0,
a_batchId : 1
};
@@ -222,12 +233,12 @@ define([
});
var vertexAttributes = [{
- index : attributeLocations.position,
+ index : 0,
vertexBuffer : positionBuffer,
componentDatatype : ComponentDatatype.FLOAT,
componentsPerAttribute : 3
}, {
- index : attributeLocations.a_batchId,
+ index : 1,
vertexBuffer : idBuffer,
componentDatatype : ComponentDatatype.UNSIGNED_SHORT,
componentsPerAttribute : 1
@@ -264,6 +275,25 @@ define([
}
var batchTable = primitive._batchTable;
+ var attributeLocations = defaultValue(primitive._attributeLocations, defaultAttributeLocations);
+
+ var vertexShaderSource = primitive._vertexShaderSource;
+ if (defined(vertexShaderSource)) {
+ primitive._sp = ShaderProgram.fromCache({
+ context : context,
+ vertexShaderSource : vertexShaderSource,
+ fragmentShaderSource : primitive._fragmentShaderSource,
+ attributeLocations : attributeLocations
+ });
+ primitive._spStencil = primitive._sp;
+ primitive._spPick = ShaderProgram.fromCache({
+ context : context,
+ vertexShaderSource : primitive._pickVertexShaderSource,
+ fragmentShaderSource : primitive._pickFragmentShaderSource,
+ attributeLocations : attributeLocations
+ });
+ return;
+ }
var vsSource = batchTable.getVertexShaderCallback(false, 'a_batchId')(ShadowVolumeVS);
var fsSource = batchTable.getFragmentShaderCallback()(ShadowVolumeFS, false, undefined);
@@ -451,7 +481,7 @@ define([
return;
}
- primitive._uniformMap = {
+ var uniformMap = {
u_modifiedModelViewProjection : function() {
var viewMatrix = context.uniformState.view;
var projectionMatrix = context.uniformState.projection;
@@ -465,6 +495,9 @@ define([
return primitive._highlightColor;
}
};
+
+ primitive._uniformMap = primitive._batchTable.getUniformMapCallback()(uniformMap);
+ primitive._pickUniformMap = primitive._batchTable.getPickUniformMapCallback()(primitive._uniformMap);
}
function copyIndicesCPU(indices, newIndices, currentOffset, offsets, counts, batchIds, batchIdLookUp) {
@@ -591,6 +624,7 @@ define([
// PERFORMANCE_IDEA: For WebGL 2, we can use copyBufferSubData for buffer-to-buffer copies.
// PERFORMANCE_IDEA: Not supported, but we could use glMultiDrawElements here.
function rebatchCommands(primitive, context) {
+ return false; // TODO
if (!primitive._batchDirty) {
return false;
}
@@ -655,7 +689,7 @@ define([
var vertexArray = primitive._va;
var sp = primitive._sp;
var modelMatrix = Matrix4.IDENTITY;
- var uniformMap = primitive._batchTable.getUniformMapCallback()(primitive._uniformMap);
+ var uniformMap = primitive._uniformMap;
var bv = primitive._boundingVolume;
for (var j = 0; j < length; ++j) {
@@ -756,8 +790,8 @@ define([
var vertexArray = primitive._va;
var spStencil = primitive._spStencil;
var spPick = primitive._spPick;
- var modelMatrix = Matrix4.IDENTITY;
- var uniformMap = primitive._batchTable.getPickUniformMapCallback()(primitive._uniformMap);
+ var modelMatrix = defaultValue(primitive._modelMatrix, Matrix4.IDENTITY);
+ var uniformMap = primitive._pickUniformMap;
for (var j = 0; j < length; ++j) {
var offset = primitive._indexOffsets[j];
From 0d2f1e128c5cee6e34cf48523ebe3657949b4725 Mon Sep 17 00:00:00 2001
From: Dan Bagnell
Date: Tue, 5 Dec 2017 16:18:42 -0500
Subject: [PATCH 12/51] Fix model matrix.
---
Source/Scene/Vector3DTilePrimitive.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Source/Scene/Vector3DTilePrimitive.js b/Source/Scene/Vector3DTilePrimitive.js
index 4fdad27595e4..e6943d4d73f9 100644
--- a/Source/Scene/Vector3DTilePrimitive.js
+++ b/Source/Scene/Vector3DTilePrimitive.js
@@ -688,7 +688,7 @@ define([
var vertexArray = primitive._va;
var sp = primitive._sp;
- var modelMatrix = Matrix4.IDENTITY;
+ var modelMatrix = defaultValue(primitive._modelMatrix, Matrix4.IDENTITY);
var uniformMap = primitive._uniformMap;
var bv = primitive._boundingVolume;
From 6981a686ec95e747e5a0dc0dd528a59ade45db4c Mon Sep 17 00:00:00 2001
From: Dan Bagnell
Date: Tue, 5 Dec 2017 17:24:14 -0500
Subject: [PATCH 13/51] Fix rebatching and remove derived commands.
---
Source/Scene/Batched3DModel3DTileContent.js | 21 +++++++++++---
Source/Scene/ClassificationModel.js | 31 ++++++++++++++++++---
Source/Scene/Vector3DTilePrimitive.js | 1 -
3 files changed, 44 insertions(+), 9 deletions(-)
diff --git a/Source/Scene/Batched3DModel3DTileContent.js b/Source/Scene/Batched3DModel3DTileContent.js
index 6c6d58c54edd..cc7d6d5b0313 100644
--- a/Source/Scene/Batched3DModel3DTileContent.js
+++ b/Source/Scene/Batched3DModel3DTileContent.js
@@ -207,8 +207,9 @@ define([
return function(vs) {
var batchTable = content._batchTable;
var gltf = content._model.gltf;
+ var handleTranslucent = !defined(content._tileset.classificationType);
var batchIdAttributeName = getBatchIdAttributeName(gltf);
- var callback = batchTable.getVertexShaderCallback(true, batchIdAttributeName);
+ var callback = batchTable.getVertexShaderCallback(handleTranslucent, batchIdAttributeName);
return defined(callback) ? callback(vs) : vs;
};
}
@@ -227,8 +228,9 @@ define([
return function(fs) {
var batchTable = content._batchTable;
var gltf = content._model.gltf;
+ var handleTranslucent = !defined(content._tileset.classificationType);
var diffuseUniformName = getAttributeOrUniformBySemantic(gltf, '_3DTILESDIFFUSE');
- var callback = batchTable.getFragmentShaderCallback(true, diffuseUniformName);
+ var callback = batchTable.getFragmentShaderCallback(handleTranslucent, diffuseUniformName);
return defined(callback) ? callback(fs) : fs;
};
}
@@ -241,6 +243,12 @@ define([
};
}
+ function createColorChangedCallback(content) {
+ return function(batchId, color) {
+ content._model.updateCommands(batchId, color);
+ };
+ }
+
function initialize(content, arrayBuffer, byteOffset) {
var tileset = content._tileset;
var tile = content._tile;
@@ -342,7 +350,12 @@ define([
}
}
- var batchTable = new Cesium3DTileBatchTable(content, batchLength, batchTableJson, batchTableBinary);
+ var colorChangeCallback;
+ if (defined(tileset.classificationType)) {
+ colorChangeCallback = createColorChangedCallback(content);
+ }
+
+ var batchTable = new Cesium3DTileBatchTable(content, batchLength, batchTableJson, batchTableBinary, colorChangeCallback);
content._batchTable = batchTable;
var gltfByteLength = byteStart + byteLength - byteOffset;
@@ -480,7 +493,7 @@ define([
// If any commands were pushed, add derived commands
var commandEnd = frameState.commandList.length;
- if ((commandStart < commandEnd) && frameState.passes.render) {
+ if ((commandStart < commandEnd) && frameState.passes.render && !(this._model instanceof ClassificationModel)) {
var finalResolution = this._tile._finalResolution;
this._batchTable.addDerivedCommands(frameState, commandStart, finalResolution);
}
diff --git a/Source/Scene/ClassificationModel.js b/Source/Scene/ClassificationModel.js
index 9da79e2fec5c..8a5f37965a7b 100644
--- a/Source/Scene/ClassificationModel.js
+++ b/Source/Scene/ClassificationModel.js
@@ -1738,7 +1738,7 @@ define([
'void main() \n' +
'{ \n' +
' gl_FragColor = vec4(1.0); \n' +
- '}';
+ '}\n';
if (model.extensionsUsed.WEB3D_quantized_attributes) {
vs = modifyShaderForQuantizedAttributes(vs, id, model);
@@ -2491,12 +2491,15 @@ define([
batchIds.push(currentId);
indexOffsets.push(0);
+ var batchId;
+ var indexOffset;
+ var indexCount;
var indicesLength = indices.length;
for (var j = 1; j < indicesLength; ++j) {
- var batchId = vertexBatchIds[indices[j]];
+ batchId = vertexBatchIds[indices[j]];
if (batchId !== currentId) {
- var indexOffset = indexOffsets[indexOffsets.length - 1];
- var indexCount = j - indexOffset;
+ indexOffset = indexOffsets[indexOffsets.length - 1];
+ indexCount = j - indexOffset;
batchIds.push(batchId);
indexCounts.push(indexCount);
@@ -2513,6 +2516,18 @@ define([
}
}
+ batchId = vertexBatchIds[indices[indicesLength - 1]];
+ indexOffset = indexOffsets[indexOffsets.length - 1];
+ indexCount = indicesLength - indexOffset;
+
+ indexCounts.push(indexCount);
+ batchedIndices.push(new Vector3DTileBatch({
+ offset : indexOffset,
+ count : indexCount,
+ batchIds : [currentId],
+ color : Color.WHITE
+ }));
+
var shader = rendererPrograms[technique.program];
var vertexShaderSource = shader.vertexShaderSource;
var fragmentShaderSource = shader.fragmentShaderSource;
@@ -3171,6 +3186,14 @@ define([
return (distance2 >= nearSquared) && (distance2 <= farSquared);
}
+ Model.prototype.updateCommands = function(batchId, color) {
+ var nodeCommands = this._nodeCommands;
+ var length = nodeCommands.length;
+ for (var i = 0; i < length; ++i) {
+ nodeCommands[i].updateCommands(batchId, color);
+ }
+ };
+
/**
* Called when {@link Viewer} or {@link CesiumWidget} render the scene to
* get the draw commands needed to render this primitive.
diff --git a/Source/Scene/Vector3DTilePrimitive.js b/Source/Scene/Vector3DTilePrimitive.js
index e6943d4d73f9..fa538e4f46ab 100644
--- a/Source/Scene/Vector3DTilePrimitive.js
+++ b/Source/Scene/Vector3DTilePrimitive.js
@@ -624,7 +624,6 @@ define([
// PERFORMANCE_IDEA: For WebGL 2, we can use copyBufferSubData for buffer-to-buffer copies.
// PERFORMANCE_IDEA: Not supported, but we could use glMultiDrawElements here.
function rebatchCommands(primitive, context) {
- return false; // TODO
if (!primitive._batchDirty) {
return false;
}
From e1218d7cf4d875993a4188236ebb6a861bec909a Mon Sep 17 00:00:00 2001
From: Dan Bagnell
Date: Tue, 5 Dec 2017 19:22:41 -0500
Subject: [PATCH 14/51] Clean up.
---
Source/Scene/Batched3DModel3DTileContent.js | 3 +-
Source/Scene/Cesium3DTileset.js | 24 +-
Source/Scene/ClassificationModel.js | 1191 ++-----------------
Source/Scene/Vector3DTilePrimitive.js | 4 +-
4 files changed, 113 insertions(+), 1109 deletions(-)
diff --git a/Source/Scene/Batched3DModel3DTileContent.js b/Source/Scene/Batched3DModel3DTileContent.js
index cc7d6d5b0313..ba2b447c2afd 100644
--- a/Source/Scene/Batched3DModel3DTileContent.js
+++ b/Source/Scene/Batched3DModel3DTileContent.js
@@ -418,7 +418,7 @@ define([
pickVertexShaderLoaded : getPickVertexShaderCallback(content),
pickFragmentShaderLoaded : batchTable.getPickFragmentShaderCallback(),
pickUniformMapLoaded : batchTable.getPickUniformMapCallback(),
- pickObject : pickObject
+ classificationType : tileset._classificationType
});
}
}
@@ -488,7 +488,6 @@ define([
this._model.modelMatrix = this._tile.computedTransform;
this._model.shadows = this._tileset.shadows;
this._model.debugWireframe = this._tileset.debugWireframe;
- this._model.classificationType = this._tileset.classificationType;
this._model.update(frameState);
// If any commands were pushed, add derived commands
diff --git a/Source/Scene/Cesium3DTileset.js b/Source/Scene/Cesium3DTileset.js
index db5982a5fc9c..01590222cabd 100644
--- a/Source/Scene/Cesium3DTileset.js
+++ b/Source/Scene/Cesium3DTileset.js
@@ -222,6 +222,8 @@ define([
this._readyPromise = when.defer();
+ this._classificationType = options.classificationType;
+
/**
* Optimization option. Whether the tileset should refine based on a dynamic screen space error. Tiles that are further
* away will be rendered with lower detail than closer tiles. This improves performance by rendering fewer
@@ -521,15 +523,6 @@ define([
*/
this.loadSiblings = defaultValue(options.loadSiblings, false);
- /**
- * Determines whether terrain, 3D Tiles or both will be classified by vector tiles.
- * @type {ClassificationType}
- * @default undefined
- *
- * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
- */
- this.classificationType = options.classificationType;
-
/**
* This property is for debugging only; it is not optimized for production use.
*
@@ -1053,6 +1046,19 @@ define([
get : function() {
return this._statistics;
}
+ },
+
+ /**
+ * Determines whether terrain, 3D Tiles or both will be classified by this tileset.
+ * @type {ClassificationType}
+ * @default undefined
+ *
+ * @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
+ */
+ classificationType : {
+ get : function() {
+ return this._classificationType;
+ }
}
});
diff --git a/Source/Scene/ClassificationModel.js b/Source/Scene/ClassificationModel.js
index 8a5f37965a7b..7b40d4457766 100644
--- a/Source/Scene/ClassificationModel.js
+++ b/Source/Scene/ClassificationModel.js
@@ -1,11 +1,9 @@
define([
'../Core/arraySlice',
'../Core/BoundingSphere',
- '../Core/Cartesian2',
'../Core/Cartesian3',
'../Core/Cartesian4',
'../Core/Cartographic',
- '../Core/clone',
'../Core/Color',
'../Core/combine',
'../Core/defaultValue',
@@ -15,80 +13,42 @@ define([
'../Core/DeveloperError',
'../Core/DistanceDisplayCondition',
'../Core/FeatureDetection',
- '../Core/getAbsoluteUri',
'../Core/getBaseUri',
- '../Core/getMagic',
- '../Core/getStringFromTypedArray',
'../Core/IndexDatatype',
'../Core/joinUrls',
'../Core/loadArrayBuffer',
- '../Core/loadCRN',
- '../Core/loadImage',
- '../Core/loadImageFromTypedArray',
- '../Core/loadKTX',
- '../Core/loadText',
- '../Core/Math',
'../Core/Matrix2',
'../Core/Matrix3',
'../Core/Matrix4',
- '../Core/PixelFormat',
'../Core/PrimitiveType',
'../Core/Quaternion',
'../Core/Queue',
'../Core/RuntimeError',
'../Core/Transforms',
'../Core/WebGLConstants',
- '../Renderer/Buffer',
- '../Renderer/BufferUsage',
- '../Renderer/DrawCommand',
- '../Renderer/Pass',
- '../Renderer/RenderState',
- '../Renderer/Sampler',
- '../Renderer/ShaderProgram',
'../Renderer/ShaderSource',
- '../Renderer/Texture',
- '../Renderer/TextureMinificationFilter',
- '../Renderer/TextureWrap',
- '../Renderer/VertexArray',
- '../ThirdParty/GltfPipeline/addDefaults',
- '../ThirdParty/GltfPipeline/addPipelineExtras',
'../ThirdParty/GltfPipeline/ForEach',
'../ThirdParty/GltfPipeline/getAccessorByteStride',
'../ThirdParty/GltfPipeline/numberOfComponentsForType',
'../ThirdParty/GltfPipeline/parseBinaryGltf',
- '../ThirdParty/GltfPipeline/processModelMaterialsCommon',
- '../ThirdParty/GltfPipeline/processPbrMetallicRoughness',
- '../ThirdParty/GltfPipeline/updateVersion',
- '../ThirdParty/Uri',
'../ThirdParty/when',
'./AttributeType',
'./Axis',
- './BlendingState',
'./ClassificationType',
- './ColorBlendMode',
- './DepthFunction',
'./getAttributeOrUniformBySemantic',
'./HeightReference',
- './JobType',
- './ModelAnimationCache',
- './ModelAnimationCollection',
'./ModelMaterial',
'./ModelMesh',
'./ModelNode',
'./SceneMode',
- './ShadowMode',
- './StencilFunction',
- './StencilOperation',
'./Vector3DTileBatch',
'./Vector3DTilePrimitive'
], function(
arraySlice,
BoundingSphere,
- Cartesian2,
Cartesian3,
Cartesian4,
Cartographic,
- clone,
Color,
combine,
defaultValue,
@@ -98,70 +58,34 @@ define([
DeveloperError,
DistanceDisplayCondition,
FeatureDetection,
- getAbsoluteUri,
getBaseUri,
- getMagic,
- getStringFromTypedArray,
IndexDatatype,
joinUrls,
loadArrayBuffer,
- loadCRN,
- loadImage,
- loadImageFromTypedArray,
- loadKTX,
- loadText,
- CesiumMath,
Matrix2,
Matrix3,
Matrix4,
- PixelFormat,
PrimitiveType,
Quaternion,
Queue,
RuntimeError,
Transforms,
WebGLConstants,
- Buffer,
- BufferUsage,
- DrawCommand,
- Pass,
- RenderState,
- Sampler,
- ShaderProgram,
ShaderSource,
- Texture,
- TextureMinificationFilter,
- TextureWrap,
- VertexArray,
- addDefaults,
- addPipelineExtras,
ForEach,
getAccessorByteStride,
numberOfComponentsForType,
parseBinaryGltf,
- processModelMaterialsCommon,
- processPbrMetallicRoughness,
- updateVersion,
- Uri,
when,
AttributeType,
Axis,
- BlendingState,
ClassificationType,
- ColorBlendMode,
- DepthFunction,
getAttributeOrUniformBySemantic,
HeightReference,
- JobType,
- ModelAnimationCache,
- ModelAnimationCollection,
ModelMaterial,
ModelMesh,
ModelNode,
SceneMode,
- ShadowMode,
- StencilFunction,
- StencilOperation,
Vector3DTileBatch,
Vector3DTilePrimitive) {
'use strict';
@@ -181,9 +105,6 @@ define([
FAILED : 3
};
- // glTF MIME types discussed in https://github.com/KhronosGroup/glTF/issues/412 and https://github.com/KhronosGroup/glTF/issues/943
- var defaultModelAccept = 'model/gltf-binary,model/gltf+json;q=0.8,application/json;q=0.2,*/*;q=0.01';
-
function LoadResources() {
this.vertexBuffersToCreate = new Queue();
this.indexBuffersToCreate = new Queue();
@@ -285,28 +206,13 @@ define([
///////////////////////////////////////////////////////////////////////////
/**
- * A 3D model based on glTF, the runtime asset format for WebGL, OpenGL ES, and OpenGL.
- *
- * Cesium includes support for geometry and materials, glTF animations, and glTF skinning.
- * In addition, individual glTF nodes are pickable with {@link Scene#pick} and animatable
- * with {@link Model#getNode}. glTF cameras and lights are not currently supported.
- *
- *
- * An external glTF asset is created with {@link Model.fromGltf}. glTF JSON can also be
- * created at runtime and passed to this constructor function. In either case, the
- * {@link Model#readyPromise} is resolved when the model is ready to render, i.e.,
- * when the external binary, image, and shader files are downloaded and the WebGL
- * resources are created.
- *
- *
- * For high-precision rendering, Cesium supports the CESIUM_RTC extension, which introduces the
- * CESIUM_RTC_MODELVIEW parameter semantic that says the node is in WGS84 coordinates translated
- * relative to a local origin.
- *
+ * A 3D model for classifying other 3D assets based on glTF, the runtime asset format for WebGL, OpenGL ES, and OpenGL.
*
- * @alias Model
+ * @alias ClassificationModel
* @constructor
*
+ * @private
+ *
* @param {Object} [options] Object with the following properties:
* @param {Object|ArrayBuffer|Uint8Array} [options.gltf] The object for the glTF JSON or an arraybuffer of Binary glTF defined by the KHR_binary_glTF extension.
* @param {String} [options.basePath=''] The base path that paths in the glTF JSON are relative to.
@@ -316,26 +222,18 @@ define([
* @param {Number} [options.minimumPixelSize=0.0] The approximate minimum pixel size of the model regardless of zoom.
* @param {Number} [options.maximumScale] The maximum scale size of a model. An upper limit for minimumPixelSize.
* @param {Object} [options.id] A user-defined object to return when the model is picked with {@link Scene#pick}.
- * @param {Boolean} [options.allowPicking=true] When true
, each glTF mesh and primitive is pickable with {@link Scene#pick}.
- * @param {Boolean} [options.asynchronous=true] Determines if model WebGL resource creation will be spread out over several frames or block until completion once all glTF files are loaded.
- * @param {Boolean} [options.clampAnimations=true] Determines if the model's animations should hold a pose over frames where no keyframes are specified.
* @param {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Draws the bounding sphere for each draw command in the model.
* @param {Boolean} [options.debugWireframe=false] For debugging only. Draws the model in wireframe.
* @param {HeightReference} [options.heightReference] Determines how the model is drawn relative to terrain.
* @param {Scene} [options.scene] Must be passed in for models that use the height reference property.
* @param {DistanceDisplayCondition} [options.distanceDisplayCondition] The condition specifying at what distance from the camera that this model will be displayed.
- * @param {Color} [options.color=Color.WHITE] A color that blends with the model's rendered color.
- * @param {ColorBlendMode} [options.colorBlendMode=ColorBlendMode.HIGHLIGHT] Defines how the color blends with the model.
- * @param {Number} [options.colorBlendAmount=0.5] Value used to determine the color strength when the colorBlendMode
is MIX
. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two.
*
* @exception {DeveloperError} bgltf is not a valid Binary glTF file.
* @exception {DeveloperError} Only glTF Binary version 1 is supported.
*
- * @see Model.fromGltf
- *
* @demo {@link http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=3D%20Models.html|Cesium Sandcastle Models Demo}
*/
- function Model(options) {
+ function ClassificationModel(options) {
options = defaultValue(options, defaultValue.EMPTY_OBJECT);
var cacheKey = options.cacheKey;
@@ -348,7 +246,7 @@ define([
cachedGltf = gltfCache[cacheKey];
++cachedGltf.count;
} else {
- // glTF was explicitly provided, e.g., when a user uses the Model constructor directly
+ // glTF was explicitly provided, e.g., when a user uses the ClassificationModel constructor directly
var gltf = options.gltf;
if (defined(gltf)) {
@@ -394,9 +292,6 @@ define([
*/
this.show = defaultValue(options.show, true);
- this.classificationType = options.classificationType;
- this._classificationType = undefined;
-
/**
* The 4x4 transformation matrix that transforms the model from model to world coordinates.
* When this is the identity matrix, the model is drawn in world coordinates, i.e., Earth's WGS84 coordinates.
@@ -416,7 +311,7 @@ define([
this._clampedModelMatrix = undefined;
/**
- * A uniform scale applied to this model before the {@link Model#modelMatrix}.
+ * A uniform scale applied to this model before the {@link ClassificationModel#modelMatrix}.
* Values greater than 1.0
increase the size of the model; values
* less than 1.0
decrease.
*
@@ -441,7 +336,7 @@ define([
/**
* The maximum scale size for a model. This can be used to give
- * an upper limit to the {@link Model#minimumPixelSize}, ensuring that the model
+ * an upper limit to the {@link ClassificationModel#minimumPixelSize}, ensuring that the model
* is never an unreasonable scale.
*
* @type {Number}
@@ -464,8 +359,6 @@ define([
/**
* Returns the height reference of the model
*
- * @memberof Model.prototype
- *
* @type {HeightReference}
*
* @default HeightReference.NONE
@@ -482,52 +375,9 @@ define([
}, this);
}
- /**
- * Used for picking primitives that wrap a model.
- *
- * @private
- */
- this._pickObject = options.pickObject;
- this._allowPicking = defaultValue(options.allowPicking, true);
-
this._ready = false;
this._readyPromise = when.defer();
- this._defaultTexture = undefined;
- this._incrementallyLoadTextures = defaultValue(options.incrementallyLoadTextures, true);
- this._asynchronous = defaultValue(options.asynchronous, true);
-
- /**
- * A color that blends with the model's rendered color.
- *
- * @type {Color}
- *
- * @default Color.WHITE
- */
- this.color = defaultValue(options.color, Color.WHITE);
- this._color = new Color();
- this._colorPreviousAlpha = 1.0;
-
- /**
- * Defines how the color blends with the model.
- *
- * @type {ColorBlendMode}
- *
- * @default ColorBlendMode.HIGHLIGHT
- */
- this.colorBlendMode = defaultValue(options.colorBlendMode, ColorBlendMode.HIGHLIGHT);
-
- /**
- * Value used to determine the color strength when the colorBlendMode
is MIX
.
- * A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with
- * any value in-between resulting in a mix of the two.
- *
- * @type {Number}
- *
- * @default 0.5
- */
- this.colorBlendAmount = defaultValue(options.colorBlendAmount, 0.5);
-
/**
* This property is for debugging only; it is not for production use nor is it optimized.
*
@@ -556,6 +406,7 @@ define([
this._debugWireframe = false;
this._distanceDisplayCondition = options.distanceDisplayCondition;
+ this._classificationType = options.classificationType;
// Undocumented options
this._vertexShaderLoaded = options.vertexShaderLoaded;
@@ -565,7 +416,6 @@ define([
this._pickFragmentShaderLoaded = options.pickFragmentShaderLoaded;
this._pickUniformMapLoaded = options.pickUniformMapLoaded;
this._ignoreCommands = defaultValue(options.ignoreCommands, false);
- this._requestType = options.requestType;
this._upAxis = defaultValue(options.upAxis, Axis.Y);
/**
@@ -574,12 +424,6 @@ define([
*/
this.cull = defaultValue(options.cull, true);
- /**
- * @private
- * @readonly
- */
- this.opaquePass = defaultValue(options.opaquePass, Pass.OPAQUE);
-
this._computedModelMatrix = new Matrix4(); // Derived from modelMatrix and scale
this._initialRadius = undefined; // Radius without model's scale property, model-matrix scale, animations, or skins
this._boundingSphere = undefined;
@@ -611,11 +455,8 @@ define([
buffers : {},
vertexArrays : {},
programs : {},
- pickPrograms : {},
- classificationPrograms : {}
+ pickPrograms : {}
};
- this._cachedRendererResources = undefined;
- this._loadRendererResourcesFromCache = false;
this._updatedGltfVersion = false;
this._geometryByteLength = 0;
@@ -631,12 +472,12 @@ define([
this._rtcCenter2D = undefined; // in projected world coordinates
}
- defineProperties(Model.prototype, {
+ defineProperties(ClassificationModel.prototype, {
/**
* The object for the glTF JSON, including properties with default values omitted
* from the JSON provided to this model.
*
- * @memberof Model.prototype
+ * @memberof ClassificationModel.prototype
*
* @type {Object}
* @readonly
@@ -653,12 +494,12 @@ define([
* The key identifying this model in the model cache for glTF JSON, renderer resources, and animations.
* Caching saves memory and improves loading speed when several models with the same url are created.
*
- * This key is automatically generated when the model is created with {@link Model.fromGltf}. If the model
- * is created directly from glTF JSON using the {@link Model} constructor, this key can be manually
+ * This key is automatically generated when the model is created with {@link ClassificationModel.fromGltf}. If the model
+ * is created directly from glTF JSON using the {@link ClassificationModel} constructor, this key can be manually
* provided; otherwise, the model will not be changed.
*
*
- * @memberof Model.prototype
+ * @memberof ClassificationModel.prototype
*
* @type {String}
* @readonly
@@ -678,7 +519,7 @@ define([
* in the same directory as the .gltf. When this is ''
,
* the app's base path is used.
*
- * @memberof Model.prototype
+ * @memberof ClassificationModel.prototype
*
* @type {String}
* @readonly
@@ -693,16 +534,16 @@ define([
/**
* The model's bounding sphere in its local coordinate system. This does not take into
- * account glTF animations and skins nor does it take into account {@link Model#minimumPixelSize}.
+ * account glTF animations and skins nor does it take into account {@link ClassificationModel#minimumPixelSize}.
*
- * @memberof Model.prototype
+ * @memberof ClassificationModel.prototype
*
* @type {BoundingSphere}
* @readonly
*
* @default undefined
*
- * @exception {DeveloperError} The model is not loaded. Use Model.readyPromise or wait for Model.ready to be true.
+ * @exception {DeveloperError} The model is not loaded. Use ClassificationModel.readyPromise or wait for ClassificationModel.ready to be true.
*
* @example
* // Center in WGS84 coordinates
@@ -712,7 +553,7 @@ define([
get : function() {
//>>includeStart('debug', pragmas.debug);
if (this._state !== ModelState.LOADED) {
- throw new DeveloperError('The model is not loaded. Use Model.readyPromise or wait for Model.ready to be true.');
+ throw new DeveloperError('The model is not loaded. Use ClassificationModel.readyPromise or wait for ClassificationModel.ready to be true.');
}
//>>includeEnd('debug');
@@ -740,9 +581,9 @@ define([
/**
* When true
, this model is ready to render, i.e., the external binary, image,
* and shader files were downloaded and the WebGL resources were created. This is set to
- * true
right before {@link Model#readyPromise} is resolved.
+ * true
right before {@link ClassificationModel#readyPromise} is resolved.
*
- * @memberof Model.prototype
+ * @memberof ClassificationModel.prototype
*
* @type {Boolean}
* @readonly
@@ -762,8 +603,8 @@ define([
* This promise is resolved at the end of the frame before the first frame the model is rendered in.
*
*
- * @memberof Model.prototype
- * @type {Promise.}
+ * @memberof ClassificationModel.prototype
+ * @type {Promise.}
* @readonly
*
* @example
@@ -776,7 +617,7 @@ define([
* window.alert(error);
* });
*
- * @see Model#ready
+ * @see ClassificationModel#ready
*/
readyPromise : {
get : function() {
@@ -784,73 +625,10 @@ define([
}
},
- /**
- * Determines if model WebGL resource creation will be spread out over several frames or
- * block until completion once all glTF files are loaded.
- *
- * @memberof Model.prototype
- *
- * @type {Boolean}
- * @readonly
- *
- * @default true
- */
- asynchronous : {
- get : function() {
- return this._asynchronous;
- }
- },
-
- /**
- * When true
, each glTF mesh and primitive is pickable with {@link Scene#pick}. When false
, GPU memory is saved.
- *
- * @memberof Model.prototype
- *
- * @type {Boolean}
- * @readonly
- *
- * @default true
- */
- allowPicking : {
- get : function() {
- return this._allowPicking;
- }
- },
-
- /**
- * Determine if textures may continue to stream in after the model is loaded.
- *
- * @memberof Model.prototype
- *
- * @type {Boolean}
- * @readonly
- *
- * @default true
- */
- incrementallyLoadTextures : {
- get : function() {
- return this._incrementallyLoadTextures;
- }
- },
-
- /**
- * Return the number of pending texture loads.
- *
- * @memberof Model.prototype
- *
- * @type {Number}
- * @readonly
- */
- pendingTextureLoads : {
- get : function() {
- return defined(this._loadResources) ? this._loadResources.pendingTextureLoads : 0;
- }
- },
-
/**
* Returns true if the model was transformed this frame
*
- * @memberof Model.prototype
+ * @memberof ClassificationModel.prototype
*
* @type {Boolean}
* @readonly
@@ -865,7 +643,7 @@ define([
/**
* Gets or sets the condition specifying at what distance from the camera that this model will be displayed.
- * @memberof Model.prototype
+ * @memberof ClassificationModel.prototype
* @type {DistanceDisplayCondition}
* @default undefined
*/
@@ -905,7 +683,7 @@ define([
* Gets the model's up-axis.
* By default models are y-up according to the glTF spec, however geo-referenced models will typically be z-up.
*
- * @memberof Model.prototype
+ * @memberof ClassificationModel.prototype
*
* @type {Number}
* @default Axis.Y
@@ -972,6 +750,17 @@ define([
get : function() {
return this._cachedTexturesByteLength;
}
+ },
+
+ /**
+ * Gets the model's classification type.
+ * @memberof ClassificationModel.prototype
+ * @type {ClassificationType}
+ */
+ classificationType : {
+ get : function() {
+ return this._classificationType;
+ }
}
});
@@ -983,202 +772,7 @@ define([
return array.subarray(offset, offset + length);
}
- function containsGltfMagic(uint8Array) {
- var magic = getMagic(uint8Array);
- return magic === 'glTF';
- }
-
- /**
- *
- * Creates a model from a glTF asset. When the model is ready to render, i.e., when the external binary, image,
- * and shader files are downloaded and the WebGL resources are created, the {@link Model#readyPromise} is resolved.
- *
- *
- * The model can be a traditional glTF asset with a .gltf extension or a Binary glTF using the
- * KHR_binary_glTF extension with a .glb extension.
- *
- *
- * For high-precision rendering, Cesium supports the CESIUM_RTC extension, which introduces the
- * CESIUM_RTC_MODELVIEW parameter semantic that says the node is in WGS84 coordinates translated
- * relative to a local origin.
- *
- *
- * @param {Object} options Object with the following properties:
- * @param {String} options.url The url to the .gltf file.
- * @param {Object} [options.headers] HTTP headers to send with the request.
- * @param {String} [options.basePath] The base path that paths in the glTF JSON are relative to.
- * @param {Boolean} [options.show=true] Determines if the model primitive will be shown.
- * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms the model from model to world coordinates.
- * @param {Number} [options.scale=1.0] A uniform scale applied to this model.
- * @param {Number} [options.minimumPixelSize=0.0] The approximate minimum pixel size of the model regardless of zoom.
- * @param {Number} [options.maximumScale] The maximum scale for the model.
- * @param {Object} [options.id] A user-defined object to return when the model is picked with {@link Scene#pick}.
- * @param {Boolean} [options.allowPicking=true] When true
, each glTF mesh and primitive is pickable with {@link Scene#pick}.
- * @param {Boolean} [options.incrementallyLoadTextures=true] Determine if textures may continue to stream in after the model is loaded.
- * @param {Boolean} [options.asynchronous=true] Determines if model WebGL resource creation will be spread out over several frames or block until completion once all glTF files are loaded.
- * @param {Boolean} [options.clampAnimations=true] Determines if the model's animations should hold a pose over frames where no keyframes are specified.
- * @param {ShadowMode} [options.shadows=ShadowMode.ENABLED] Determines whether the model casts or receives shadows from each light source.
- * @param {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Draws the bounding sphere for each {@link DrawCommand} in the model.
- * @param {Boolean} [options.debugWireframe=false] For debugging only. Draws the model in wireframe.
- *
- * @returns {Model} The newly created model.
- *
- * @exception {DeveloperError} bgltf is not a valid Binary glTF file.
- * @exception {DeveloperError} Only glTF Binary version 1 is supported.
- *
- * @example
- * // Example 1. Create a model from a glTF asset
- * var model = scene.primitives.add(Cesium.Model.fromGltf({
- * url : './duck/duck.gltf'
- * }));
- *
- * @example
- * // Example 2. Create model and provide all properties and events
- * var origin = Cesium.Cartesian3.fromDegrees(-95.0, 40.0, 200000.0);
- * var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(origin);
- *
- * var model = scene.primitives.add(Cesium.Model.fromGltf({
- * url : './duck/duck.gltf',
- * show : true, // default
- * modelMatrix : modelMatrix,
- * scale : 2.0, // double size
- * minimumPixelSize : 128, // never smaller than 128 pixels
- * maximumScale: 20000, // never larger than 20000 * model size (overrides minimumPixelSize)
- * allowPicking : false, // not pickable
- * debugShowBoundingVolume : false, // default
- * debugWireframe : false
- * }));
- *
- * model.readyPromise.then(function(model) {
- * // Play all animations when the model is ready to render
- * model.activeAnimations.addAll();
- * });
- */
- Model.fromGltf = function(options) {
- //>>includeStart('debug', pragmas.debug);
- if (!defined(options) || !defined(options.url)) {
- throw new DeveloperError('options.url is required');
- }
- //>>includeEnd('debug');
-
- var url = options.url;
- // If no cache key is provided, use the absolute URL, since two URLs with
- // different relative paths could point to the same model.
- var cacheKey = defaultValue(options.cacheKey, getAbsoluteUri(url));
- var basePath = defaultValue(options.basePath, getBaseUri(url, true));
-
- options = clone(options);
- if (defined(options.basePath) && !defined(options.cacheKey)) {
- cacheKey += basePath;
- }
-
- options.cacheKey = cacheKey;
- options.basePath = basePath;
- var model = new Model(options);
-
- options.headers = defined(options.headers) ? clone(options.headers) : {};
- if (!defined(options.headers.Accept)) {
- options.headers.Accept = defaultModelAccept;
- }
-
- var cachedGltf = gltfCache[cacheKey];
- if (!defined(cachedGltf)) {
- cachedGltf = new CachedGltf({
- ready : false
- });
- cachedGltf.count = 1;
- cachedGltf.modelsToLoad.push(model);
- setCachedGltf(model, cachedGltf);
- gltfCache[cacheKey] = cachedGltf;
-
- loadArrayBuffer(url, options.headers).then(function(arrayBuffer) {
- var array = new Uint8Array(arrayBuffer);
- if (containsGltfMagic(array)) {
- // Load binary glTF
- var parsedGltf = parseBinaryGltf(array);
- // KHR_binary_glTF is from the beginning of the binary section
- cachedGltf.makeReady(parsedGltf, array);
- } else {
- // Load text (JSON) glTF
- var json = getStringFromTypedArray(array);
- cachedGltf.makeReady(JSON.parse(json));
- }
- }).otherwise(getFailedLoadFunction(model, 'model', url));
- } else if (!cachedGltf.ready) {
- // Cache hit but the loadArrayBuffer() or loadText() request is still pending
- ++cachedGltf.count;
- cachedGltf.modelsToLoad.push(model);
- }
- // else if the cached glTF is defined and ready, the
- // model constructor will pick it up using the cache key.
-
- return model;
- };
-
- /**
- * For the unit tests to verify model caching.
- *
- * @private
- */
- Model._gltfCache = gltfCache;
-
- function getRuntime(model, runtimeName, name) {
- //>>includeStart('debug', pragmas.debug);
- if (model._state !== ModelState.LOADED) {
- throw new DeveloperError('The model is not loaded. Use Model.readyPromise or wait for Model.ready to be true.');
- }
-
- if (!defined(name)) {
- throw new DeveloperError('name is required.');
- }
- //>>includeEnd('debug');
-
- return (model._runtime[runtimeName])[name];
- }
-
- /**
- * Returns the glTF node with the given name
property. This is used to
- * modify a node's transform for animation outside of glTF animations.
- *
- * @param {String} name The glTF name of the node.
- * @returns {ModelNode} The node or undefined
if no node with name
exists.
- *
- * @exception {DeveloperError} The model is not loaded. Use Model.readyPromise or wait for Model.ready to be true.
- *
- * @example
- * // Apply non-uniform scale to node LOD3sp
- * var node = model.getNode('LOD3sp');
- * node.matrix = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(5.0, 1.0, 1.0), node.matrix);
- */
- Model.prototype.getNode = function(name) {
- var node = getRuntime(this, 'nodesByName', name);
- return defined(node) ? node.publicNode : undefined;
- };
-
- /**
- * Returns the glTF mesh with the given name
property.
- *
- * @param {String} name The glTF name of the mesh.
- *
- * @returns {ModelMesh} The mesh or undefined
if no mesh with name
exists.
- *
- * @exception {DeveloperError} The model is not loaded. Use Model.readyPromise or wait for Model.ready to be true.
- */
- Model.prototype.getMesh = function(name) {
- return getRuntime(this, 'meshesByName', name);
- };
-
- /**
- * Returns the glTF material with the given name
property.
- *
- * @param {String} name The glTF name of the material.
- * @returns {ModelMaterial} The material or undefined
if no material with name
exists.
- *
- * @exception {DeveloperError} The model is not loaded. Use Model.readyPromise or wait for Model.ready to be true.
- */
- Model.prototype.getMaterial = function(name) {
- return getRuntime(this, 'materialsByName', name);
- };
+ ClassificationModel._gltfCache = gltfCache;
var aMinScratch = new Cartesian3();
var aMaxScratch = new Cartesian3();
@@ -1502,38 +1096,19 @@ define([
return cachedExtensionsRequired;
}
- function createVertexBuffer(bufferViewId, model, context) {
+ function createVertexBuffer(bufferViewId, model) {
var loadResources = model._loadResources;
var bufferViews = model.gltf.bufferViews;
var bufferView = bufferViews[bufferViewId];
-
- /*
- var vertexBuffer = Buffer.createVertexBuffer({
- context : context,
- typedArray : loadResources.getBuffer(bufferView),
- usage : BufferUsage.STATIC_DRAW
- });
- vertexBuffer.vertexArrayDestroyable = false;
- */
var vertexBuffer = loadResources.getBuffer(bufferView);
model._rendererResources.buffers[bufferViewId] = vertexBuffer;
model._geometryByteLength += vertexBuffer.byteLength;
}
- function createIndexBuffer(bufferViewId, componentType, model, context) {
+ function createIndexBuffer(bufferViewId, componentType, model) {
var loadResources = model._loadResources;
var bufferViews = model.gltf.bufferViews;
var bufferView = bufferViews[bufferViewId];
-
- /*
- var indexBuffer = Buffer.createIndexBuffer({
- context : context,
- typedArray : loadResources.getBuffer(bufferView),
- usage : BufferUsage.STATIC_DRAW,
- indexDatatype : componentType
- });
- indexBuffer.vertexArrayDestroyable = false;
- */
var indexBuffer = {
typedArray : loadResources.getBuffer(bufferView),
indexDatatype : componentType
@@ -1542,24 +1117,23 @@ define([
model._geometryByteLength += indexBuffer.typedArray.byteLength;
}
- function createBuffers(model, frameState) {
+ function createBuffers(model) {
var loadResources = model._loadResources;
if (loadResources.pendingBufferLoads !== 0) {
return;
}
- var context = frameState.context;
var vertexBuffersToCreate = loadResources.vertexBuffersToCreate;
var indexBuffersToCreate = loadResources.indexBuffersToCreate;
while (vertexBuffersToCreate.length > 0) {
- createVertexBuffer(vertexBuffersToCreate.dequeue(), model, context);
+ createVertexBuffer(vertexBuffersToCreate.dequeue(), model);
}
while (indexBuffersToCreate.length > 0) {
var i = indexBuffersToCreate.dequeue();
- createIndexBuffer(i.id, i.componentType, model, context);
+ createIndexBuffer(i.id, i.componentType, model);
}
}
@@ -1698,7 +1272,7 @@ define([
return shader;
}
- function createProgram(id, model, context) {
+ function createProgram(id, model) {
var positionName = getAttributeOrUniformBySemantic(model.gltf, 'POSITION');
var batchIdName = getAttributeOrUniformBySemantic(model.gltf, '_BATCHID');
@@ -1747,42 +1321,24 @@ define([
var drawVS = modifyShader(vs, model._vertexShaderLoaded);
var drawFS = modifyShader(fs, model._classificationShaderLoaded);
- /*
- model._rendererResources.programs[id] = ShaderProgram.fromCache({
- context : context,
- vertexShaderSource : drawVS,
- fragmentShaderSource : drawFS,
- attributeLocations : attributeLocations
- });
- */
model._rendererResources.programs[id] = {
vertexShaderSource : drawVS,
fragmentShaderSource : drawFS,
attributeLocations : attributeLocations
};
- if (model.allowPicking) {
- // PERFORMANCE_IDEA: Can optimize this shader with a glTF hint. https://github.com/KhronosGroup/glTF/issues/181
- var pickVS = modifyShader(vs, model._pickVertexShaderLoaded);
- var pickFS = modifyShader(fs, model._pickFragmentShaderLoaded);
-
- /*
- model._rendererResources.pickPrograms[id] = ShaderProgram.fromCache({
- context : context,
- vertexShaderSource : pickVS,
- fragmentShaderSource : pickFS,
- attributeLocations : attributeLocations
- });
- */
- model._rendererResources.pickPrograms[id] = {
- vertexShaderSource : pickVS,
- fragmentShaderSource : pickFS,
- attributeLocations : attributeLocations
- };
- }
+ // PERFORMANCE_IDEA: Can optimize this shader with a glTF hint. https://github.com/KhronosGroup/glTF/issues/181
+ var pickVS = modifyShader(vs, model._pickVertexShaderLoaded);
+ var pickFS = modifyShader(fs, model._pickFragmentShaderLoaded);
+
+ model._rendererResources.pickPrograms[id] = {
+ vertexShaderSource : pickVS,
+ fragmentShaderSource : pickFS,
+ attributeLocations : attributeLocations
+ };
}
- function createPrograms(model, frameState) {
+ function createPrograms(model) {
var loadResources = model._loadResources;
var programsToCreate = loadResources.programsToCreate;
@@ -1796,10 +1352,9 @@ define([
return;
}
- var context = frameState.context;
// Create all loaded programs this frame
while (programsToCreate.length > 0) {
- createProgram(programsToCreate.dequeue(), model, context);
+ createProgram(programsToCreate.dequeue(), model);
}
}
@@ -1810,7 +1365,7 @@ define([
};
}
- function createVertexArrays(model, context) {
+ function createVertexArrays(model) {
var loadResources = model._loadResources;
if (!loadResources.finishedBuffersCreation() || !loadResources.finishedProgramCreation()) {
@@ -1845,7 +1400,6 @@ define([
var attributeLocations = getAttributeLocations();
var attributeName;
var attributeLocation;
- //var attributes = [];
var attributes = {};
var primitiveAttributes = primitive.attributes;
for (attributeName in primitiveAttributes) {
@@ -1855,16 +1409,6 @@ define([
// with an attribute that wasn't used and the asset wasn't optimized.
if (defined(attributeLocation)) {
var a = accessors[primitiveAttributes[attributeName]];
- /*
- attributes.push({
- index : attributeLocation,
- vertexBuffer : rendererBuffers[a.bufferView],
- componentsPerAttribute : numberOfComponentsForType(a.type),
- componentDatatype : a.componentType,
- offsetInBytes : a.byteOffset,
- strideInBytes : getAccessorByteStride(gltf, a)
- });
- */
attributes[attributeName] = {
index : attributeLocation,
vertexBuffer : rendererBuffers[a.bufferView],
@@ -1882,13 +1426,6 @@ define([
var accessor = accessors[primitive.indices];
indexBuffer = rendererBuffers[accessor.bufferView];
}
- /*
- rendererVertexArrays[meshId + '.primitive.' + i] = new VertexArray({
- context : context,
- attributes : attributes,
- indexBuffer : indexBuffer
- });
- */
rendererVertexArrays[meshId + '.primitive.' + i] = {
attributes : attributes,
indexBuffer : indexBuffer
@@ -2168,125 +1705,11 @@ define([
}
}
- var stencilMask = 0x0F;
- var stencilReference = 0;
-
- var classificationPreloadRS = {
- colorMask : {
- red : false,
- green : false,
- blue : false,
- alpha : false
- },
- stencilTest : {
- enabled : true,
- frontFunction : StencilFunction.ALWAYS,
- frontOperation : {
- fail : StencilOperation.KEEP,
- zFail : StencilOperation.DECREMENT_WRAP,
- zPass : StencilOperation.DECREMENT_WRAP
- },
- backFunction : StencilFunction.ALWAYS,
- backOperation : {
- fail : StencilOperation.KEEP,
- zFail : StencilOperation.INCREMENT_WRAP,
- zPass : StencilOperation.INCREMENT_WRAP
- },
- reference : stencilReference,
- mask : stencilMask
- },
- depthTest : {
- enabled : false
- },
- depthMask : false
- };
-
- var classificationStencilRS = {
- colorMask : {
- red : false,
- green : false,
- blue : false,
- alpha : false
- },
- stencilTest : {
- enabled : true,
- frontFunction : StencilFunction.ALWAYS,
- frontOperation : {
- fail : StencilOperation.KEEP,
- zFail : StencilOperation.KEEP,
- zPass : StencilOperation.INCREMENT_WRAP
- },
- backFunction : StencilFunction.ALWAYS,
- backOperation : {
- fail : StencilOperation.KEEP,
- zFail : StencilOperation.KEEP,
- zPass : StencilOperation.DECREMENT_WRAP
- },
- reference : stencilReference,
- mask : stencilMask
- },
- depthTest : {
- enabled : true,
- func : DepthFunction.LESS_OR_EQUAL
- },
- depthMask : false
- };
-
- var classificationColorRS = {
- stencilTest : {
- enabled : true,
- frontFunction : StencilFunction.NOT_EQUAL,
- frontOperation : {
- fail : StencilOperation.KEEP,
- zFail : StencilOperation.KEEP,
- zPass : StencilOperation.DECREMENT_WRAP
- },
- backFunction : StencilFunction.NOT_EQUAL,
- backOperation : {
- fail : StencilOperation.KEEP,
- zFail : StencilOperation.KEEP,
- zPass : StencilOperation.DECREMENT_WRAP
- },
- reference : stencilReference,
- mask : stencilMask
- },
- depthTest : {
- enabled : false
- },
- depthMask : false,
- blending : BlendingState.ALPHA_BLEND
- };
-
- var pickRenderState = {
- stencilTest : {
- enabled : true,
- frontFunction : StencilFunction.NOT_EQUAL,
- frontOperation : {
- fail : StencilOperation.KEEP,
- zFail : StencilOperation.KEEP,
- zPass : StencilOperation.DECREMENT_WRAP
- },
- backFunction : StencilFunction.NOT_EQUAL,
- backOperation : {
- fail : StencilOperation.KEEP,
- zFail : StencilOperation.KEEP,
- zPass : StencilOperation.DECREMENT_WRAP
- },
- reference : stencilReference,
- mask : stencilMask
- },
- depthTest : {
- enabled : false
- },
- depthMask : false
- };
-
- function createCommand(model, gltfNode, runtimeNode, context, scene3DOnly) {
+ function createCommand(model, gltfNode, runtimeNode, context) {
var batchTable = model._batchTable;
var nodeCommands = model._nodeCommands;
var pickIds = model._pickIds;
- var allowPicking = model.allowPicking;
var runtimeMeshesByName = model._runtime.meshesByName;
var resources = model._rendererResources;
@@ -2364,106 +1787,6 @@ define([
};
}
- /*
- var preloadCommand = new DrawCommand({
- boundingVolume : new BoundingSphere(), // updated in update()
- cull : model.cull,
- modelMatrix : new Matrix4(), // computed in update()
- primitiveType : primitive.mode,
- vertexArray : vertexArray,
- count : count,
- offset : offset,
- shaderProgram : rendererPrograms[technique.program],
- uniformMap : uniformMap,
- renderState : RenderState.fromCache(classificationPreloadRS),
- owner : owner,
- pass : model.opaquePass
- });
-
- var stencilCommand = DrawCommand.shallowClone(preloadCommand);
- stencilCommand.renderState = RenderState.fromCache(classificationStencilRS);
-
- var colorCommand = DrawCommand.shallowClone(preloadCommand);
- colorCommand.renderState = RenderState.fromCache(classificationColorRS);
-
- var pickCommand;
-
- if (allowPicking) {
- var pickUniformMap;
-
- // Callback to override default model picking
- if (defined(model._pickFragmentShaderLoaded)) {
- if (defined(model._pickUniformMapLoaded)) {
- pickUniformMap = model._pickUniformMapLoaded(uniformMap);
- } else {
- // This is unlikely, but could happen if the override shader does not
- // need new uniforms since, for example, its pick ids are coming from
- // a vertex attribute or are baked into the shader source.
- pickUniformMap = combine(uniformMap);
- }
- } else {
- var pickId = context.createPickId(owner);
- pickIds.push(pickId);
- var pickUniforms = {
- czm_pickColor : createPickColorFunction(pickId.color)
- };
- pickUniformMap = combine(uniformMap, pickUniforms);
- }
-
- pickCommand = new DrawCommand({
- boundingVolume : new BoundingSphere(), // updated in update()
- cull : model.cull,
- modelMatrix : new Matrix4(), // computed in update()
- primitiveType : primitive.mode,
- vertexArray : vertexArray,
- count : count,
- offset : offset,
- shaderProgram : rendererPickPrograms[technique.program],
- uniformMap : pickUniformMap,
- renderState : RenderState.fromCache(pickRenderState),
- owner : owner,
- pass : model.opaquePass
- });
- }
-
- var preloadCommand2D;
- var stencilCommand2D;
- var colorCommand2D;
- var pickCommand2D;
- if (!scene3DOnly) {
- preloadCommand2D = DrawCommand.shallowClone(preloadCommand);
- preloadCommand2D.boundingVolume = new BoundingSphere(); // updated in update()
- preloadCommand2D.modelMatrix = new Matrix4(); // updated in update()
-
- stencilCommand2D = DrawCommand.shallowClone(stencilCommand);
- stencilCommand2D.boundingVolume = preloadCommand2D.boundingVolume;
- stencilCommand2D.modelMatrix = preloadCommand2D.modelMatrix;
-
- colorCommand2D = DrawCommand.shallowClone(colorCommand);
- colorCommand2D.boundingVolume = preloadCommand2D.boundingVolume;
- colorCommand2D.modelMatrix = preloadCommand2D.modelMatrix;
-
- if (allowPicking) {
- pickCommand2D = DrawCommand.shallowClone(pickCommand);
- pickCommand2D.boundingVolume = preloadCommand2D.boundingVolume;
- pickCommand2D.modelMatrix = preloadCommand2D.modelMatrix;
- }
- }
-
- var nodeCommand = {
- show : true,
- boundingSphere : boundingSphere,
- preloadCommand : preloadCommand,
- stencilCommand : stencilCommand,
- colorCommand : colorCommand,
- pickCommand : pickCommand,
- preloadCommand2D : preloadCommand2D,
- stencilCommand2D : stencilCommand2D,
- colorCommand2D : colorCommand2D,
- pickCommand2D : pickCommand2D
- };
- */
-
var buffer = vertexArray.attributes.POSITION.vertexBuffer;
var positionsBuffer = new Float32Array(buffer.buffer, buffer.byteOffset, buffer.byteLength / Float32Array.BYTES_PER_ELEMENT);
@@ -2533,35 +1856,32 @@ define([
var fragmentShaderSource = shader.fragmentShaderSource;
var attributeLocations = shader.attributeLocations;
- var pickVertexShaderSource;
- var pickFragmentShaderSource;
var pickUniformMap;
- if (allowPicking) {
- var pickShader = rendererPickPrograms[technique.program];
- pickVertexShaderSource = pickShader.vertexShaderSource;
- pickFragmentShaderSource = pickShader.fragmentShaderSource;
-
- // Callback to override default model picking
- if (defined(model._pickFragmentShaderLoaded)) {
- if (defined(model._pickUniformMapLoaded)) {
- pickUniformMap = model._pickUniformMapLoaded(uniformMap);
- } else {
- // This is unlikely, but could happen if the override shader does not
- // need new uniforms since, for example, its pick ids are coming from
- // a vertex attribute or are baked into the shader source.
- pickUniformMap = combine(uniformMap);
- }
+ var pickShader = rendererPickPrograms[technique.program];
+ var pickVertexShaderSource = pickShader.vertexShaderSource;
+ var pickFragmentShaderSource = pickShader.fragmentShaderSource;
+
+ // Callback to override default model picking
+ if (defined(model._pickFragmentShaderLoaded)) {
+ if (defined(model._pickUniformMapLoaded)) {
+ pickUniformMap = model._pickUniformMapLoaded(uniformMap);
} else {
- var pickId = context.createPickId(owner);
- pickIds.push(pickId);
- var pickUniforms = {
- czm_pickColor : createPickColorFunction(pickId.color)
- };
- pickUniformMap = combine(uniformMap, pickUniforms);
+ // This is unlikely, but could happen if the override shader does not
+ // need new uniforms since, for example, its pick ids are coming from
+ // a vertex attribute or are baked into the shader source.
+ pickUniformMap = combine(uniformMap);
}
+ } else {
+ var pickId = context.createPickId(owner);
+ pickIds.push(pickId);
+ var pickUniforms = {
+ czm_pickColor : createPickColorFunction(pickId.color)
+ };
+ pickUniformMap = combine(uniformMap, pickUniforms);
}
var nodeCommand = new Vector3DTilePrimitive({
+ classificationType : model._classificationType,
positions : positionsBuffer,
indices : indices,
indexOffsets : indexOffsets,
@@ -2571,7 +1891,6 @@ define([
batchedIndices : batchedIndices,
batchTable : batchTable,
boundingVolume : new BoundingSphere(), // updated in update()
- boundingVolumes : [], // TODO
_vertexShaderSource : vertexShaderSource,
_fragmentShaderSource : fragmentShaderSource,
_attributeLocations : attributeLocations,
@@ -2588,7 +1907,7 @@ define([
}
- function createRuntimeNodes(model, context, scene3DOnly) {
+ function createRuntimeNodes(model, context) {
var loadResources = model._loadResources;
if (!loadResources.finishedEverythingButTextureCreation()) {
@@ -2648,7 +1967,7 @@ define([
}
if (defined(gltfNode.mesh)) {
- createCommand(model, gltfNode, runtimeNode, context, scene3DOnly);
+ createCommand(model, gltfNode, runtimeNode, context);
}
var children = gltfNode.children;
@@ -2672,21 +1991,13 @@ define([
function createResources(model, frameState) {
var context = frameState.context;
- var scene3DOnly = frameState.scene3DOnly;
checkSupportedGlExtensions(model, context);
- createBuffers(model, frameState); // using glTF bufferViews
- createPrograms(model, frameState);
-
- if (!model._loadRendererResourcesFromCache) {
- createVertexArrays(model, context); // using glTF meshes
- // Long-term, we might not cache render states if they could change
- // due to an animation, e.g., a uniform going from opaque to transparent.
- // Could use copy-on-write if it is worth it. Probably overkill.
- }
-
- createUniformMaps(model, context); // using glTF materials/techniques
- createRuntimeNodes(model, context, scene3DOnly); // using glTF scene
+ createBuffers(model); // using glTF bufferViews
+ createPrograms(model);
+ createVertexArrays(model); // using glTF meshes
+ createUniformMaps(model, context); // using glTF materials/techniques
+ createRuntimeNodes(model, context); // using glTF scene
}
///////////////////////////////////////////////////////////////////////////
@@ -2713,7 +2024,6 @@ define([
function updateNodeHierarchyModelMatrix(model, modelTransformChanged, justLoaded, projection) {
var maxDirtyNumber = model._maxDirtyNumber;
- var allowPicking = model.allowPicking;
var rootNodes = model._runtime.rootNodes;
var length = rootNodes.length;
@@ -2756,43 +2066,14 @@ define([
// Node has meshes, which has primitives. Update their commands.
for (var j = 0; j < commandsLength; ++j) {
var primitiveCommand = commands[j];
- //var command = primitiveCommand.preloadCommand;
- //Matrix4.clone(nodeMatrix, command.modelMatrix);
Matrix4.clone(nodeMatrix, primitiveCommand._modelMatrix);
// PERFORMANCE_IDEA: Can use transformWithoutScale if no node up to the root has scale (including animation)
- //BoundingSphere.transform(primitiveCommand.boundingSphere, command.modelMatrix, command.boundingVolume);
BoundingSphere.transform(primitiveCommand._boundingSphere, primitiveCommand._modelMatrix, primitiveCommand._boundingVolume);
if (defined(model._rtcCenter)) {
- //Cartesian3.add(model._rtcCenter, command.boundingVolume.center, command.boundingVolume.center);
Cartesian3.add(model._rtcCenter, primitiveCommand._boundingVolume.center, primitiveCommand._boundingVolume.center);
}
-
- /*
- if (allowPicking) {
- var pickCommand = primitiveCommand.pickCommand;
- Matrix4.clone(command.modelMatrix, pickCommand.modelMatrix);
- BoundingSphere.clone(command.boundingVolume, pickCommand.boundingVolume);
- }
-
- // If the model crosses the IDL in 2D, it will be drawn in one viewport, but part of it
- // will be clipped by the viewport. We create a second command that translates the model
- // model matrix to the opposite side of the map so the part that was clipped in one viewport
- // is drawn in the other.
- command = primitiveCommand.preloadCommand2D;
- if (defined(command) && model._mode === SceneMode.SCENE2D) {
- Matrix4.clone(nodeMatrix, command.modelMatrix);
- command.modelMatrix[13] -= CesiumMath.sign(command.modelMatrix[13]) * 2.0 * CesiumMath.PI * projection.ellipsoid.maximumRadius;
- BoundingSphere.transform(primitiveCommand.boundingSphere, command.modelMatrix, command.boundingVolume);
-
- if (allowPicking) {
- var pickCommand2D = primitiveCommand.pickCommand2D;
- Matrix4.clone(command.modelMatrix, pickCommand2D.modelMatrix);
- BoundingSphere.clone(command.boundingVolume, pickCommand2D.boundingVolume);
- }
- }
- */
}
}
}
@@ -2827,133 +2108,6 @@ define([
++model._maxDirtyNumber;
}
- function updatePerNodeShow(model) {
- // Totally not worth it, but we could optimize this:
- // http://blogs.agi.com/insight3d/index.php/2008/02/13/deletion-in-bounding-volume-hierarchies/
-
- var rootNodes = model._runtime.rootNodes;
- var length = rootNodes.length;
-
- var nodeStack = scratchNodeStack;
-
- for (var i = 0; i < length; ++i) {
- var n = rootNodes[i];
- n.computedShow = n.publicNode.show;
- nodeStack.push(n);
-
- while (nodeStack.length > 0) {
- n = nodeStack.pop();
- var show = n.computedShow;
-
- var nodeCommands = n.commands;
- var nodeCommandsLength = nodeCommands.length;
- for (var j = 0; j < nodeCommandsLength; ++j) {
- nodeCommands[j].show = show;
- }
- // if commandsLength is zero, the node has a light or camera
-
- var children = n.children;
- var childrenLength = children.length;
- for (var k = 0; k < childrenLength; ++k) {
- var child = children[k];
- // Parent needs to be shown for child to be shown.
- child.computedShow = show && child.publicNode.show;
- nodeStack.push(child);
- }
- }
- }
- }
-
- function updatePickIds(model, context) {
- var id = model.id;
- if (model._id !== id) {
- model._id = id;
-
- var pickIds = model._pickIds;
- var length = pickIds.length;
- for (var i = 0; i < length; ++i) {
- pickIds[i].object.id = id;
- }
- }
- }
-
- function updateWireframe(model) {
- if (model._debugWireframe !== model.debugWireframe) {
- model._debugWireframe = model.debugWireframe;
-
- // This assumes the original primitive was TRIANGLES and that the triangles
- // are connected for the wireframe to look perfect.
- var primitiveType = model.debugWireframe ? PrimitiveType.LINES : PrimitiveType.TRIANGLES;
- var nodeCommands = model._nodeCommands;
- var length = nodeCommands.length;
-
- for (var i = 0; i < length; ++i) {
- nodeCommands[i].command.primitiveType = primitiveType;
- }
- }
- }
-
- function updateShowBoundingVolume(model) {
- if (model.debugShowBoundingVolume !== model._debugShowBoundingVolume) {
- model._debugShowBoundingVolume = model.debugShowBoundingVolume;
-
- var debugShowBoundingVolume = model.debugShowBoundingVolume;
- var nodeCommands = model._nodeCommands;
- var length = nodeCommands.length;
-
- for (var i = 0; i < length; ++i) {
- nodeCommands[i].command.debugShowBoundingVolume = debugShowBoundingVolume;
- }
- }
- }
-
- function updateClassification(model, frameState) {
- var dirty = model._classificationType !== model.classificationType || model._dirty;
- model._classificationType = model.classificationType;
-
- if (!dirty) {
- return;
- }
-
- var pass;
- switch (model._classificationType) {
- case ClassificationType.TERRAIN:
- pass = Pass.TERRAIN_CLASSIFICATION;
- break;
- case ClassificationType.CESIUM_3D_TILE:
- pass = Pass.CESIUM_3D_TILE_CLASSIFICATION;
- break;
- default:
- pass = Pass.CLASSIFICATION;
- }
-
- var scene3DOnly = frameState.scene3DOnly;
- var allowPicking = model.allowPicking;
- var nodeCommands = model._nodeCommands;
- var length = nodeCommands.length;
- for (var i = 0; i < length; ++i) {
- var nodeCommand = nodeCommands[i];
-
- nodeCommand.preloadCommand.pass = pass;
- nodeCommand.stencilCommand.pass = pass;
- nodeCommand.colorCommand.pass = pass;
-
- if (allowPicking) {
- nodeCommand.pickCommand.pass = pass;
- }
-
- if (!scene3DOnly) {
- nodeCommand.preloadCommand2D.pass = pass;
- nodeCommand.stencilCommand2D.pass = pass;
- nodeCommand.colorCommand2D.pass = pass;
-
- if (allowPicking) {
- nodeCommand.pickCommand2D.pass = pass;
- }
- }
- }
- }
-
var scratchBoundingSphere = new BoundingSphere();
function scaleInPixels(positionWC, radius, frameState) {
@@ -3043,51 +2197,6 @@ define([
///////////////////////////////////////////////////////////////////////////
- function CachedRendererResources(context, cacheKey) {
- this.buffers = undefined;
- this.vertexArrays = undefined;
- this.programs = undefined;
- this.pickPrograms = undefined;
- this.classificationPrograms = undefined;
- this.renderStates = undefined;
- this.ready = false;
-
- this.context = context;
- this.cacheKey = cacheKey;
- this.count = 0;
- }
-
- function destroy(property) {
- for (var name in property) {
- if (property.hasOwnProperty(name)) {
- property[name].destroy();
- }
- }
- }
-
- function destroyCachedRendererResources(resources) {
- destroy(resources.buffers);
- destroy(resources.vertexArrays);
- destroy(resources.programs);
- destroy(resources.pickPrograms);
- destroy(resources.classificationPrograms);
- }
-
- CachedRendererResources.prototype.release = function() {
- if (--this.count === 0) {
- if (defined(this.cacheKey)) {
- // Remove if this was cached
- delete this.context.cache.modelRendererResourceCache[this.cacheKey];
- }
- destroyCachedRendererResources(this);
- return destroyObject(this);
- }
-
- return undefined;
- };
-
- ///////////////////////////////////////////////////////////////////////////
-
function getUpdateHeightCallback(model, ellipsoid, cartoPosition) {
return function(clampedPosition) {
if (model.heightReference === HeightReference.RELATIVE_TO_GROUND) {
@@ -3186,7 +2295,7 @@ define([
return (distance2 >= nearSquared) && (distance2 <= farSquared);
}
- Model.prototype.updateCommands = function(batchId, color) {
+ ClassificationModel.prototype.updateCommands = function(batchId, color) {
var nodeCommands = this._nodeCommands;
var length = nodeCommands.length;
for (var i = 0; i < length; ++i) {
@@ -3194,23 +2303,11 @@ define([
}
};
- /**
- * Called when {@link Viewer} or {@link CesiumWidget} render the scene to
- * get the draw commands needed to render this primitive.
- *
- * Do not call this function directly. This is documented just to
- * list the exceptions that may be propagated when the scene is rendered:
- *
- *
- * @exception {RuntimeError} Failed to load external reference.
- */
- Model.prototype.update = function(frameState) {
+ ClassificationModel.prototype.update = function(frameState) {
if (frameState.mode === SceneMode.MORPHING) {
return;
}
- //var context = frameState.context;
-
if ((this._state === ModelState.NEEDS_LOAD) && defined(this.gltf)) {
this._state = ModelState.LOADING;
if (this._state !== ModelState.FAILED) {
@@ -3233,10 +2330,7 @@ define([
}
this._loadResources = new LoadResources();
- if (!this._loadRendererResourcesFromCache) {
- // Buffers are required to updateVersion
- parseBuffers(this);
- }
+ parseBuffers(this);
}
}
@@ -3297,7 +2391,7 @@ define([
var modeChanged = frameState.mode !== this._mode;
this._mode = frameState.mode;
- // Model's model matrix needs to be updated
+ // ClassificationModel's model matrix needs to be updated
var modelTransformChanged = !Matrix4.equals(this._modelMatrix, modelMatrix) ||
(this._scale !== this.scale) ||
(this._minimumPixelSize !== this.minimumPixelSize) || (this.minimumPixelSize !== 0.0) || // Minimum pixel size changed or is enabled
@@ -3335,17 +2429,6 @@ define([
updateNodeHierarchyModelMatrix(this, modelTransformChanged, justLoaded, frameState.mapProjection);
this._dirty = true;
}
-
- /*
- if (this._perNodeShowDirty) {
- this._perNodeShowDirty = false;
- updatePerNodeShow(this);
- }
- updatePickIds(this, context);
- updateWireframe(this);
- updateShowBoundingVolume(this);
- updateClassification(this, frameState);
- */
}
if (justLoaded) {
@@ -3358,103 +2441,20 @@ define([
return;
}
- // We don't check show at the top of the function since we
- // want to be able to progressively load models when they are not shown,
- // and then have them visible immediately when show is set to true.
if (show && !this._ignoreCommands) {
- // PERFORMANCE_IDEA: This is terrible
- //var commandList = frameState.commandList;
- //var passes = frameState.passes;
var nodeCommands = this._nodeCommands;
var length = nodeCommands.length;
- var i;
- var nc;
-
- /*
- var idl2D = frameState.mapProjection.ellipsoid.maximumRadius * CesiumMath.PI;
- var boundingVolume;
-
- if (passes.render) {
- for (i = 0; i < length; ++i) {
- nc = nodeCommands[i];
- if (nc.show) {
- boundingVolume = nc.boundingVolume;
- if (frameState.mode === SceneMode.SCENE2D &&
- (boundingVolume.center.y + boundingVolume.radius > idl2D || boundingVolume.center.y - boundingVolume.radius < idl2D)) {
- commandList.push(nc.preloadCommand2D);
- commandList.push(nc.stencilCommand2D);
- commandList.push(nc.colorCommand2D);
- } else {
- commandList.push(nc.preloadCommand);
- commandList.push(nc.stencilCommand);
- commandList.push(nc.colorCommand);
- }
- }
- }
- }
-
- if (passes.pick && this.allowPicking) {
- for (i = 0; i < length; ++i) {
- nc = nodeCommands[i];
- if (nc.show) {
- boundingVolume = nc.boundingVolume;
- if (frameState.mode === SceneMode.SCENE2D &&
- (boundingVolume.center.y + boundingVolume.radius > idl2D || boundingVolume.center.y - boundingVolume.radius < idl2D)) {
- commandList.push(nc.preloadCommand2D);
- commandList.push(nc.stencilCommand2D);
- commandList.push(nc.pickCommand2D);
- } else {
- commandList.push(nc.preloadCommand);
- commandList.push(nc.stencilCommand);
- commandList.push(nc.pickCommand);
- }
- }
- }
- }
- */
-
- for (i = 0; i < length; ++i) {
- nc = nodeCommands[i];
- //if (nc.show) {
- nc.update(frameState);
- //}
+ for (var i = 0; i < length; ++i) {
+ nodeCommands[i].update(frameState);
}
}
};
- /**
- * Returns true if this object was destroyed; otherwise, false.
- *
- * If this object was destroyed, it should not be used; calling any function other than
- * isDestroyed
will result in a {@link DeveloperError} exception.
- *
- * @returns {Boolean} true
if this object was destroyed; otherwise, false
.
- *
- * @see Model#destroy
- */
- Model.prototype.isDestroyed = function() {
+ ClassificationModel.prototype.isDestroyed = function() {
return false;
};
- /**
- * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
- * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
- *
- * Once an object is destroyed, it should not be used; calling any function other than
- * isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
- * assign the return value (undefined
) to the object as done in the example.
- *
- * @returns {undefined}
- *
- * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
- *
- *
- * @example
- * model = model && model.destroy();
- *
- * @see Model#isDestroyed
- */
- Model.prototype.destroy = function() {
+ ClassificationModel.prototype.destroy = function() {
if (defined(this._removeUpdateHeightCallback)) {
this._removeUpdateHeightCallback();
this._removeUpdateHeightCallback = undefined;
@@ -3466,7 +2466,6 @@ define([
}
this._rendererResources = undefined;
- this._cachedRendererResources = this._cachedRendererResources && this._cachedRendererResources.release();
var pickIds = this._pickIds;
var length = pickIds.length;
@@ -3479,5 +2478,5 @@ define([
return destroyObject(this);
};
- return Model;
+ return ClassificationModel;
});
diff --git a/Source/Scene/Vector3DTilePrimitive.js b/Source/Scene/Vector3DTilePrimitive.js
index fa538e4f46ab..02dc2eb44caf 100644
--- a/Source/Scene/Vector3DTilePrimitive.js
+++ b/Source/Scene/Vector3DTilePrimitive.js
@@ -153,7 +153,7 @@ define([
* @type {ClassificationType}
* @default ClassificationType.CESIUM_3D_TILE
*/
- this.classificationType = ClassificationType.CESIUM_3D_TILE;
+ this.classificationType = defaultValue(options.classificationType, ClassificationType.CESIUM_3D_TILE);
// Hidden options
this._vertexShaderSource = options._vertexShaderSource;
@@ -795,7 +795,7 @@ define([
for (var j = 0; j < length; ++j) {
var offset = primitive._indexOffsets[j];
var count = primitive._indexCounts[j];
- var bv = primitive._boundingVolumes[j];
+ var bv = defined(primitive._boundingVolumes) ? primitive._boundingVolumes[j] : primitive.boundingVolume;
var stencilPreloadCommand = pickCommands[j * 3];
if (!defined(stencilPreloadCommand)) {
From 9173555d1127cf7acf6232115b937a4aa96b05f1 Mon Sep 17 00:00:00 2001
From: Dan Bagnell
Date: Tue, 5 Dec 2017 19:46:52 -0500
Subject: [PATCH 15/51] Fix test.
---
Specs/Scene/Vector3DTileContentSpec.js | 42 +++++++++++++++++---------
1 file changed, 27 insertions(+), 15 deletions(-)
diff --git a/Specs/Scene/Vector3DTileContentSpec.js b/Specs/Scene/Vector3DTileContentSpec.js
index a84641d2f3c8..6c72b4832574 100644
--- a/Specs/Scene/Vector3DTileContentSpec.js
+++ b/Specs/Scene/Vector3DTileContentSpec.js
@@ -1038,26 +1038,38 @@ defineSuite([
it('renders with different classification types', function() {
scene.primitives.add(depthPrimitive);
tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorPolygonsBatchedChildren
+ url : vectorPolygonsBatchedChildren,
+ classificationType : ClassificationType.CESIUM_3D_TILE
}));
return loadTileset(tileset).then(function(tileset) {
- tileset.classificationType = ClassificationType.CESIUM_3D_TILE;
- verifyRender(tileset, scene);
- verifyPick(scene);
-
- tileset.classificationType = ClassificationType.TERRAIN;
- expect(scene).toRender([255, 0, 0, 255]);
-
- depthPrimitive.pass = Pass.GLOBE;
verifyRender(tileset, scene);
verifyPick(scene);
- tileset.classificationType = ClassificationType.BOTH;
- verifyRender(tileset, scene);
- verifyPick(scene);
- depthPrimitive.pass = Pass.CESIUM_3D_TILE;
- verifyRender(tileset, scene);
- verifyPick(scene);
+ scene.primitives.remove(tileset);
+
+ tileset = scene.primitives.add(new Cesium3DTileset({
+ url : vectorPolygonsBatchedChildren,
+ classificationType : ClassificationType.TERRAIN
+ }));
+ return loadTileset(tileset).then(function(tileset) {
+ depthPrimitive.pass = Pass.GLOBE;
+ verifyRender(tileset, scene);
+ verifyPick(scene);
+
+ scene.primitives.remove(tileset);
+
+ tileset = scene.primitives.add(new Cesium3DTileset({
+ url : vectorPolygonsBatchedChildren,
+ classificationType : ClassificationType.BOTH
+ }));
+ return loadTileset(tileset).then(function(tileset) {
+ verifyRender(tileset, scene);
+ verifyPick(scene);
+ depthPrimitive.pass = Pass.CESIUM_3D_TILE;
+ verifyRender(tileset, scene);
+ verifyPick(scene);
+ });
+ });
});
});
});
From c1ad37517c8634f2ba19658a4df3f9ff065a984c Mon Sep 17 00:00:00 2001
From: Dan Bagnell
Date: Tue, 5 Dec 2017 19:49:17 -0500
Subject: [PATCH 16/51] Revert Sandcastle example.
---
.../gallery/3D Tiles Adjust Height.html | 17 -----------------
1 file changed, 17 deletions(-)
diff --git a/Apps/Sandcastle/gallery/3D Tiles Adjust Height.html b/Apps/Sandcastle/gallery/3D Tiles Adjust Height.html
index 4e7402e2a991..09813d39da55 100644
--- a/Apps/Sandcastle/gallery/3D Tiles Adjust Height.html
+++ b/Apps/Sandcastle/gallery/3D Tiles Adjust Height.html
@@ -68,21 +68,6 @@
throw(error);
});
-var classification = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
- url : '../../../Specs/Data/Cesium3DTiles/Tilesets/Tileset',
- classificationType : Cesium.ClassificationType.CESIUM_3D_TILE,
- modelMatrix : Cesium.Matrix4.fromUniformScale(1.2),
- skipLevelOfDetail : false
-}));
-
-classification.readyPromise.then(function() {
- classification.style = new Cesium.Cesium3DTileStyle({
- color : 'rgba(255, 255, 0, 0.5)'
- });
-}).otherwise(function(error) {
- throw(error);
-});
-
Cesium.knockout.getObservable(viewModel, 'height').subscribe(function(height) {
height = Number(height);
if (isNaN(height)) {
@@ -94,8 +79,6 @@
var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, height);
var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3());
tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
-
- classification.modelMatrix = Cesium.Matrix4.multiply(Cesium.Matrix4.fromTranslation(translation), Cesium.Matrix4.fromUniformScale(1.1), new Cesium.Matrix4());
});
//Sandcastle_End
Sandcastle.finishedLoading();
From b4481160519387113b3b4537122d41091de3e5ac Mon Sep 17 00:00:00 2001
From: Dan Bagnell
Date: Wed, 6 Dec 2017 14:09:23 -0500
Subject: [PATCH 17/51] Remove mesh support from vector tiles.
---
Source/Scene/Vector3DTileContent.js | 78 +---
Source/Scene/Vector3DTileMeshes.js | 440 ---------------------
Source/Workers/createVectorTileMeshes.js | 168 --------
Specs/Scene/Vector3DTileMeshesSpec.js | 465 -----------------------
4 files changed, 4 insertions(+), 1147 deletions(-)
delete mode 100644 Source/Scene/Vector3DTileMeshes.js
delete mode 100644 Source/Workers/createVectorTileMeshes.js
delete mode 100644 Specs/Scene/Vector3DTileMeshesSpec.js
diff --git a/Source/Scene/Vector3DTileContent.js b/Source/Scene/Vector3DTileContent.js
index 2dab9e08ff46..8d4e4917f462 100644
--- a/Source/Scene/Vector3DTileContent.js
+++ b/Source/Scene/Vector3DTileContent.js
@@ -16,7 +16,6 @@ define([
'../ThirdParty/when',
'./Cesium3DTileBatchTable',
'./Vector3DTileGeometry',
- './Vector3DTileMeshes',
'./Vector3DTilePoints',
'./Vector3DTilePolygons',
'./Vector3DTilePolylines'
@@ -38,7 +37,6 @@ define([
when,
Cesium3DTileBatchTable,
Vector3DTileGeometry,
- Vector3DTileMeshes,
Vector3DTilePoints,
Vector3DTilePolygons,
Vector3DTilePolylines) {
@@ -71,7 +69,6 @@ define([
this._polygons = undefined;
this._polylines = undefined;
this._points = undefined;
- this._meshes = undefined;
this._geometries = undefined;
this._contentReadyPromise = undefined;
@@ -125,9 +122,6 @@ define([
if (defined(this._geometries)) {
trianglesLength += this._geometries.trianglesLength;
}
- if (defined(this._meshes)) {
- trianglesLength += this._meshes.trianglesLength;
- }
return trianglesLength;
}
},
@@ -147,9 +141,6 @@ define([
if (defined(this._geometries)) {
geometryByteLength += this._geometries.geometryByteLength;
}
- if (defined(this._meshes)) {
- geometryByteLength += this._meshes.geometryByteLength;
- }
return geometryByteLength;
}
},
@@ -235,9 +226,6 @@ define([
if (defined(content._polygons)) {
content._polygons.updateCommands(batchId, color);
}
- if (defined(content._meshes)) {
- content._meshes.updateCommands(batchId, color);
- }
if (defined(content._geometries)) {
content._geometries.updateCommands(batchId, color);
}
@@ -248,7 +236,6 @@ define([
var polygonBatchIds;
var polylineBatchIds;
var pointBatchIds;
- var meshBatchIds;
var boxBatchIds;
var cylinderBatchIds;
var ellipsoidBatchIds;
@@ -258,7 +245,6 @@ define([
var numberOfPolygons = defaultValue(featureTableJson.POLYGONS_LENGTH, 0);
var numberOfPolylines = defaultValue(featureTableJson.POLYLINES_LENGTH, 0);
var numberOfPoints = defaultValue(featureTableJson.POINTS_LENGTH, 0);
- var numberOfMeshes = defaultValue(featureTableJson.MESHES_LENGTH, 0);
var numberOfBoxes = defaultValue(featureTableJson.BOXES_LENGTH, 0);
var numberOfCylinders = defaultValue(featureTableJson.CYLINDERS_LENGTH, 0);
var numberOfEllipsoids = defaultValue(featureTableJson.ELLIPSOIDS_LENGTH, 0);
@@ -279,11 +265,6 @@ define([
pointBatchIds = new Uint16Array(featureTableBinary.buffer, pointBatchIdsByteOffset, numberOfPoints);
}
- if (numberOfMeshes > 0 && defined(featureTableJson.MESH_BATCH_IDS)) {
- var meshBatchIdsByteOffset = featureTableBinary.byteOffset + featureTableJson.MESH_BATCH_IDS.byteOffset;
- meshBatchIds = new Uint16Array(featureTableBinary.buffer, meshBatchIdsByteOffset, numberOfMeshes);
- }
-
if (numberOfBoxes > 0 && defined(featureTableJson.BOX_BATCH_IDS)) {
var boxBatchIdsByteOffset = featureTableBinary.byteOffset + featureTableJson.BOX_BATCH_IDS.byteOffset;
boxBatchIds = new Uint16Array(featureTableBinary.buffer, boxBatchIdsByteOffset, numberOfBoxes);
@@ -304,13 +285,12 @@ define([
sphereBatchIds = new Uint16Array(featureTableBinary.buffer, sphereBatchIdsByteOffset, numberOfSpheres);
}
- var atLeastOneDefined = defined(polygonBatchIds) || defined(polylineBatchIds) || defined(pointBatchIds) || defined(meshBatchIds);
+ var atLeastOneDefined = defined(polygonBatchIds) || defined(polylineBatchIds) || defined(pointBatchIds);
atLeastOneDefined = atLeastOneDefined || defined(boxBatchIds) || defined(cylinderBatchIds) || defined(ellipsoidBatchIds) || defined(sphereBatchIds);
var atLeastOneUndefined = (numberOfPolygons > 0 && !defined(polygonBatchIds)) ||
(numberOfPolylines > 0 && !defined(polylineBatchIds)) ||
(numberOfPoints > 0 && !defined(pointBatchIds)) ||
- (numberOfMeshes > 0 && !defined(meshBatchIds)) ||
(numberOfBoxes > 0 && !defined(boxBatchIds)) ||
(numberOfCylinders > 0 && !defined(cylinderBatchIds)) ||
(numberOfEllipsoids > 0 && !defined(ellipsoidBatchIds)) ||
@@ -320,7 +300,7 @@ define([
throw new RuntimeError('If one group of batch ids is defined, then all batch ids must be defined.');
}
- var allUndefinedBatchIds = !defined(polygonBatchIds) && !defined(polylineBatchIds) && !defined(pointBatchIds) && !defined(meshBatchIds);
+ var allUndefinedBatchIds = !defined(polygonBatchIds) && !defined(polylineBatchIds) && !defined(pointBatchIds);
allUndefinedBatchIds = allUndefinedBatchIds && !defined(boxBatchIds) && !defined(cylinderBatchIds) && !defined(ellipsoidBatchIds) && !defined(sphereBatchIds);
if (allUndefinedBatchIds) {
@@ -343,12 +323,6 @@ define([
pointBatchIds[i] = id++;
}
}
- if (!defined(meshBatchIds) && numberOfMeshes > 0) {
- meshBatchIds = new Uint16Array(numberOfMeshes);
- for (i = 0; i < numberOfMeshes; ++i) {
- meshBatchIds[i] = id++;
- }
- }
if (!defined(boxBatchIds) && numberOfBoxes > 0) {
boxBatchIds = new Uint16Array(numberOfBoxes);
for (i = 0; i < numberOfBoxes; ++i) {
@@ -379,7 +353,6 @@ define([
polygons : polygonBatchIds,
polylines : polylineBatchIds,
points : pointBatchIds,
- meshes : meshBatchIds,
boxes : boxBatchIds,
cylinders : cylinderBatchIds,
ellipsoids : ellipsoidBatchIds,
@@ -464,14 +437,13 @@ define([
var numberOfPolygons = defaultValue(featureTableJson.POLYGONS_LENGTH, 0);
var numberOfPolylines = defaultValue(featureTableJson.POLYLINES_LENGTH, 0);
var numberOfPoints = defaultValue(featureTableJson.POINTS_LENGTH, 0);
- var numberOfMeshes = defaultValue(featureTableJson.MESHES_LENGTH, 0);
var numberOfBoxes = defaultValue(featureTableJson.BOXES_LENGTH, 0);
var numberOfCylinders = defaultValue(featureTableJson.CYLINDERS_LENGTH, 0);
var numberOfEllipsoids = defaultValue(featureTableJson.ELLIPSOIDS_LENGTH, 0);
var numberOfSpheres = defaultValue(featureTableJson.SPHERES_LENGTH, 0);
var totalPrimitives = numberOfPolygons + numberOfPolylines + numberOfPoints;
- totalPrimitives += numberOfMeshes + numberOfBoxes + numberOfCylinders + numberOfEllipsoids + numberOfSpheres;
+ totalPrimitives += numberOfBoxes + numberOfCylinders + numberOfEllipsoids + numberOfSpheres;
var batchTable = new Cesium3DTileBatchTable(content, totalPrimitives, batchTableJson, batchTableBinary, createColorChangedCallback(content));
content._batchTable = batchTable;
@@ -580,8 +552,6 @@ define([
if (numberOfPoints > 0) {
var pointPositions = new Uint16Array(arrayBuffer, byteOffset, pointsPositionByteLength / sizeOfUint16);
- byteOffset += pointsPositionByteLength;
-
content._points = new Vector3DTilePoints({
positions : pointPositions,
batchIds : batchIds.points,
@@ -592,30 +562,6 @@ define([
});
}
- if (numberOfMeshes > 0) {
- var meshIndexOffsetsByteOffset = featureTableBinary.byteOffset + featureTableJson.MESH_INDEX_OFFSETS.byteOffset;
- var meshIndexOffsets = new Uint32Array(featureTableBinary.buffer, meshIndexOffsetsByteOffset, numberOfMeshes);
-
- var meshIndexCountsByteOffset = featureTableBinary.byteOffset + featureTableJson.MESH_INDEX_COUNTS.byteOffset;
- var meshIndexCounts = new Uint32Array(featureTableBinary.buffer, meshIndexCountsByteOffset, numberOfMeshes);
-
- var meshPositionCount = featureTableJson.MESH_POSITION_COUNT;
-
- content._meshes = new Vector3DTileMeshes({
- buffer : arrayBuffer,
- byteOffset : byteOffset,
- positionCount : meshPositionCount,
- indexOffsets : meshIndexOffsets,
- indexCounts : meshIndexCounts,
- indexBytesPerElement : Uint32Array.BYTES_PER_ELEMENT,
- batchIds : batchIds.meshes,
- center : center,
- modelMatrix : modelMatrix,
- batchTable : batchTable,
- boundingVolume : content._tile._boundingVolume.boundingVolume
- });
- }
-
if (numberOfBoxes > 0 || numberOfCylinders > 0 || numberOfEllipsoids > 0 || numberOfSpheres > 0) {
var boxes;
var cylinders;
@@ -673,9 +619,6 @@ define([
if (defined(content._points)) {
content._points.createFeatures(content, features);
}
- if (defined(content._meshes)) {
- content._meshes.createFeatures(content, features);
- }
if (defined(content._geometries)) {
content._geometries.createFeatures(content, features);
}
@@ -718,9 +661,6 @@ define([
if (defined(this._points)) {
this._points.applyDebugSettings(enabled, color);
}
- if (defined(this._meshes)) {
- this._meshes.applyDebugSettings(enabled, color);
- }
if (defined(this._geometries)) {
this._geometries.applyDebugSettings(enabled, color);
}
@@ -740,9 +680,6 @@ define([
if (defined(this._points)) {
this._points.applyStyle(frameState, style, this._features);
}
- if (defined(this._meshes)) {
- this._meshes.applyStyle(frameState, style, this._features);
- }
if (defined(this._geometries)) {
this._geometries.applyStyle(frameState, style, this._features);
}
@@ -765,11 +702,6 @@ define([
if (defined(this._points)) {
this._points.update(frameState);
}
- if (defined(this._meshes)) {
- this._meshes.classificationType = this._tileset.classificationType;
- this._meshes.debugWireframe = this._tileset.debugWireframe;
- this._meshes.update(frameState);
- }
if (defined(this._geometries)) {
this._geometries.classificationType = this._tileset.classificationType;
this._geometries.debugWireframe = this._tileset.debugWireframe;
@@ -780,11 +712,10 @@ define([
var pointsPromise = defined(this._points) ? this._points.readyPromise : undefined;
var polygonPromise = defined(this._polygons) ? this._polygons.readyPromise : undefined;
var polylinePromise = defined(this._polylines) ? this._polylines.readyPromise : undefined;
- var meshPromise = defined(this._meshes) ? this._meshes.readyPromise : undefined;
var geometryPromise = defined(this._geometries) ? this._geometries.readyPromise : undefined;
var that = this;
- this._contentReadyPromise = when.all([pointsPromise, polygonPromise, polylinePromise, meshPromise, geometryPromise]).then(function() {
+ this._contentReadyPromise = when.all([pointsPromise, polygonPromise, polylinePromise, geometryPromise]).then(function() {
that._readyPromise.resolve(that);
});
}
@@ -804,7 +735,6 @@ define([
this._polygons = this._polygons && this._polygons.destroy();
this._polylines = this._polylines && this._polylines.destroy();
this._points = this._points && this._points.destroy();
- this._meshes = this._meshes && this._meshes.destroy();
this._geometries = this._geometries && this._geometries.destroy();
this._batchTable = this._batchTable && this._batchTable.destroy();
return destroyObject(this);
diff --git a/Source/Scene/Vector3DTileMeshes.js b/Source/Scene/Vector3DTileMeshes.js
deleted file mode 100644
index 0392da8fddce..000000000000
--- a/Source/Scene/Vector3DTileMeshes.js
+++ /dev/null
@@ -1,440 +0,0 @@
-define([
- '../Core/BoundingSphere',
- '../Core/Cartesian3',
- '../Core/Color',
- '../Core/defaultValue',
- '../Core/defined',
- '../Core/defineProperties',
- '../Core/destroyObject',
- '../Core/Math',
- '../Core/Matrix4',
- '../Core/TaskProcessor',
- '../ThirdParty/when',
- './ClassificationType',
- './Vector3DTileBatch',
- './Vector3DTilePrimitive'
- ], function(
- BoundingSphere,
- Cartesian3,
- Color,
- defaultValue,
- defined,
- defineProperties,
- destroyObject,
- CesiumMath,
- Matrix4,
- TaskProcessor,
- when,
- ClassificationType,
- Vector3DTileBatch,
- Vector3DTilePrimitive) {
- 'use strict';
-
- /**
- * Creates a batch of meshes intersecting 3D Tiles and/or terrain.
- *
- * @alias Vector3DTileMeshes
- * @constructor
- *
- * @param {Object} options An object with following properties:
- * @param {ArrayBuffer} options.buffer A buffer containing the indices and positions of the mesh.
- * @param {Number} options.byteOffset The offset into buffer to extract the indices and positions.
- * @param {Number} options.positionCount The number of positions of all meshes for extraction from buffer.
- * @param {Uint32Array} options.indexOffsets The offsets into the indices buffer for each mesh.
- * @param {Uint32Array} options.indexCounts The number of indices for each mesh.
- * @param {IndexDatatype} options.indexBytesPerElement The number of bytes per index.
- * @param {Uint16Array} options.batchIds The batch id for each mesh.
- * @param {Cartesian3} options.center The RTC center of all meshes.
- * @param {Matrix4} options.modelMatrix The modelMatrix of all meshes.
- * @param {Cesium3DTileBatchTable} options.batchTable The batch table.
- * @param {BoundingSphere} options.boundingVolume The bounding volume for the entire batch of meshes.
- * @param {Object} options.pickObject The object to place as the owner of the draw commands.
- *
- * @private
- */
- function Vector3DTileMeshes(options) {
- // these will all be released after the primitive is created
- this._buffer = options.buffer;
- this._byteOffset = options.byteOffset;
- this._positionCount = options.positionCount;
- this._indexOffsets = options.indexOffsets;
- this._indexCounts = options.indexCounts;
- this._indexBytesPerElement = options.indexBytesPerElement;
- this._batchIds = options.batchIds;
- this._center = options.center;
- this._modelMatrix = options.modelMatrix;
- this._batchTable = options.batchTable;
- this._boundingVolume = options.boundingVolume;
- this._pickObject = options.pickObject;
-
- this._positions = undefined;
- this._vertexBatchIds = undefined;
- this._indices = undefined;
- this._batchedIndices = undefined;
- this._transferrableBatchIds = undefined;
- this._batchTableColors = undefined;
- this._packedBuffer = undefined;
- this._boundingVolumes = undefined;
-
- this._ready = false;
- this._readyPromise = when.defer();
-
- this._verticesPromise = undefined;
-
- this._primitive = undefined;
-
- /**
- * Draws the wireframe of the classification meshes.
- * @type {Boolean}
- * @default false
- */
- this.debugWireframe = false;
-
- /**
- * Forces a re-batch instead of waiting after a number of frames have been rendered. For testing only.
- * @type {Boolean}
- * @default false
- */
- this.forceRebatch = false;
-
- /**
- * What this tile will classify.
- * @type {ClassificationType}
- * @default ClassificationType.CESIUM_3D_TILE
- */
- this.classificationType = ClassificationType.CESIUM_3D_TILE;
- }
-
- defineProperties(Vector3DTileMeshes.prototype, {
- /**
- * Gets the number of triangles.
- *
- * @memberof Vector3DTileMeshes.prototype
- *
- * @type {Number}
- * @readonly
- */
- trianglesLength : {
- get : function() {
- if (defined(this._primitive)) {
- return this._primitive.trianglesLength;
- }
- return 0;
- }
- },
-
- /**
- * Gets the geometry memory in bytes.
- *
- * @memberof Vector3DTileMeshes.prototype
- *
- * @type {Number}
- * @readonly
- */
- geometryByteLength : {
- get : function() {
- if (defined(this._primitive)) {
- return this._primitive.geometryByteLength;
- }
- return 0;
- }
- },
-
- /**
- * Gets a promise that resolves when the primitive is ready to render.
- * @memberof Vector3DTileMeshes.prototype
- * @type {Promise}
- * @readonly
- */
- readyPromise : {
- get : function() {
- return this._readyPromise.promise;
- }
- }
- });
-
- function packBuffer(meshes) {
- var offset = 0;
- var packedBuffer = new Float64Array(1 + Cartesian3.packedLength + Matrix4.packedLength);
-
- packedBuffer[offset++] = meshes._indexBytesPerElement;
-
- Cartesian3.pack(meshes._center, packedBuffer, offset);
- offset += Cartesian3.packedLength;
-
- Matrix4.pack(meshes._modelMatrix, packedBuffer, offset);
-
- return packedBuffer;
- }
-
- function unpackBuffer(meshes, packedBuffer) {
- var offset = 0;
-
- var numBVS = packedBuffer[offset++];
- var bvs = meshes._boundingVolumes = new Array(numBVS);
-
- for (var i = 0; i < numBVS; ++i) {
- bvs[i] = BoundingSphere.unpack(packedBuffer, offset);
- offset += BoundingSphere.packedLength;
- }
-
- var numBatchedIndices = packedBuffer[offset++];
- var bis = meshes._batchedIndices = new Array(numBatchedIndices);
-
- for (var j = 0; j < numBatchedIndices; ++j) {
- var color = Color.unpack(packedBuffer, offset);
- offset += Color.packedLength;
-
- var indexOffset = packedBuffer[offset++];
- var count = packedBuffer[offset++];
-
- var length = packedBuffer[offset++];
- var batchIds = new Array(length);
-
- for (var k = 0; k < length; ++k) {
- batchIds[k] = packedBuffer[offset++];
- }
-
- bis[j] = new Vector3DTileBatch({
- color : color,
- offset : indexOffset,
- count : count,
- batchIds : batchIds
- });
- }
- }
-
- var createVerticesTaskProcessor = new TaskProcessor('createVectorTileMeshes');
- var scratchColor = new Color();
-
- function createPrimitive(meshes) {
- if (defined(meshes._primitive)) {
- return;
- }
-
- if (!defined(meshes._verticesPromise)) {
- var positions = meshes._positions;
- var indexOffsets = meshes._indexOffsets;
- var indexCounts = meshes._indexCounts;
- var indices = meshes._indices;
-
- var batchIds = meshes._transferrableBatchIds;
- var batchTableColors = meshes._batchTableColors;
-
- var packedBuffer = meshes._packedBuffer;
-
- if (!defined(batchTableColors)) {
- // Copy because they may be the views on the same buffer.
- var buffer = meshes._buffer;
- var byteOffset = meshes._byteOffset;
-
- indexOffsets = meshes._indexOffsets = meshes._indexOffsets.slice();
- indexCounts = meshes._indexCounts = meshes._indexCounts.slice();
-
- var positionCount = meshes._positionCount;
- var batchTable = meshes._batchTable;
-
- var i;
- var indicesLength = 0;
- var numMeshes = indexCounts.length;
- for (i = 0; i < numMeshes; ++i) {
- indicesLength += indexCounts[i];
- }
-
- var start = byteOffset;
- var end = start + indicesLength * meshes._indexBytesPerElement;
- var bufferCopy = buffer.slice(start, end);
- if (meshes._indexBytesPerElement === Uint16Array.BYTES_PER_ELEMENT) {
- indices = meshes._indices = new Uint16Array(bufferCopy);
- } else {
- indices = meshes._indices = new Uint32Array(bufferCopy);
- }
-
- start = end;
- end = start + 3 * positionCount * Float32Array.BYTES_PER_ELEMENT;
- positions = meshes._positions = new Float32Array(buffer.slice(start, end));
-
- batchIds = meshes._transferrableBatchIds = new Uint32Array(meshes._batchIds);
- batchTableColors = meshes._batchTableColors = new Uint32Array(batchIds.length);
-
- var length = batchTableColors.length;
- for (i = 0; i < length; ++i) {
- var color = batchTable.getColor(i, scratchColor);
- batchTableColors[i] = color.toRgba();
- }
-
- packedBuffer = meshes._packedBuffer = packBuffer(meshes);
- }
-
- var transferrableObjects = [positions.buffer, indexOffsets.buffer, indexCounts.buffer, indices.buffer, batchIds.buffer, batchTableColors.buffer, packedBuffer.buffer];
- var parameters = {
- packedBuffer : packedBuffer.buffer,
- positions : positions.buffer,
- indexOffsets : indexOffsets.buffer,
- indexCounts : indexCounts.buffer,
- indices : indices.buffer,
- batchIds : batchIds.buffer,
- batchTableColors : batchTableColors.buffer
- };
-
- var verticesPromise = meshes._verticesPromise = createVerticesTaskProcessor.scheduleTask(parameters, transferrableObjects);
- if (!defined(verticesPromise)) {
- // Postponed
- return;
- }
-
- when(verticesPromise, function(result) {
- var packedBuffer = new Float64Array(result.packedBuffer);
- unpackBuffer(meshes, packedBuffer);
-
- if (meshes._indexBytesPerElement === 2) {
- meshes._indices = new Uint16Array(result.indices);
- } else {
- meshes._indices = new Uint32Array(result.indices);
- }
-
- meshes._indexOffsets = new Uint32Array(result.indexOffsets);
- meshes._indexCounts = new Uint32Array(result.indexCounts);
-
- // will be released
- meshes._positions = new Float32Array(result.positions);
- meshes._vertexBatchIds = new Uint16Array(result.batchIds);
-
- meshes._ready = true;
- });
- }
-
- if (meshes._ready && !defined(meshes._primitive)) {
- meshes._primitive = new Vector3DTilePrimitive({
- batchTable : meshes._batchTable,
- positions : meshes._positions,
- batchIds : meshes._batchIds,
- vertexBatchIds : meshes._vertexBatchIds,
- indices : meshes._indices,
- indexOffsets : meshes._indexOffsets,
- indexCounts : meshes._indexCounts,
- batchedIndices : meshes._batchedIndices,
- boundingVolume : meshes._boundingVolume,
- boundingVolumes : meshes._boundingVolumes,
- center : meshes._center,
- pickObject : defaultValue(meshes._pickObject, meshes)
- });
-
- meshes._buffer = undefined;
- meshes._byteOffset = undefined;
- meshes._positionCount = undefined;
- meshes._indexOffsets = undefined;
- meshes._indexCounts = undefined;
- meshes._batchIds = undefined;
- meshes._center = undefined;
- meshes._modelMatrix = undefined;
- meshes._batchTable = undefined;
- meshes._boundingVolume = undefined;
- meshes._pickObject = undefined;
-
- meshes._positions = undefined;
- meshes._vertexBatchIds = undefined;
- meshes._indices = undefined;
- meshes._batchedIndices = undefined;
- meshes._transferrableBatchIds = undefined;
- meshes._batchTableColors = undefined;
- meshes._packedBuffer = undefined;
- meshes._boundingVolumes = undefined;
-
- meshes._readyPromise.resolve();
- }
- }
-
- /**
- * Creates features for each mesh and places it at the batch id index of features.
- *
- * @param {Vector3DTileContent} content The vector tile content.
- * @param {Cesium3DTileFeature[]} features An array of features where the polygon features will be placed.
- */
- Vector3DTileMeshes.prototype.createFeatures = function(content, features) {
- this._primitive.createFeatures(content, features);
- };
-
- /**
- * Colors the entire tile when enabled is true. The resulting color will be (mesh batch table color * color).
- *
- * @param {Boolean} enabled Whether to enable debug coloring.
- * @param {Color} color The debug color.
- */
- Vector3DTileMeshes.prototype.applyDebugSettings = function(enabled, color) {
- this._primitive.applyDebugSettings(enabled, color);
- };
-
- /**
- * Apply a style to the content.
- *
- * @param {FrameState} frameState The frame state.
- * @param {Cesium3DTileStyle} style The style.
- * @param {Cesium3DTileFeature[]} features The array of features.
- */
- Vector3DTileMeshes.prototype.applyStyle = function(frameState, style, features) {
- this._primitive.applyStyle(frameState, style, features);
- };
-
- /**
- * Call when updating the color of a mesh with batchId changes color. The meshes will need to be re-batched
- * on the next update.
- *
- * @param {Number} batchId The batch id of the meshes whose color has changed.
- * @param {Color} color The new polygon color.
- */
- Vector3DTileMeshes.prototype.updateCommands = function(batchId, color) {
- this._primitive.updateCommands(batchId, color);
- };
-
- /**
- * Updates the batches and queues the commands for rendering.
- *
- * @param {FrameState} frameState The current frame state.
- */
- Vector3DTileMeshes.prototype.update = function(frameState) {
- createPrimitive(this);
-
- if (!this._ready) {
- return;
- }
-
- this._primitive.debugWireframe = this.debugWireframe;
- this._primitive.forceRebatch = this.forceRebatch;
- this._primitive.classificationType = this.classificationType;
- this._primitive.update(frameState);
- };
-
- /**
- * Returns true if this object was destroyed; otherwise, false.
- *
- * If this object was destroyed, it should not be used; calling any function other than
- * isDestroyed
will result in a {@link DeveloperError} exception.
- *
- *
- * @returns {Boolean} true
if this object was destroyed; otherwise, false
.
- */
- Vector3DTileMeshes.prototype.isDestroyed = function() {
- return false;
- };
-
- /**
- * Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
- * release of WebGL resources, instead of relying on the garbage collector to destroy this object.
- *
- * Once an object is destroyed, it should not be used; calling any function other than
- * isDestroyed
will result in a {@link DeveloperError} exception. Therefore,
- * assign the return value (undefined
) to the object as done in the example.
- *
- *
- * @returns {undefined}
- *
- * @exception {DeveloperError} This object was destroyed, i.e., destroy() was called.
- */
- Vector3DTileMeshes.prototype.destroy = function() {
- this._primitive = this._primitive && this._primitive.destroy();
- return destroyObject(this);
- };
-
- return Vector3DTileMeshes;
-});
diff --git a/Source/Workers/createVectorTileMeshes.js b/Source/Workers/createVectorTileMeshes.js
deleted file mode 100644
index 727ae9fdae82..000000000000
--- a/Source/Workers/createVectorTileMeshes.js
+++ /dev/null
@@ -1,168 +0,0 @@
-define([
- '../Core/BoundingSphere',
- '../Core/Cartesian3',
- '../Core/Color',
- '../Core/defined',
- '../Core/Matrix4',
- '../Scene/Vector3DTileBatch',
- './createTaskProcessorWorker'
- ], function(
- BoundingSphere,
- Cartesian3,
- Color,
- defined,
- Matrix4,
- Vector3DTileBatch,
- createTaskProcessorWorker) {
- 'use strict';
-
- var scratchCenter = new Cartesian3();
- var scratchMatrix4 = new Matrix4();
-
- function unpackBuffer(buffer) {
- var packedBuffer = new Float64Array(buffer);
-
- var offset = 0;
- var indexBytesPerElement = packedBuffer[offset++];
-
- Cartesian3.unpack(packedBuffer, offset, scratchCenter);
- offset += Cartesian3.packedLength;
-
- Matrix4.unpack(packedBuffer, offset, scratchMatrix4);
-
- return indexBytesPerElement;
- }
-
- function packedBatchedIndicesLength(batchedIndices) {
- var length = batchedIndices.length;
- var count = 0;
- for (var i = 0; i < length; ++i) {
- count += Color.packedLength + 3 + batchedIndices[i].batchIds.length;
- }
- return count;
- }
-
- function packBuffer(batchedIndices, boundingVolumes) {
- var numBVs = boundingVolumes.length;
- var length = 1 + numBVs * BoundingSphere.packedLength + 1 + packedBatchedIndicesLength(batchedIndices);
-
- var packedBuffer = new Float64Array(length);
-
- var offset = 0;
- packedBuffer[offset++] = numBVs;
-
- for (var i = 0; i < numBVs; ++i) {
- BoundingSphere.pack(boundingVolumes[i], packedBuffer, offset);
- offset += BoundingSphere.packedLength;
- }
-
- var indicesLength = batchedIndices.length;
- packedBuffer[offset++] = indicesLength;
-
- for (var j = 0; j < indicesLength; ++j) {
- var batchedIndex = batchedIndices[j];
-
- Color.pack(batchedIndex.color, packedBuffer, offset);
- offset += Color.packedLength;
-
- packedBuffer[offset++] = batchedIndex.offset;
- packedBuffer[offset++] = batchedIndex.count;
-
- var batchIds = batchedIndex.batchIds;
- var batchIdsLength = batchIds.length;
- packedBuffer[offset++] = batchIdsLength;
-
- for (var k = 0; k < batchIdsLength; ++k) {
- packedBuffer[offset++] = batchIds[k];
- }
- }
-
- return packedBuffer;
- }
-
- var scratchPosition = new Cartesian3();
- var scratchMesh = [];
-
- function createVectorTileMeshes(parameters, transferableObjects) {
- var indexBytesPerElement = unpackBuffer(parameters.packedBuffer);
- var indices;
- if (indexBytesPerElement === 2) {
- indices = new Uint16Array(parameters.indices);
- } else {
- indices = new Uint32Array(parameters.indices);
- }
-
- var positions = new Float32Array(parameters.positions);
- var indexOffsets = new Uint32Array(parameters.indexOffsets);
- var indexCounts = new Uint32Array(parameters.indexCounts);
- var batchIds = new Uint32Array(parameters.batchIds);
- var batchTableColors = new Uint32Array(parameters.batchTableColors);
-
- var numMeshes = indexOffsets.length;
- var boundingVolumes = new Array(numMeshes);
-
- var vertexBatchIds = new Uint16Array(positions.length / 3);
-
- var center = scratchCenter;
- var modelMatrix = scratchMatrix4;
-
- var i;
- var length = positions.length;
- for (i = 0; i < length; i += 3) {
- var position = Cartesian3.unpack(positions, i, scratchPosition);
-
- Matrix4.multiplyByPoint(modelMatrix, position, position);
- Cartesian3.subtract(position, center, position);
-
- Cartesian3.pack(position, positions, i);
- }
-
- var batchedIndices = new Array(numMeshes);
- var mesh = scratchMesh;
-
- for (i = 0; i < numMeshes; ++i) {
- var batchId = batchIds[i];
- var offset = indexOffsets[i];
- var count = indexCounts[i];
-
- mesh.length = count;
-
- for (var j = 0; j < count; ++j) {
- var index = indices[offset + j];
- vertexBatchIds[index] = batchId;
-
- var result = mesh[j];
- if (!defined(result)) {
- result = mesh[j] = new Cartesian3();
- }
-
- var meshPosition = Cartesian3.unpack(positions, index * 3, scratchPosition);
- Cartesian3.add(meshPosition, center, result);
- }
-
- batchedIndices[i] = new Vector3DTileBatch({
- offset : offset,
- count : count,
- color : Color.fromRgba(batchTableColors[batchId]),
- batchIds : [batchId]
- });
-
- boundingVolumes[i] = BoundingSphere.fromPoints(mesh);
- }
-
- var packedBuffer = packBuffer(batchedIndices, boundingVolumes);
-
- transferableObjects.push(positions.buffer, indices.buffer, indexOffsets.buffer, indexCounts.buffer, vertexBatchIds.buffer, packedBuffer.buffer);
-
- return {
- positions : positions.buffer,
- indices : indices.buffer,
- indexOffsets : indexOffsets.buffer,
- indexCounts : indexCounts.buffer,
- batchIds : vertexBatchIds.buffer,
- packedBuffer : packedBuffer.buffer
- };
- }
-
- return createTaskProcessorWorker(createVectorTileMeshes);
-});
diff --git a/Specs/Scene/Vector3DTileMeshesSpec.js b/Specs/Scene/Vector3DTileMeshesSpec.js
deleted file mode 100644
index 754a024df328..000000000000
--- a/Specs/Scene/Vector3DTileMeshesSpec.js
+++ /dev/null
@@ -1,465 +0,0 @@
-defineSuite([
- 'Scene/Vector3DTileMeshes',
- 'Core/BoundingSphere',
- 'Core/Cartesian3',
- 'Core/Color',
- 'Core/ColorGeometryInstanceAttribute',
- 'Core/combine',
- 'Core/destroyObject',
- 'Core/Ellipsoid',
- 'Core/EllipsoidGeometry',
- 'Core/GeometryInstance',
- 'Core/Matrix4',
- 'Core/Rectangle',
- 'Core/RectangleGeometry',
- 'Core/Transforms',
- 'Core/TranslationRotationScale',
- 'Core/VertexFormat',
- 'Renderer/Pass',
- 'Scene/Cesium3DTileBatchTable',
- 'Scene/PerInstanceColorAppearance',
- 'Scene/Primitive',
- 'Specs/createContext',
- 'Specs/createScene',
- 'Specs/pollToPromise'
- ], function(
- Vector3DTileMeshes,
- BoundingSphere,
- Cartesian3,
- Color,
- ColorGeometryInstanceAttribute,
- combine,
- destroyObject,
- Ellipsoid,
- EllipsoidGeometry,
- GeometryInstance,
- Matrix4,
- Rectangle,
- RectangleGeometry,
- Transforms,
- TranslationRotationScale,
- VertexFormat,
- Pass,
- Cesium3DTileBatchTable,
- PerInstanceColorAppearance,
- Primitive,
- createContext,
- createScene,
- pollToPromise) {
- 'use strict';
-
- createMeshSpecs({});
- var c = createContext({ requestWebgl2 : true });
- // Don't repeat WebGL 1 tests when WebGL 2 is not supported
- if (c.webgl2) {
- createMeshSpecs({ requestWebgl2 : true });
- }
- c.destroyForSpecs();
-
- function createMeshSpecs(contextOptions) {
- var webglMessage = contextOptions.requestWebgl2 ? ': WebGL 2' : '';
-
- var scene;
- var rectangle;
- var depthPrimitive;
- var meshes;
-
- var ellipsoid = Ellipsoid.WGS84;
-
- beforeAll(function() {
- scene = createScene({ contextOptions : contextOptions });
- });
-
- afterAll(function() {
- scene.destroyForSpecs();
- });
-
- var mockTileset = {
- _statistics : {
- texturesByteLength : 0
- },
- _tileset : {
- _statistics : {
- batchTableByteLength : 0
- }
- }
- };
-
- function MockGlobePrimitive(primitive) {
- this._primitive = primitive;
- this.pass = Pass.CESIUM_3D_TILE;
- }
-
- MockGlobePrimitive.prototype.update = function(frameState) {
- var commandList = frameState.commandList;
- var startLength = commandList.length;
- this._primitive.update(frameState);
-
- for (var i = startLength; i < commandList.length; ++i) {
- var command = commandList[i];
- command.pass = this.pass;
- }
- };
-
- MockGlobePrimitive.prototype.isDestroyed = function() {
- return false;
- };
-
- MockGlobePrimitive.prototype.destroy = function() {
- this._primitive.destroy();
- return destroyObject(this);
- };
-
- beforeEach(function() {
- rectangle = Rectangle.fromDegrees(-80.0, 20.0, -70.0, 30.0);
-
- var depthColorAttribute = ColorGeometryInstanceAttribute.fromColor(new Color(1.0, 0.0, 0.0, 1.0));
- var primitive = new Primitive({
- geometryInstances : new GeometryInstance({
- geometry : new RectangleGeometry({
- ellipsoid : ellipsoid,
- rectangle : rectangle
- }),
- id : 'depth rectangle',
- attributes : {
- color : depthColorAttribute
- }
- }),
- appearance : new PerInstanceColorAppearance({
- translucent : false,
- flat : true
- }),
- asynchronous : false
- });
-
- // wrap rectangle primitive so it gets executed during the globe pass to lay down depth
- depthPrimitive = new MockGlobePrimitive(primitive);
- });
-
- afterEach(function() {
- scene.primitives.removeAll();
- meshes = meshes && !meshes.isDestroyed() && meshes.destroy();
- depthPrimitive = depthPrimitive && !depthPrimitive.isDestroyed() && depthPrimitive.destroy();
- });
-
- function loadMeshes(meshes) {
- var ready = false;
- meshes.readyPromise.then(function() {
- ready = true;
- });
- return pollToPromise(function() {
- meshes.update(scene.frameState);
- scene.frameState.commandList.length = 0;
- return ready;
- });
- }
-
- function createMesh(modelMatrix) {
- var ellipsoidGeometry = EllipsoidGeometry.createGeometry((new EllipsoidGeometry({
- radii : new Cartesian3(1.0, 1.0, 1.0),
- vertexFormat : VertexFormat.POSITION_ONLY
- })));
-
- var positions = ellipsoidGeometry.attributes.position.values;
- var indices = ellipsoidGeometry.indices;
-
- var positionsLength = positions.length;
- for (var j = 0; j < positionsLength; j += 3) {
- var position = Cartesian3.unpack(positions, j, new Cartesian3());
- Matrix4.multiplyByPoint(modelMatrix, position, position);
- Cartesian3.pack(position, positions, j);
- }
-
- return {
- positions : positions,
- indices : indices
- };
- }
-
- function combineMeshes(meshes) {
- var meshesLength = meshes.length;
-
- var indexOffsets = new Uint32Array(meshesLength);
- var indexCounts = new Uint32Array(meshesLength);
-
- var offset = 0;
- var positionCount = 0;
-
- var i;
- var j;
- var mesh;
- var byteLength = 0;
- for (i = 0; i < meshesLength; ++i) {
- mesh = meshes[i];
- byteLength += mesh.indices.byteLength;
- byteLength += mesh.positions.byteLength;
-
- indexOffsets[i] = offset;
- indexCounts[i] = mesh.indices.length;
-
- offset += indexCounts[i];
- positionCount += mesh.positions.length / 3;
- }
-
- var buffer = new ArrayBuffer(byteLength);
-
- var indicesLength = indexOffsets[indexOffsets.length - 1] + indexCounts[indexCounts.length - 1];
- var indicesView = new Uint16Array(buffer, 0, indicesLength);
- var positionsView = new Float32Array(buffer, indicesLength * Uint16Array.BYTES_PER_ELEMENT, positionCount * 3);
-
- var indexOffset = 0;
- var positionOffset = 0;
- positionCount = 0;
-
- for (i = 0; i < meshesLength; ++i) {
- mesh = meshes[i];
-
- var indices = mesh.indices;
- indicesLength = indices.length;
- for (j = 0; j < indicesLength; ++j) {
- indicesView[indexOffset++] = indices[j] + positionCount;
- }
-
- var positions = mesh.positions;
- var positionsLength = positions.length;
- for (j = 0; j < positionsLength; ++j) {
- positionsView[positionOffset++] = positions[j];
- }
-
- positionCount += positionsLength / 3;
- }
-
- return {
- buffer : buffer,
- indexOffsets : indexOffsets,
- indexCounts : indexCounts,
- indexBytesPerElement : Uint16Array.BYTES_PER_ELEMENT,
- positionCount : positionCount
- };
- }
-
- it('renders a mesh' + webglMessage, function() {
- var origin = Rectangle.center(rectangle);
- var center = ellipsoid.cartographicToCartesian(origin);
- var modelMatrix = Transforms.eastNorthUpToFixedFrame(center);
-
- var batchTable = new Cesium3DTileBatchTable(mockTileset, 1);
- batchTable.update(mockTileset, scene.frameState);
-
- scene.primitives.add(depthPrimitive);
-
- var options = combineMeshes([createMesh(Matrix4.fromUniformScale(1000000.0))]);
-
- meshes = scene.primitives.add(new Vector3DTileMeshes(combine(options, {
- byteOffset : 0,
- batchIds : new Uint16Array([0]),
- center : center,
- modelMatrix : modelMatrix,
- batchTable : batchTable
- })));
- return loadMeshes(meshes).then(function() {
- scene.camera.lookAtTransform(modelMatrix, new Cartesian3(0.0, 0.0, 10.0));
- expect(scene).toRender([255, 255, 255, 255]);
-
- batchTable.setColor(0, Color.BLUE);
- meshes.updateCommands(0, Color.BLUE);
- batchTable.update(mockTileset, scene.frameState);
- expect(scene).toRender([0, 0, 255, 255]);
- });
- });
-
- it('renders multiple meshes' + webglMessage, function() {
- var origin = Rectangle.center(rectangle);
- var center = ellipsoid.cartographicToCartesian(origin);
- var modelMatrix = Transforms.eastNorthUpToFixedFrame(center);
-
- var batchTable = new Cesium3DTileBatchTable(mockTileset, 2);
- batchTable.update(mockTileset, scene.frameState);
-
- scene.primitives.add(depthPrimitive);
-
- var scale = 125000.0;
- var matrices = [Matrix4.multiply(Matrix4.fromTranslation(new Cartesian3(scale, 0.0, 0.0)), Matrix4.fromUniformScale(scale), new Matrix4()),
- Matrix4.multiply(Matrix4.fromTranslation(new Cartesian3(-scale, 0.0, 0.0)), Matrix4.fromUniformScale(scale), new Matrix4())];
- var options = combineMeshes([createMesh(matrices[0]),
- createMesh(matrices[1])]);
-
- var bv = new BoundingSphere(center, 2.0 * scale);
-
- meshes = scene.primitives.add(new Vector3DTileMeshes(combine(options, {
- byteOffset : 0,
- batchIds : new Uint16Array([0, 1]),
- center : center,
- modelMatrix : modelMatrix,
- batchTable : batchTable,
- boundingVolume : bv
- })));
- return loadMeshes(meshes).then(function() {
- for (var i = 0; i < matrices.length; ++i) {
- var transform = Matrix4.multiply(modelMatrix, Matrix4.fromTranslation(Matrix4.getTranslation(matrices[i], new Cartesian3())), new Matrix4());
- scene.camera.lookAtTransform(transform, new Cartesian3(0.0, 0.0, 10.0));
- expect(scene).toRender([255, 255, 255, 255]);
-
- batchTable.setColor(i, Color.BLUE);
- meshes.updateCommands(i, Color.BLUE);
- batchTable.update(mockTileset, scene.frameState);
- expect(scene).toRender([0, 0, 255, 255]);
- }
- });
- });
-
- it('renders multiple meshes after a re-batch' + webglMessage, function() {
- var origin = Rectangle.center(rectangle);
- var center = ellipsoid.cartographicToCartesian(origin);
- var modelMatrix = Transforms.eastNorthUpToFixedFrame(center);
-
- var batchTable = new Cesium3DTileBatchTable(mockTileset, 2);
- batchTable.update(mockTileset, scene.frameState);
-
- scene.primitives.add(depthPrimitive);
-
- var scale = 125000.0;
- var matrices = [Matrix4.multiply(Matrix4.fromTranslation(new Cartesian3(scale, 0.0, 0.0)), Matrix4.fromUniformScale(scale), new Matrix4()),
- Matrix4.multiply(Matrix4.fromTranslation(new Cartesian3(-scale, 0.0, 0.0)), Matrix4.fromUniformScale(scale), new Matrix4())];
- var options = combineMeshes([createMesh(matrices[0]),
- createMesh(matrices[1])]);
-
- var bv = new BoundingSphere(center, 2.0 * scale);
-
- meshes = scene.primitives.add(new Vector3DTileMeshes(combine(options, {
- byteOffset : 0,
- batchIds : new Uint16Array([0, 1]),
- center : center,
- modelMatrix : modelMatrix,
- batchTable : batchTable,
- boundingVolume : bv
- })));
- meshes.forceRebatch = true;
- return loadMeshes(meshes).then(function() {
- for (var i = 0; i < matrices.length; ++i) {
- var transform = Matrix4.multiply(modelMatrix, Matrix4.fromTranslation(Matrix4.getTranslation(matrices[i], new Cartesian3())), new Matrix4());
- scene.camera.lookAtTransform(transform, new Cartesian3(0.0, 0.0, 10.0));
- expect(scene).toRender([255, 255, 255, 255]);
-
- batchTable.setColor(i, Color.BLUE);
- meshes.updateCommands(i, Color.BLUE);
- batchTable.update(mockTileset, scene.frameState);
- expect(scene).toRender([0, 0, 255, 255]);
- }
- });
- });
-
- it('renders with inverted classification' + webglMessage, function() {
- var origin = Rectangle.center(rectangle);
- var center = ellipsoid.cartographicToCartesian(origin);
- var modelMatrix = Transforms.eastNorthUpToFixedFrame(center);
-
- var batchTable = new Cesium3DTileBatchTable(mockTileset, 1);
- batchTable.update(mockTileset, scene.frameState);
-
- scene.primitives.add(depthPrimitive);
-
- var radii = new Cartesian3(10.0, 10.0, 1000.0);
- var options = combineMeshes([createMesh(Matrix4.fromScale(radii))]);
-
- meshes = scene.primitives.add(new Vector3DTileMeshes(combine(options, {
- byteOffset : 0,
- batchIds : new Uint16Array([0]),
- center : center,
- modelMatrix : modelMatrix,
- batchTable : batchTable
- })));
- return loadMeshes(meshes).then(function() {
- scene.camera.lookAtTransform(modelMatrix, new Cartesian3(radii.x, 0.0, 1.0));
-
- expect(scene).toRender([255, 0, 0, 255]);
-
- scene.invertClassification = true;
- scene.invertClassificationColor = new Color(0.25, 0.25, 0.25, 1.0);
-
- expect(scene).toRender([64, 0, 0, 255]);
-
- scene.camera.lookAtTransform(modelMatrix, new Cartesian3(0.0, 0.0, 1.0));
- expect(scene).toRender([255, 255, 255, 255]);
-
- scene.invertClassification = false;
- });
- });
-
- it('renders wireframe' + webglMessage, function() {
- var origin = Rectangle.center(rectangle);
- var center = ellipsoid.cartographicToCartesian(origin);
- var modelMatrix = Transforms.eastNorthUpToFixedFrame(center);
-
- var batchTable = new Cesium3DTileBatchTable(mockTileset, 1);
- batchTable.update(mockTileset, scene.frameState);
-
- scene.primitives.add(depthPrimitive);
-
- var options = combineMeshes([createMesh(Matrix4.fromUniformScale(1000000.0))]);
-
- meshes = scene.primitives.add(new Vector3DTileMeshes(combine(options, {
- byteOffset : 0,
- batchIds : new Uint16Array([0]),
- center : center,
- modelMatrix : modelMatrix,
- batchTable : batchTable
- })));
- meshes.debugWireframe = true;
- return loadMeshes(meshes).then(function() {
- scene.camera.lookAtTransform(modelMatrix, new Cartesian3(0.0, 0.0, 10.0));
- expect(scene).toRender([255, 255, 255, 255]);
-
- batchTable.setColor(0, Color.BLUE);
- meshes.updateCommands(0, Color.BLUE);
- batchTable.update(mockTileset, scene.frameState);
- expect(scene).toRender([0, 0, 255, 255]);
- });
- });
-
- it('picks meshes' + webglMessage, function() {
- var origin = Rectangle.center(rectangle);
- var center = ellipsoid.cartographicToCartesian(origin);
- var modelMatrix = Transforms.eastNorthUpToFixedFrame(center);
-
- var batchTable = new Cesium3DTileBatchTable(mockTileset, 1);
- batchTable.update(mockTileset, scene.frameState);
-
- scene.primitives.add(depthPrimitive);
-
- var options = combineMeshes([createMesh(Matrix4.fromUniformScale(1000000.0))]);
-
- meshes = scene.primitives.add(new Vector3DTileMeshes(combine(options, {
- byteOffset : 0,
- batchIds : new Uint16Array([0]),
- center : center,
- modelMatrix : modelMatrix,
- batchTable : batchTable
- })));
- return loadMeshes(meshes).then(function() {
- scene.camera.lookAtTransform(modelMatrix, new Cartesian3(0.0, 0.0, 10.0));
-
- var features = [];
- meshes.createFeatures(mockTileset, features);
- mockTileset.getFeature = function(index) {
- return features[index];
- };
-
- scene.frameState.passes.pick = true;
- batchTable.update(mockTileset, scene.frameState);
- expect(scene).toPickAndCall(function(result) {
- expect(result).toBe(features[0]);
- });
-
- mockTileset.getFeature = undefined;
- });
- });
-
- it('isDestroyed' + webglMessage, function() {
- meshes = new Vector3DTileMeshes({});
- expect(meshes.isDestroyed()).toEqual(false);
- meshes.destroy();
- expect(meshes.isDestroyed()).toEqual(true);
- });
- }
-});
From f15d07f5379b4dd0d9cae5d4ecec886754383733 Mon Sep 17 00:00:00 2001
From: Dan Bagnell
Date: Wed, 6 Dec 2017 14:25:39 -0500
Subject: [PATCH 18/51] Add Geometry tile.
---
Source/Scene/Cesium3DTileContentFactory.js | 5 +
Source/Scene/Geometry3DTileContent.js | 499 +++++++++++++++++++++
server.js | 4 +-
3 files changed, 506 insertions(+), 2 deletions(-)
create mode 100644 Source/Scene/Geometry3DTileContent.js
diff --git a/Source/Scene/Cesium3DTileContentFactory.js b/Source/Scene/Cesium3DTileContentFactory.js
index 4c33baa05ff9..17fc04970aa5 100644
--- a/Source/Scene/Cesium3DTileContentFactory.js
+++ b/Source/Scene/Cesium3DTileContentFactory.js
@@ -1,6 +1,7 @@
define([
'./Batched3DModel3DTileContent',
'./Composite3DTileContent',
+ './Geometry3DTileContent',
'./Instanced3DModel3DTileContent',
'./PointCloud3DTileContent',
'./Tileset3DTileContent',
@@ -8,6 +9,7 @@ define([
], function(
Batched3DModel3DTileContent,
Composite3DTileContent,
+ Geometry3DTileContent,
Instanced3DModel3DTileContent,
PointCloud3DTileContent,
Tileset3DTileContent,
@@ -36,6 +38,9 @@ define([
json : function(tileset, tile, url, arrayBuffer, byteOffset) {
return new Tileset3DTileContent(tileset, tile, url, arrayBuffer, byteOffset);
},
+ geom : function(tileset, tile, url, arrayBuffer, byteOffset) {
+ return new Geometry3DTileContent(tileset, tile, url, arrayBuffer, byteOffset);
+ },
vctr : function(tileset, tile, url, arrayBuffer, byteOffset) {
return new Vector3DTileContent(tileset, tile, url, arrayBuffer, byteOffset);
}
diff --git a/Source/Scene/Geometry3DTileContent.js b/Source/Scene/Geometry3DTileContent.js
new file mode 100644
index 000000000000..d53f97c2b270
--- /dev/null
+++ b/Source/Scene/Geometry3DTileContent.js
@@ -0,0 +1,499 @@
+define([
+ '../Core/Cartesian3',
+ '../Core/defaultValue',
+ '../Core/defined',
+ '../Core/defineProperties',
+ '../Core/destroyObject',
+ '../Core/DeveloperError',
+ '../Core/Ellipsoid',
+ '../Core/FeatureDetection',
+ '../Core/getMagic',
+ '../Core/getStringFromTypedArray',
+ '../Core/Math',
+ '../Core/Matrix4',
+ '../Core/Rectangle',
+ '../Core/RuntimeError',
+ '../ThirdParty/when',
+ './Cesium3DTileBatchTable',
+ './Vector3DTileGeometry'
+], function(
+ Cartesian3,
+ defaultValue,
+ defined,
+ defineProperties,
+ destroyObject,
+ DeveloperError,
+ Ellipsoid,
+ FeatureDetection,
+ getMagic,
+ getStringFromTypedArray,
+ CesiumMath,
+ Matrix4,
+ Rectangle,
+ RuntimeError,
+ when,
+ Cesium3DTileBatchTable,
+ Vector3DTileGeometry) {
+ 'use strict';
+
+ // Bail out if the browser doesn't support typed arrays, to prevent the setup function
+ // from failing, since we won't be able to create a WebGL context anyway.
+ if (!FeatureDetection.supportsTypedArrays()) {
+ return {};
+ }
+
+ /**
+ *
+ * Implements the {@link Cesium3DTileContent} interface.
+ *
+ *
+ * @alias Geometry3DTileContent
+ * @constructor
+ *
+ * @private
+ */
+ function Geometry3DTileContent(tileset, tile, url, arrayBuffer, byteOffset) {
+ this._tileset = tileset;
+ this._tile = tile;
+ this._url = url;
+ this._geometries = undefined;
+
+ this._contentReadyPromise = undefined;
+ this._readyPromise = when.defer();
+
+ this._batchTable = undefined;
+ this._features = undefined;
+
+ /**
+ * Part of the {@link Cesium3DTileContent} interface.
+ */
+ this.featurePropertiesDirty = false;
+
+ initialize(this, arrayBuffer, byteOffset);
+ }
+
+ defineProperties(Geometry3DTileContent.prototype, {
+ /**
+ * @inheritdoc Cesium3DTileContent#featuresLength
+ */
+ featuresLength : {
+ get : function() {
+ return defined(this._batchTable) ? this._batchTable.featuresLength : 0;
+ }
+ },
+
+ /**
+ * @inheritdoc Cesium3DTileContent#pointsLength
+ */
+ pointsLength : {
+ get : function() {
+ return 0;
+ }
+ },
+
+ /**
+ * @inheritdoc Cesium3DTileContent#trianglesLength
+ */
+ trianglesLength : {
+ get : function() {
+ if (defined(this._geometries)) {
+ return this._geometries.trianglesLength;
+ }
+ return 0;
+ }
+ },
+
+ /**
+ * @inheritdoc Cesium3DTileContent#geometryByteLength
+ */
+ geometryByteLength : {
+ get : function() {
+ if (defined(this._geometries)) {
+ return this._geometries.geometryByteLength;
+ }
+ return 0;
+ }
+ },
+
+ /**
+ * @inheritdoc Cesium3DTileContent#texturesByteLength
+ */
+ texturesByteLength : {
+ get : function() {
+ return 0;
+ }
+ },
+
+ /**
+ * @inheritdoc Cesium3DTileContent#batchTableByteLength
+ */
+ batchTableByteLength : {
+ get : function() {
+ return defined(this._batchTable) ? this._batchTable.memorySizeInBytes : 0;
+ }
+ },
+
+ /**
+ * @inheritdoc Cesium3DTileContent#innerContents
+ */
+ innerContents : {
+ get : function() {
+ return undefined;
+ }
+ },
+
+ /**
+ * @inheritdoc Cesium3DTileContent#readyPromise
+ */
+ readyPromise : {
+ get : function() {
+ return this._readyPromise.promise;
+ }
+ },
+
+ /**
+ * @inheritdoc Cesium3DTileContent#tileset
+ */
+ tileset : {
+ get : function() {
+ return this._tileset;
+ }
+ },
+
+ /**
+ * @inheritdoc Cesium3DTileContent#tile
+ */
+ tile : {
+ get : function() {
+ return this._tile;
+ }
+ },
+
+ /**
+ * @inheritdoc Cesium3DTileContent#url
+ */
+ url : {
+ get : function() {
+ return this._url;
+ }
+ },
+
+ /**
+ * @inheritdoc Cesium3DTileContent#batchTable
+ */
+ batchTable : {
+ get : function() {
+ return this._batchTable;
+ }
+ }
+ });
+
+ function createColorChangedCallback(content) {
+ return function(batchId, color) {
+ if (defined(content._geometries)) {
+ content._geometries.updateCommands(batchId, color);
+ }
+ };
+ }
+
+ function getBatchIds(featureTableJson, featureTableBinary) {
+ var boxBatchIds;
+ var cylinderBatchIds;
+ var ellipsoidBatchIds;
+ var sphereBatchIds;
+ var i;
+
+ var numberOfBoxes = defaultValue(featureTableJson.BOXES_LENGTH, 0);
+ var numberOfCylinders = defaultValue(featureTableJson.CYLINDERS_LENGTH, 0);
+ var numberOfEllipsoids = defaultValue(featureTableJson.ELLIPSOIDS_LENGTH, 0);
+ var numberOfSpheres = defaultValue(featureTableJson.SPHERES_LENGTH, 0);
+
+ if (numberOfBoxes > 0 && defined(featureTableJson.BOX_BATCH_IDS)) {
+ var boxBatchIdsByteOffset = featureTableBinary.byteOffset + featureTableJson.BOX_BATCH_IDS.byteOffset;
+ boxBatchIds = new Uint16Array(featureTableBinary.buffer, boxBatchIdsByteOffset, numberOfBoxes);
+ }
+
+ if (numberOfCylinders > 0 && defined(featureTableJson.CYLINDER_BATCH_IDS)) {
+ var cylinderBatchIdsByteOffset = featureTableBinary.byteOffset + featureTableJson.CYLINDER_BATCH_IDS.byteOffset;
+ cylinderBatchIds = new Uint16Array(featureTableBinary.buffer, cylinderBatchIdsByteOffset, numberOfCylinders);
+ }
+
+ if (numberOfEllipsoids > 0 && defined(featureTableJson.ELLIPSOID_BATCH_IDS)) {
+ var ellipsoidBatchIdsByteOffset = featureTableBinary.byteOffset + featureTableJson.ELLIPSOID_BATCH_IDS.byteOffset;
+ ellipsoidBatchIds = new Uint16Array(featureTableBinary.buffer, ellipsoidBatchIdsByteOffset, numberOfEllipsoids);
+ }
+
+ if (numberOfSpheres > 0 && defined(featureTableJson.SPHERE_BATCH_IDS)) {
+ var sphereBatchIdsByteOffset = featureTableBinary.byteOffset + featureTableJson.SPHERE_BATCH_IDS.byteOffset;
+ sphereBatchIds = new Uint16Array(featureTableBinary.buffer, sphereBatchIdsByteOffset, numberOfSpheres);
+ }
+
+ var atLeastOneDefined = defined(boxBatchIds) || defined(cylinderBatchIds) || defined(ellipsoidBatchIds) || defined(sphereBatchIds);
+ var atLeastOneUndefined = (numberOfBoxes > 0 && !defined(boxBatchIds)) ||
+ (numberOfCylinders > 0 && !defined(cylinderBatchIds)) ||
+ (numberOfEllipsoids > 0 && !defined(ellipsoidBatchIds)) ||
+ (numberOfSpheres > 0 && !defined(sphereBatchIds));
+
+ if (atLeastOneDefined && atLeastOneUndefined) {
+ throw new RuntimeError('If one group of batch ids is defined, then all batch ids must be defined.');
+ }
+
+ var allUndefinedBatchIds = !defined(boxBatchIds) && !defined(cylinderBatchIds) && !defined(ellipsoidBatchIds) && !defined(sphereBatchIds);
+ if (allUndefinedBatchIds) {
+ var id = 0;
+ if (!defined(boxBatchIds) && numberOfBoxes > 0) {
+ boxBatchIds = new Uint16Array(numberOfBoxes);
+ for (i = 0; i < numberOfBoxes; ++i) {
+ boxBatchIds[i] = id++;
+ }
+ }
+ if (!defined(cylinderBatchIds) && numberOfCylinders > 0) {
+ cylinderBatchIds = new Uint16Array(numberOfCylinders);
+ for (i = 0; i < numberOfCylinders; ++i) {
+ cylinderBatchIds[i] = id++;
+ }
+ }
+ if (!defined(ellipsoidBatchIds) && numberOfEllipsoids > 0) {
+ ellipsoidBatchIds = new Uint16Array(numberOfEllipsoids);
+ for (i = 0; i < numberOfEllipsoids; ++i) {
+ ellipsoidBatchIds[i] = id++;
+ }
+ }
+ if (!defined(sphereBatchIds) && numberOfSpheres > 0) {
+ sphereBatchIds = new Uint16Array(numberOfSpheres);
+ for (i = 0; i < numberOfSpheres; ++i) {
+ sphereBatchIds[i] = id++;
+ }
+ }
+ }
+
+ return {
+ boxes : boxBatchIds,
+ cylinders : cylinderBatchIds,
+ ellipsoids : ellipsoidBatchIds,
+ spheres : sphereBatchIds
+ };
+ }
+
+ var sizeOfUint32 = Uint32Array.BYTES_PER_ELEMENT;
+
+ function initialize(content, arrayBuffer, byteOffset) {
+ byteOffset = defaultValue(byteOffset, 0);
+
+ var uint8Array = new Uint8Array(arrayBuffer);
+ var view = new DataView(arrayBuffer);
+ byteOffset += sizeOfUint32; // Skip magic number
+
+ var version = view.getUint32(byteOffset, true);
+ if (version !== 1) {
+ throw new RuntimeError('Only Geometry tile version 1 is supported. Version ' + version + ' is not.');
+ }
+ byteOffset += sizeOfUint32;
+
+ var byteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint32;
+
+ if (byteLength === 0) {
+ content._readyPromise.resolve(content);
+ return;
+ }
+
+ var featureTableJSONByteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint32;
+
+ if (featureTableJSONByteLength === 0) {
+ throw new RuntimeError('Feature table must have a byte length greater than zero');
+ }
+
+ var featureTableBinaryByteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint32;
+ var batchTableJSONByteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint32;
+ var batchTableBinaryByteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint32;
+
+ var featureTableString = getStringFromTypedArray(uint8Array, byteOffset, featureTableJSONByteLength);
+ var featureTableJson = JSON.parse(featureTableString);
+ byteOffset += featureTableJSONByteLength;
+
+ var featureTableBinary = new Uint8Array(arrayBuffer, byteOffset, featureTableBinaryByteLength);
+ byteOffset += featureTableBinaryByteLength;
+
+ var batchTableJson;
+ var batchTableBinary;
+ if (batchTableJSONByteLength > 0) {
+ // PERFORMANCE_IDEA: is it possible to allocate this on-demand? Perhaps keep the
+ // arraybuffer/string compressed in memory and then decompress it when it is first accessed.
+ //
+ // We could also make another request for it, but that would make the property set/get
+ // API async, and would double the number of numbers in some cases.
+ var batchTableString = getStringFromTypedArray(uint8Array, byteOffset, batchTableJSONByteLength);
+ batchTableJson = JSON.parse(batchTableString);
+ byteOffset += batchTableJSONByteLength;
+
+ if (batchTableBinaryByteLength > 0) {
+ // Has a batch table binary
+ batchTableBinary = new Uint8Array(arrayBuffer, byteOffset, batchTableBinaryByteLength);
+ // Copy the batchTableBinary section and let the underlying ArrayBuffer be freed
+ batchTableBinary = new Uint8Array(batchTableBinary);
+ }
+ }
+
+ var numberOfBoxes = defaultValue(featureTableJson.BOXES_LENGTH, 0);
+ var numberOfCylinders = defaultValue(featureTableJson.CYLINDERS_LENGTH, 0);
+ var numberOfEllipsoids = defaultValue(featureTableJson.ELLIPSOIDS_LENGTH, 0);
+ var numberOfSpheres = defaultValue(featureTableJson.SPHERES_LENGTH, 0);
+
+ var totalPrimitives = numberOfBoxes + numberOfCylinders + numberOfEllipsoids + numberOfSpheres;
+
+ var batchTable = new Cesium3DTileBatchTable(content, totalPrimitives, batchTableJson, batchTableBinary, createColorChangedCallback(content));
+ content._batchTable = batchTable;
+
+ if (totalPrimitives === 0) {
+ return;
+ }
+
+ var modelMatrix = content._tile.computedTransform;
+
+ var center;
+ if (defined(featureTableJson.RTC_CENTER)) {
+ center = Cartesian3.unpack(featureTableJson.RTC_CENTER);
+ Matrix4.multiplyByPoint(modelMatrix, center, center);
+ }
+
+ var batchIds = getBatchIds(featureTableJson, featureTableBinary);
+
+ if (numberOfBoxes > 0 || numberOfCylinders > 0 || numberOfEllipsoids > 0 || numberOfSpheres > 0) {
+ var boxes;
+ var cylinders;
+ var ellipsoids;
+ var spheres;
+
+ if (numberOfBoxes > 0) {
+ var boxesByteOffset = featureTableBinary.byteOffset + featureTableJson.BOXES.byteOffset;
+ boxes = new Float32Array(featureTableBinary.buffer, boxesByteOffset, Vector3DTileGeometry.packedBoxLength * numberOfBoxes);
+ }
+
+ if (numberOfCylinders > 0) {
+ var cylindersByteOffset = featureTableBinary.byteOffset + featureTableJson.CYLINDERS.byteOffset;
+ cylinders = new Float32Array(featureTableBinary.buffer, cylindersByteOffset, Vector3DTileGeometry.packedCylinderLength * numberOfCylinders);
+ }
+
+ if (numberOfEllipsoids > 0) {
+ var ellipsoidsByteOffset = featureTableBinary.byteOffset + featureTableJson.ELLIPSOIDS.byteOffset;
+ ellipsoids = new Float32Array(featureTableBinary.buffer, ellipsoidsByteOffset, Vector3DTileGeometry.packedEllipsoidLength * numberOfEllipsoids);
+ }
+
+ if (numberOfSpheres > 0) {
+ var spheresByteOffset = featureTableBinary.byteOffset + featureTableJson.SPHERES.byteOffset;
+ spheres = new Float32Array(featureTableBinary.buffer, spheresByteOffset, Vector3DTileGeometry.packedSphereLength * numberOfSpheres);
+ }
+
+ content._geometries = new Vector3DTileGeometry({
+ boxes : boxes,
+ boxBatchIds : batchIds.boxes,
+ cylinders : cylinders,
+ cylinderBatchIds : batchIds.cylinders,
+ ellipsoids : ellipsoids,
+ ellipsoidBatchIds : batchIds.ellipsoids,
+ spheres : spheres,
+ sphereBatchIds : batchIds.spheres,
+ center : center,
+ modelMatrix : modelMatrix,
+ batchTable : batchTable,
+ boundingVolume : content._tile._boundingVolume.boundingVolume
+ });
+ }
+ }
+
+ function createFeatures(content) {
+ var featuresLength = content.featuresLength;
+ if (!defined(content._features) && (featuresLength > 0)) {
+ var features = new Array(featuresLength);
+ if (defined(content._geometries)) {
+ content._geometries.createFeatures(content, features);
+ }
+ content._features = features;
+ }
+ }
+
+ /**
+ * @inheritdoc Cesium3DTileContent#hasProperty
+ */
+ Geometry3DTileContent.prototype.hasProperty = function(batchId, name) {
+ return this._batchTable.hasProperty(batchId, name);
+ };
+
+ /**
+ * @inheritdoc Cesium3DTileContent#getFeature
+ */
+ Geometry3DTileContent.prototype.getFeature = function(batchId) {
+ //>>includeStart('debug', pragmas.debug);
+ var featuresLength = this.featuresLength;
+ if (!defined(batchId) || (batchId < 0) || (batchId >= featuresLength)) {
+ throw new DeveloperError('batchId is required and between zero and featuresLength - 1 (' + (featuresLength - 1) + ').');
+ }
+ //>>includeEnd('debug');
+
+ createFeatures(this);
+ return this._features[batchId];
+ };
+
+ /**
+ * @inheritdoc Cesium3DTileContent#applyDebugSettings
+ */
+ Geometry3DTileContent.prototype.applyDebugSettings = function(enabled, color) {
+ if (defined(this._geometries)) {
+ this._geometries.applyDebugSettings(enabled, color);
+ }
+ };
+
+ /**
+ * @inheritdoc Cesium3DTileContent#applyStyle
+ */
+ Geometry3DTileContent.prototype.applyStyle = function(frameState, style) {
+ createFeatures(this);
+ if (defined(this._geometries)) {
+ this._geometries.applyStyle(frameState, style, this._features);
+ }
+ };
+
+ /**
+ * @inheritdoc Cesium3DTileContent#update
+ */
+ Geometry3DTileContent.prototype.update = function(tileset, frameState) {
+ if (defined(this._batchTable)) {
+ this._batchTable.update(tileset, frameState);
+ }
+ if (defined(this._geometries)) {
+ this._geometries.classificationType = this._tileset.classificationType;
+ this._geometries.debugWireframe = this._tileset.debugWireframe;
+ this._geometries.update(frameState);
+ }
+
+ if (!defined(this._contentReadyPromise)) {
+ var that = this;
+ this._contentReadyPromise = this._geometries.readyPromise.then(function() {
+ that._readyPromise.resolve(that);
+ });
+ }
+ };
+
+ /**
+ * @inheritdoc Cesium3DTileContent#isDestroyed
+ */
+ Geometry3DTileContent.prototype.isDestroyed = function() {
+ return false;
+ };
+
+ /**
+ * @inheritdoc Cesium3DTileContent#destroy
+ */
+ Geometry3DTileContent.prototype.destroy = function() {
+ this._geometries = this._geometries && this._geometries.destroy();
+ this._batchTable = this._batchTable && this._batchTable.destroy();
+ return destroyObject(this);
+ };
+
+ return Geometry3DTileContent;
+});
diff --git a/server.js b/server.js
index 8f3ae049d91a..e496eeebe38d 100644
--- a/server.js
+++ b/server.js
@@ -46,7 +46,7 @@
'image/ktx' : ['ktx'],
'model/gltf+json' : ['gltf'],
'model/gltf-binary' : ['bgltf', 'glb'],
- 'application/octet-stream' : ['b3dm', 'pnts', 'i3dm', 'cmpt', 'vctr'],
+ 'application/octet-stream' : ['b3dm', 'pnts', 'i3dm', 'cmpt', 'geom', 'vctr'],
'text/plain' : ['glsl']
}, true);
@@ -75,7 +75,7 @@
});
}
- var knownTilesetFormats = [/\.b3dm/, /\.pnts/, /\.i3dm/, /\.cmpt/, /\.glb/, /\.vctr/, /tileset.*\.json$/];
+ var knownTilesetFormats = [/\.b3dm/, /\.pnts/, /\.i3dm/, /\.cmpt/, /\.glb/, /\.geom/, /\.vctr/, /tileset.*\.json$/];
app.get(knownTilesetFormats, checkGzipAndNext);
app.use(express.static(__dirname));
From 1f8fb07a3d5a188d6f9322371d365bcd73cdf18e Mon Sep 17 00:00:00 2001
From: Dan Bagnell
Date: Wed, 6 Dec 2017 14:28:31 -0500
Subject: [PATCH 19/51] Remove geometry from vector tile.
---
Source/Scene/Vector3DTileContent.js | 146 +---------------------------
1 file changed, 3 insertions(+), 143 deletions(-)
diff --git a/Source/Scene/Vector3DTileContent.js b/Source/Scene/Vector3DTileContent.js
index 8d4e4917f462..2d7eb7be7c5f 100644
--- a/Source/Scene/Vector3DTileContent.js
+++ b/Source/Scene/Vector3DTileContent.js
@@ -15,7 +15,6 @@ define([
'../Core/RuntimeError',
'../ThirdParty/when',
'./Cesium3DTileBatchTable',
- './Vector3DTileGeometry',
'./Vector3DTilePoints',
'./Vector3DTilePolygons',
'./Vector3DTilePolylines'
@@ -36,7 +35,6 @@ define([
RuntimeError,
when,
Cesium3DTileBatchTable,
- Vector3DTileGeometry,
Vector3DTilePoints,
Vector3DTilePolygons,
Vector3DTilePolylines) {
@@ -69,7 +67,6 @@ define([
this._polygons = undefined;
this._polylines = undefined;
this._points = undefined;
- this._geometries = undefined;
this._contentReadyPromise = undefined;
this._readyPromise = when.defer();
@@ -119,9 +116,6 @@ define([
if (defined(this._polylines)) {
trianglesLength += this._polylines.trianglesLength;
}
- if (defined(this._geometries)) {
- trianglesLength += this._geometries.trianglesLength;
- }
return trianglesLength;
}
},
@@ -138,9 +132,6 @@ define([
if (defined(this._polylines)) {
geometryByteLength += this._polylines.geometryByteLength;
}
- if (defined(this._geometries)) {
- geometryByteLength += this._geometries.geometryByteLength;
- }
return geometryByteLength;
}
},
@@ -226,9 +217,6 @@ define([
if (defined(content._polygons)) {
content._polygons.updateCommands(batchId, color);
}
- if (defined(content._geometries)) {
- content._geometries.updateCommands(batchId, color);
- }
};
}
@@ -236,19 +224,11 @@ define([
var polygonBatchIds;
var polylineBatchIds;
var pointBatchIds;
- var boxBatchIds;
- var cylinderBatchIds;
- var ellipsoidBatchIds;
- var sphereBatchIds;
var i;
var numberOfPolygons = defaultValue(featureTableJson.POLYGONS_LENGTH, 0);
var numberOfPolylines = defaultValue(featureTableJson.POLYLINES_LENGTH, 0);
var numberOfPoints = defaultValue(featureTableJson.POINTS_LENGTH, 0);
- var numberOfBoxes = defaultValue(featureTableJson.BOXES_LENGTH, 0);
- var numberOfCylinders = defaultValue(featureTableJson.CYLINDERS_LENGTH, 0);
- var numberOfEllipsoids = defaultValue(featureTableJson.ELLIPSOIDS_LENGTH, 0);
- var numberOfSpheres = defaultValue(featureTableJson.SPHERES_LENGTH, 0);
if (numberOfPolygons > 0 && defined(featureTableJson.POLYGON_BATCH_IDS)) {
var polygonBatchIdsByteOffset = featureTableBinary.byteOffset + featureTableJson.POLYGON_BATCH_IDS.byteOffset;
@@ -265,44 +245,16 @@ define([
pointBatchIds = new Uint16Array(featureTableBinary.buffer, pointBatchIdsByteOffset, numberOfPoints);
}
- if (numberOfBoxes > 0 && defined(featureTableJson.BOX_BATCH_IDS)) {
- var boxBatchIdsByteOffset = featureTableBinary.byteOffset + featureTableJson.BOX_BATCH_IDS.byteOffset;
- boxBatchIds = new Uint16Array(featureTableBinary.buffer, boxBatchIdsByteOffset, numberOfBoxes);
- }
-
- if (numberOfCylinders > 0 && defined(featureTableJson.CYLINDER_BATCH_IDS)) {
- var cylinderBatchIdsByteOffset = featureTableBinary.byteOffset + featureTableJson.CYLINDER_BATCH_IDS.byteOffset;
- cylinderBatchIds = new Uint16Array(featureTableBinary.buffer, cylinderBatchIdsByteOffset, numberOfCylinders);
- }
-
- if (numberOfEllipsoids > 0 && defined(featureTableJson.ELLIPSOID_BATCH_IDS)) {
- var ellipsoidBatchIdsByteOffset = featureTableBinary.byteOffset + featureTableJson.ELLIPSOID_BATCH_IDS.byteOffset;
- ellipsoidBatchIds = new Uint16Array(featureTableBinary.buffer, ellipsoidBatchIdsByteOffset, numberOfEllipsoids);
- }
-
- if (numberOfSpheres > 0 && defined(featureTableJson.SPHERE_BATCH_IDS)) {
- var sphereBatchIdsByteOffset = featureTableBinary.byteOffset + featureTableJson.SPHERE_BATCH_IDS.byteOffset;
- sphereBatchIds = new Uint16Array(featureTableBinary.buffer, sphereBatchIdsByteOffset, numberOfSpheres);
- }
-
var atLeastOneDefined = defined(polygonBatchIds) || defined(polylineBatchIds) || defined(pointBatchIds);
- atLeastOneDefined = atLeastOneDefined || defined(boxBatchIds) || defined(cylinderBatchIds) || defined(ellipsoidBatchIds) || defined(sphereBatchIds);
-
var atLeastOneUndefined = (numberOfPolygons > 0 && !defined(polygonBatchIds)) ||
(numberOfPolylines > 0 && !defined(polylineBatchIds)) ||
- (numberOfPoints > 0 && !defined(pointBatchIds)) ||
- (numberOfBoxes > 0 && !defined(boxBatchIds)) ||
- (numberOfCylinders > 0 && !defined(cylinderBatchIds)) ||
- (numberOfEllipsoids > 0 && !defined(ellipsoidBatchIds)) ||
- (numberOfSpheres > 0 && !defined(sphereBatchIds));
+ (numberOfPoints > 0 && !defined(pointBatchIds));
if (atLeastOneDefined && atLeastOneUndefined) {
throw new RuntimeError('If one group of batch ids is defined, then all batch ids must be defined.');
}
var allUndefinedBatchIds = !defined(polygonBatchIds) && !defined(polylineBatchIds) && !defined(pointBatchIds);
- allUndefinedBatchIds = allUndefinedBatchIds && !defined(boxBatchIds) && !defined(cylinderBatchIds) && !defined(ellipsoidBatchIds) && !defined(sphereBatchIds);
-
if (allUndefinedBatchIds) {
var id = 0;
if (!defined(polygonBatchIds) && numberOfPolygons > 0) {
@@ -323,40 +275,12 @@ define([
pointBatchIds[i] = id++;
}
}
- if (!defined(boxBatchIds) && numberOfBoxes > 0) {
- boxBatchIds = new Uint16Array(numberOfBoxes);
- for (i = 0; i < numberOfBoxes; ++i) {
- boxBatchIds[i] = id++;
- }
- }
- if (!defined(cylinderBatchIds) && numberOfCylinders > 0) {
- cylinderBatchIds = new Uint16Array(numberOfCylinders);
- for (i = 0; i < numberOfCylinders; ++i) {
- cylinderBatchIds[i] = id++;
- }
- }
- if (!defined(ellipsoidBatchIds) && numberOfEllipsoids > 0) {
- ellipsoidBatchIds = new Uint16Array(numberOfEllipsoids);
- for (i = 0; i < numberOfEllipsoids; ++i) {
- ellipsoidBatchIds[i] = id++;
- }
- }
- if (!defined(sphereBatchIds) && numberOfSpheres > 0) {
- sphereBatchIds = new Uint16Array(numberOfSpheres);
- for (i = 0; i < numberOfSpheres; ++i) {
- sphereBatchIds[i] = id++;
- }
- }
}
return {
polygons : polygonBatchIds,
polylines : polylineBatchIds,
- points : pointBatchIds,
- boxes : boxBatchIds,
- cylinders : cylinderBatchIds,
- ellipsoids : ellipsoidBatchIds,
- spheres : sphereBatchIds
+ points : pointBatchIds
};
}
@@ -437,13 +361,7 @@ define([
var numberOfPolygons = defaultValue(featureTableJson.POLYGONS_LENGTH, 0);
var numberOfPolylines = defaultValue(featureTableJson.POLYLINES_LENGTH, 0);
var numberOfPoints = defaultValue(featureTableJson.POINTS_LENGTH, 0);
- var numberOfBoxes = defaultValue(featureTableJson.BOXES_LENGTH, 0);
- var numberOfCylinders = defaultValue(featureTableJson.CYLINDERS_LENGTH, 0);
- var numberOfEllipsoids = defaultValue(featureTableJson.ELLIPSOIDS_LENGTH, 0);
- var numberOfSpheres = defaultValue(featureTableJson.SPHERES_LENGTH, 0);
-
var totalPrimitives = numberOfPolygons + numberOfPolylines + numberOfPoints;
- totalPrimitives += numberOfBoxes + numberOfCylinders + numberOfEllipsoids + numberOfSpheres;
var batchTable = new Cesium3DTileBatchTable(content, totalPrimitives, batchTableJson, batchTableBinary, createColorChangedCallback(content));
content._batchTable = batchTable;
@@ -561,48 +479,6 @@ define([
batchTable : batchTable
});
}
-
- if (numberOfBoxes > 0 || numberOfCylinders > 0 || numberOfEllipsoids > 0 || numberOfSpheres > 0) {
- var boxes;
- var cylinders;
- var ellipsoids;
- var spheres;
-
- if (numberOfBoxes > 0) {
- var boxesByteOffset = featureTableBinary.byteOffset + featureTableJson.BOXES.byteOffset;
- boxes = new Float32Array(featureTableBinary.buffer, boxesByteOffset, Vector3DTileGeometry.packedBoxLength * numberOfBoxes);
- }
-
- if (numberOfCylinders > 0) {
- var cylindersByteOffset = featureTableBinary.byteOffset + featureTableJson.CYLINDERS.byteOffset;
- cylinders = new Float32Array(featureTableBinary.buffer, cylindersByteOffset, Vector3DTileGeometry.packedCylinderLength * numberOfCylinders);
- }
-
- if (numberOfEllipsoids > 0) {
- var ellipsoidsByteOffset = featureTableBinary.byteOffset + featureTableJson.ELLIPSOIDS.byteOffset;
- ellipsoids = new Float32Array(featureTableBinary.buffer, ellipsoidsByteOffset, Vector3DTileGeometry.packedEllipsoidLength * numberOfEllipsoids);
- }
-
- if (numberOfSpheres > 0) {
- var spheresByteOffset = featureTableBinary.byteOffset + featureTableJson.SPHERES.byteOffset;
- spheres = new Float32Array(featureTableBinary.buffer, spheresByteOffset, Vector3DTileGeometry.packedSphereLength * numberOfSpheres);
- }
-
- content._geometries = new Vector3DTileGeometry({
- boxes : boxes,
- boxBatchIds : batchIds.boxes,
- cylinders : cylinders,
- cylinderBatchIds : batchIds.cylinders,
- ellipsoids : ellipsoids,
- ellipsoidBatchIds : batchIds.ellipsoids,
- spheres : spheres,
- sphereBatchIds : batchIds.spheres,
- center : center,
- modelMatrix : modelMatrix,
- batchTable : batchTable,
- boundingVolume : content._tile._boundingVolume.boundingVolume
- });
- }
}
function createFeatures(content) {
@@ -619,9 +495,6 @@ define([
if (defined(content._points)) {
content._points.createFeatures(content, features);
}
- if (defined(content._geometries)) {
- content._geometries.createFeatures(content, features);
- }
content._features = features;
}
}
@@ -661,9 +534,6 @@ define([
if (defined(this._points)) {
this._points.applyDebugSettings(enabled, color);
}
- if (defined(this._geometries)) {
- this._geometries.applyDebugSettings(enabled, color);
- }
};
/**
@@ -680,9 +550,6 @@ define([
if (defined(this._points)) {
this._points.applyStyle(frameState, style, this._features);
}
- if (defined(this._geometries)) {
- this._geometries.applyStyle(frameState, style, this._features);
- }
};
/**
@@ -702,20 +569,14 @@ define([
if (defined(this._points)) {
this._points.update(frameState);
}
- if (defined(this._geometries)) {
- this._geometries.classificationType = this._tileset.classificationType;
- this._geometries.debugWireframe = this._tileset.debugWireframe;
- this._geometries.update(frameState);
- }
if (!defined(this._contentReadyPromise)) {
var pointsPromise = defined(this._points) ? this._points.readyPromise : undefined;
var polygonPromise = defined(this._polygons) ? this._polygons.readyPromise : undefined;
var polylinePromise = defined(this._polylines) ? this._polylines.readyPromise : undefined;
- var geometryPromise = defined(this._geometries) ? this._geometries.readyPromise : undefined;
var that = this;
- this._contentReadyPromise = when.all([pointsPromise, polygonPromise, polylinePromise, geometryPromise]).then(function() {
+ this._contentReadyPromise = when.all([pointsPromise, polygonPromise, polylinePromise]).then(function() {
that._readyPromise.resolve(that);
});
}
@@ -735,7 +596,6 @@ define([
this._polygons = this._polygons && this._polygons.destroy();
this._polylines = this._polylines && this._polylines.destroy();
this._points = this._points && this._points.destroy();
- this._geometries = this._geometries && this._geometries.destroy();
this._batchTable = this._batchTable && this._batchTable.destroy();
return destroyObject(this);
};
From 9c054da7fc371e4863ece12b74763a575c1a9775 Mon Sep 17 00:00:00 2001
From: Dan Bagnell
Date: Wed, 6 Dec 2017 15:47:15 -0500
Subject: [PATCH 20/51] Update point cloud classification example. Tweak
geometry tile to prevent jitter.
---
.../gallery/3D Tiles Point Cloud Classification.html | 2 +-
Source/Scene/Vector3DTileGeometry.js | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/Apps/Sandcastle/gallery/3D Tiles Point Cloud Classification.html b/Apps/Sandcastle/gallery/3D Tiles Point Cloud Classification.html
index ec96273c2627..497be0e9510d 100644
--- a/Apps/Sandcastle/gallery/3D Tiles Point Cloud Classification.html
+++ b/Apps/Sandcastle/gallery/3D Tiles Point Cloud Classification.html
@@ -37,7 +37,7 @@
// For more details, see:
// https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/vector-tiles/TileFormats/VectorData
var classification = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
- url: 'https://beta.cesium.com/api/assets/3394?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIzZjM4MjljZi0xNTAzLTQ0MzctODhlZi0zOTU3Njg5ODA1Y2QiLCJpZCI6OCwiaWF0IjoxNDgxODI5ODMyfQ.dYlV8_PoXcFNlPHGook5kMzuJMS-Bb9DCMzI1mFVvgE',
+ url: 'https://beta.cesium.com/api/assets/3469?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIzZjM4MjljZi0xNTAzLTQ0MzctODhlZi0zOTU3Njg5ODA1Y2QiLCJpZCI6OCwiaWF0IjoxNDgxODI5ODMyfQ.dYlV8_PoXcFNlPHGook5kMzuJMS-Bb9DCMzI1mFVvgE',
skipLevelOfDetail : false,
classificationType : Cesium.ClassificationType.CESIUM_3D_TILE
}));
diff --git a/Source/Scene/Vector3DTileGeometry.js b/Source/Scene/Vector3DTileGeometry.js
index 8841d6d3460c..1f4843b91bf5 100644
--- a/Source/Scene/Vector3DTileGeometry.js
+++ b/Source/Scene/Vector3DTileGeometry.js
@@ -62,11 +62,12 @@ define([
this._ellipsoidBatchIds = options.ellipsoidBatchIds;
this._spheres = options.spheres;
this._sphereBatchIds = options.sphereBatchIds;
- this._center = options.center;
this._modelMatrix = options.modelMatrix;
this._batchTable = options.batchTable;
this._boundingVolume = options.boundingVolume;
+ this._center = defaultValue(options.center, this._boundingVolume.center);
+
this._boundingVolumes = undefined;
this._batchedIndices = undefined;
From db8515368949ecb4644f0d6eca59618b1ba58d16 Mon Sep 17 00:00:00 2001
From: Dan Bagnell
Date: Wed, 6 Dec 2017 16:15:17 -0500
Subject: [PATCH 21/51] Update Vector tile specs.
---
Source/Scene/Cesium3DTilePointFeature.js | 2 +
.../Vector/VectorTileCombined/tile.vctr | Bin 645 -> 300 bytes
.../VectorTileCombinedWithBatchIds/tile.vctr | Bin 710 -> 331 bytes
.../Vector/VectorTileGeometryAll/ll.vctr | Bin 190 -> 0 bytes
.../Vector/VectorTileGeometryAll/lr.vctr | Bin 180 -> 0 bytes
.../Vector/VectorTileGeometryAll/parent.vctr | Bin 170 -> 0 bytes
.../Vector/VectorTileGeometryAll/tileset.json | 107 -----
.../Vector/VectorTileGeometryAll/ul.vctr | Bin 182 -> 0 bytes
.../Vector/VectorTileGeometryAll/ur.vctr | Bin 226 -> 0 bytes
.../children.vctr | Bin 299 -> 0 bytes
.../parent.vctr | Bin 170 -> 0 bytes
.../tileset.json | 59 ---
.../children.vctr | Bin 296 -> 0 bytes
.../parent.vctr | Bin 170 -> 0 bytes
.../tileset.json | 59 ---
.../children.vctr | Bin 332 -> 0 bytes
.../parent.vctr | Bin 190 -> 0 bytes
.../tileset.json | 59 ---
.../ll.vctr | Bin 190 -> 0 bytes
.../lr.vctr | Bin 180 -> 0 bytes
.../parent.vctr | Bin 170 -> 0 bytes
.../tileset.json | 107 -----
.../ul.vctr | Bin 182 -> 0 bytes
.../ur.vctr | Bin 254 -> 0 bytes
.../Vector/VectorTileGeometryBoxes/ll.vctr | Bin 183 -> 0 bytes
.../Vector/VectorTileGeometryBoxes/lr.vctr | Bin 182 -> 0 bytes
.../VectorTileGeometryBoxes/parent.vctr | Bin 170 -> 0 bytes
.../VectorTileGeometryBoxes/tileset.json | 107 -----
.../Vector/VectorTileGeometryBoxes/ul.vctr | Bin 182 -> 0 bytes
.../Vector/VectorTileGeometryBoxes/ur.vctr | Bin 181 -> 0 bytes
.../children.vctr | Bin 198 -> 0 bytes
.../parent.vctr | Bin 170 -> 0 bytes
.../tileset.json | 59 ---
.../children.vctr | Bin 198 -> 0 bytes
.../parent.vctr | Bin 170 -> 0 bytes
.../tileset.json | 59 ---
.../children.vctr | Bin 224 -> 0 bytes
.../parent.vctr | Bin 190 -> 0 bytes
.../tileset.json | 59 ---
.../ll.vctr | Bin 183 -> 0 bytes
.../lr.vctr | Bin 182 -> 0 bytes
.../parent.vctr | Bin 170 -> 0 bytes
.../tileset.json | 107 -----
.../ul.vctr | Bin 182 -> 0 bytes
.../ur.vctr | Bin 181 -> 0 bytes
.../VectorTileGeometryCylinders/ll.vctr | Bin 216 -> 0 bytes
.../VectorTileGeometryCylinders/lr.vctr | Bin 222 -> 0 bytes
.../VectorTileGeometryCylinders/parent.vctr | Bin 204 -> 0 bytes
.../VectorTileGeometryCylinders/tileset.json | 107 -----
.../VectorTileGeometryCylinders/ul.vctr | Bin 224 -> 0 bytes
.../VectorTileGeometryCylinders/ur.vctr | Bin 218 -> 0 bytes
.../children.vctr | Bin 299 -> 0 bytes
.../parent.vctr | Bin 224 -> 0 bytes
.../tileset.json | 59 ---
.../children.vctr | Bin 348 -> 0 bytes
.../parent.vctr | Bin 210 -> 0 bytes
.../tileset.json | 59 ---
.../children.vctr | Bin 356 -> 0 bytes
.../parent.vctr | Bin 233 -> 0 bytes
.../tileset.json | 59 ---
.../ll.vctr | Bin 217 -> 0 bytes
.../lr.vctr | Bin 218 -> 0 bytes
.../parent.vctr | Bin 202 -> 0 bytes
.../tileset.json | 107 -----
.../ul.vctr | Bin 215 -> 0 bytes
.../ur.vctr | Bin 221 -> 0 bytes
.../VectorTileGeometryEllipsoids/ll.vctr | Bin 190 -> 0 bytes
.../VectorTileGeometryEllipsoids/lr.vctr | Bin 189 -> 0 bytes
.../VectorTileGeometryEllipsoids/parent.vctr | Bin 177 -> 0 bytes
.../VectorTileGeometryEllipsoids/tileset.json | 107 -----
.../VectorTileGeometryEllipsoids/ul.vctr | Bin 189 -> 0 bytes
.../VectorTileGeometryEllipsoids/ur.vctr | Bin 187 -> 0 bytes
.../children.vctr | Bin 205 -> 0 bytes
.../parent.vctr | Bin 177 -> 0 bytes
.../tileset.json | 59 ---
.../children.vctr | Bin 205 -> 0 bytes
.../parent.vctr | Bin 177 -> 0 bytes
.../tileset.json | 59 ---
.../children.vctr | Bin 228 -> 0 bytes
.../parent.vctr | Bin 193 -> 0 bytes
.../tileset.json | 59 ---
.../ll.vctr | Bin 190 -> 0 bytes
.../lr.vctr | Bin 189 -> 0 bytes
.../parent.vctr | Bin 177 -> 0 bytes
.../tileset.json | 107 -----
.../ul.vctr | Bin 189 -> 0 bytes
.../ur.vctr | Bin 187 -> 0 bytes
.../Vector/VectorTileGeometrySpheres/ll.vctr | Bin 181 -> 0 bytes
.../Vector/VectorTileGeometrySpheres/lr.vctr | Bin 180 -> 0 bytes
.../VectorTileGeometrySpheres/parent.vctr | Bin 167 -> 0 bytes
.../VectorTileGeometrySpheres/tileset.json | 107 -----
.../Vector/VectorTileGeometrySpheres/ul.vctr | Bin 179 -> 0 bytes
.../Vector/VectorTileGeometrySpheres/ur.vctr | Bin 179 -> 0 bytes
.../children.vctr | Bin 196 -> 0 bytes
.../parent.vctr | Bin 167 -> 0 bytes
.../tileset.json | 59 ---
.../children.vctr | Bin 196 -> 0 bytes
.../parent.vctr | Bin 167 -> 0 bytes
.../tileset.json | 59 ---
.../children.vctr | Bin 223 -> 0 bytes
.../parent.vctr | Bin 189 -> 0 bytes
.../tileset.json | 59 ---
.../ll.vctr | Bin 181 -> 0 bytes
.../lr.vctr | Bin 180 -> 0 bytes
.../parent.vctr | Bin 167 -> 0 bytes
.../tileset.json | 107 -----
.../ul.vctr | Bin 179 -> 0 bytes
.../ur.vctr | Bin 179 -> 0 bytes
.../Vector/VectorTileMesh/ll.vctr | Bin 335 -> 0 bytes
.../Vector/VectorTileMesh/lr.vctr | Bin 333 -> 0 bytes
.../Vector/VectorTileMesh/parent.vctr | Bin 334 -> 0 bytes
.../Vector/VectorTileMesh/tileset.json | 89 ----
.../Vector/VectorTileMesh/ul.vctr | Bin 340 -> 0 bytes
.../Vector/VectorTileMesh/ur.vctr | Bin 336 -> 0 bytes
.../children.vctr | Bin 599 -> 0 bytes
.../VectorTileMeshBatchedChildren/parent.vctr | Bin 334 -> 0 bytes
.../tileset.json | 41 --
.../children.vctr | Bin 599 -> 0 bytes
.../parent.vctr | Bin 334 -> 0 bytes
.../tileset.json | 41 --
.../VectorTileMeshWithBatchIds/children.vctr | Bin 617 -> 0 bytes
.../VectorTileMeshWithBatchIds/parent.vctr | Bin 348 -> 0 bytes
.../VectorTileMeshWithBatchIds/tileset.json | 41 --
.../VectorTileMeshWithBatchTable/ll.vctr | Bin 335 -> 0 bytes
.../VectorTileMeshWithBatchTable/lr.vctr | Bin 333 -> 0 bytes
.../VectorTileMeshWithBatchTable/parent.vctr | Bin 334 -> 0 bytes
.../VectorTileMeshWithBatchTable/tileset.json | 89 ----
.../VectorTileMeshWithBatchTable/ul.vctr | Bin 340 -> 0 bytes
.../VectorTileMeshWithBatchTable/ur.vctr | Bin 336 -> 0 bytes
.../Vector/VectorTilePoints/ll.vctr | Bin 148 -> 138 bytes
.../Vector/VectorTilePoints/lr.vctr | Bin 150 -> 140 bytes
.../Vector/VectorTilePoints/parent.vctr | Bin 147 -> 137 bytes
.../Vector/VectorTilePoints/ul.vctr | Bin 150 -> 140 bytes
.../Vector/VectorTilePoints/ur.vctr | Bin 148 -> 138 bytes
.../children.vctr | Bin 161 -> 152 bytes
.../parent.vctr | Bin 147 -> 137 bytes
.../children.vctr | Bin 196 -> 186 bytes
.../parent.vctr | Bin 162 -> 152 bytes
.../children.vctr | Bin 201 -> 193 bytes
.../VectorTilePointsWithBatchIds/parent.vctr | Bin 178 -> 171 bytes
.../VectorTilePointsWithBatchTable/ll.vctr | Bin 167 -> 157 bytes
.../VectorTilePointsWithBatchTable/lr.vctr | Bin 169 -> 159 bytes
.../parent.vctr | Bin 162 -> 152 bytes
.../VectorTilePointsWithBatchTable/ul.vctr | Bin 169 -> 159 bytes
.../VectorTilePointsWithBatchTable/ur.vctr | Bin 167 -> 157 bytes
.../Vector/VectorTilePolygons/ll.vctr | Bin 209 -> 200 bytes
.../Vector/VectorTilePolygons/lr.vctr | Bin 208 -> 199 bytes
.../Vector/VectorTilePolygons/parent.vctr | Bin 209 -> 200 bytes
.../Vector/VectorTilePolygons/ul.vctr | Bin 213 -> 203 bytes
.../Vector/VectorTilePolygons/ur.vctr | Bin 210 -> 201 bytes
.../children.vctr | Bin 256 -> 248 bytes
.../parent.vctr | Bin 209 -> 200 bytes
.../children.vctr | Bin 291 -> 282 bytes
.../parent.vctr | Bin 226 -> 216 bytes
.../children.vctr | Bin 278 -> 273 bytes
.../parent.vctr | Bin 224 -> 216 bytes
.../VectorTilePolygonsWithBatchTable/ll.vctr | Bin 229 -> 219 bytes
.../VectorTilePolygonsWithBatchTable/lr.vctr | Bin 228 -> 218 bytes
.../parent.vctr | Bin 226 -> 216 bytes
.../VectorTilePolygonsWithBatchTable/ul.vctr | Bin 232 -> 223 bytes
.../VectorTilePolygonsWithBatchTable/ur.vctr | Bin 230 -> 221 bytes
.../Vector/VectorTilePolylines/ll.vctr | Bin 196 -> 186 bytes
.../Vector/VectorTilePolylines/lr.vctr | Bin 202 -> 192 bytes
.../Vector/VectorTilePolylines/parent.vctr | Bin 209 -> 199 bytes
.../Vector/VectorTilePolylines/ul.vctr | Bin 208 -> 198 bytes
.../Vector/VectorTilePolylines/ur.vctr | Bin 207 -> 198 bytes
.../children.vctr | Bin 254 -> 244 bytes
.../parent.vctr | Bin 209 -> 199 bytes
.../children.vctr | Bin 288 -> 278 bytes
.../parent.vctr | Bin 226 -> 216 bytes
.../children.vctr | Bin 278 -> 269 bytes
.../parent.vctr | Bin 228 -> 218 bytes
.../VectorTilePolylinesWithBatchTable/ll.vctr | Bin 216 -> 206 bytes
.../VectorTilePolylinesWithBatchTable/lr.vctr | Bin 223 -> 213 bytes
.../parent.vctr | Bin 226 -> 216 bytes
.../VectorTilePolylinesWithBatchTable/ul.vctr | Bin 228 -> 218 bytes
.../VectorTilePolylinesWithBatchTable/ur.vctr | Bin 228 -> 218 bytes
Specs/Scene/Vector3DTileContentSpec.js | 416 +-----------------
178 files changed, 10 insertions(+), 2664 deletions(-)
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAll/ll.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAll/lr.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAll/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAll/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAll/ul.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAll/ur.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAllBatchedChildren/children.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAllBatchedChildren/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAllBatchedChildren/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAllBatchedChildrenWithBatchTable/children.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAllBatchedChildrenWithBatchTable/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAllBatchedChildrenWithBatchTable/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAllWithBatchIds/children.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAllWithBatchIds/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAllWithBatchIds/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAllWithBatchTable/ll.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAllWithBatchTable/lr.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAllWithBatchTable/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAllWithBatchTable/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAllWithBatchTable/ul.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAllWithBatchTable/ur.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxes/ll.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxes/lr.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxes/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxes/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxes/ul.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxes/ur.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesBatchedChildren/children.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesBatchedChildren/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesBatchedChildren/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesBatchedChildrenWithBatchTable/children.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesBatchedChildrenWithBatchTable/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesBatchedChildrenWithBatchTable/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesWithBatchIds/children.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesWithBatchIds/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesWithBatchIds/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesWithBatchTable/ll.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesWithBatchTable/lr.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesWithBatchTable/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesWithBatchTable/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesWithBatchTable/ul.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesWithBatchTable/ur.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylinders/ll.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylinders/lr.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylinders/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylinders/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylinders/ul.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylinders/ur.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersBatchedChildren/children.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersBatchedChildren/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersBatchedChildren/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersBatchedChildrenWithBatchTable/children.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersBatchedChildrenWithBatchTable/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersBatchedChildrenWithBatchTable/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersWithBatchIds/children.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersWithBatchIds/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersWithBatchIds/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersWithBatchTable/ll.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersWithBatchTable/lr.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersWithBatchTable/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersWithBatchTable/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersWithBatchTable/ul.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersWithBatchTable/ur.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoids/ll.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoids/lr.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoids/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoids/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoids/ul.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoids/ur.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsBatchedChildren/children.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsBatchedChildren/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsBatchedChildren/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsBatchedChildrenWithBatchTable/children.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsBatchedChildrenWithBatchTable/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsBatchedChildrenWithBatchTable/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsWithBatchIds/children.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsWithBatchIds/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsWithBatchIds/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsWithBatchTable/ll.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsWithBatchTable/lr.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsWithBatchTable/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsWithBatchTable/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsWithBatchTable/ul.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsWithBatchTable/ur.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheres/ll.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheres/lr.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheres/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheres/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheres/ul.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheres/ur.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresBatchedChildren/children.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresBatchedChildren/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresBatchedChildren/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresBatchedChildrenWithBatchTable/children.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresBatchedChildrenWithBatchTable/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresBatchedChildrenWithBatchTable/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresWithBatchIds/children.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresWithBatchIds/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresWithBatchIds/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresWithBatchTable/ll.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresWithBatchTable/lr.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresWithBatchTable/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresWithBatchTable/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresWithBatchTable/ul.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresWithBatchTable/ur.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileMesh/ll.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileMesh/lr.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileMesh/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileMesh/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileMesh/ul.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileMesh/ur.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileMeshBatchedChildren/children.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileMeshBatchedChildren/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileMeshBatchedChildren/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileMeshBatchedChildrenWithBatchTable/children.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileMeshBatchedChildrenWithBatchTable/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileMeshBatchedChildrenWithBatchTable/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileMeshWithBatchIds/children.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileMeshWithBatchIds/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileMeshWithBatchIds/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileMeshWithBatchTable/ll.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileMeshWithBatchTable/lr.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileMeshWithBatchTable/parent.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileMeshWithBatchTable/tileset.json
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileMeshWithBatchTable/ul.vctr
delete mode 100644 Specs/Data/Cesium3DTiles/Vector/VectorTileMeshWithBatchTable/ur.vctr
diff --git a/Source/Scene/Cesium3DTilePointFeature.js b/Source/Scene/Cesium3DTilePointFeature.js
index e537204b1171..c71d6b1412ab 100644
--- a/Source/Scene/Cesium3DTilePointFeature.js
+++ b/Source/Scene/Cesium3DTilePointFeature.js
@@ -72,6 +72,8 @@ define([
this._pointOutlineColor = undefined;
this._pointOutlineWidth = undefined;
this._heightOffset = undefined;
+
+ setBillboardImage(this);
}
var scratchCartographic = new Cartographic();
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileCombined/tile.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileCombined/tile.vctr
index 3d477260ec79855c87b51a3a7129613f4dec2116..8e18d0253c68e0e09a0cad1cccac6a068c0b1547 100644
GIT binary patch
literal 300
zcmV+{0n`2;iwFP!000003yo1tOT$1Aoz&vVg9ig1!=6*wG#@6pq@{*rA=yZ?k%~w_
zX@7tgQA)|L^w-!XPTFWAMsOapJl?)HEVD0<%O?o{NDp9yvh%XFt@PIQ1uD%!9}$?%jZ1P)c>fp_XZzRCjFKG96vr>)NGZ
z>O*H}YK~(dvD828-R^spTqn_Oknl8*d>)7pU+}HvlO*H#rWJX3Th5ck;(5L#E?plC
zj9>Y)Zky5ABF6n+!)viSX76H*i&kc>C`!NC<5|5+6maEm1c$2sq1SMc0c@&|sy=J}
yRYJZ&2)Px5RL&5oys5Tch1h!S+tPzk4XK$eL0Q1RYWiLlW$_8B)%U<60ssJpQ;Ce#eW@R)88n1PvO9)y`D
zXrm-*yL4fRu_1&mj0@H-bgk*mZ_rg8(#BTf2XNs=KY$C<*aDuzTwsO)U2rFVIQ-^+
z9(Qt?=Z`DT0)&vpaY9~B5wZb4W{9({g3f|ofZ#T%GMb_*+LBh5B_%Ig%;G|XWy6e?
zE_rAd7Nx9}*7K^wEG{pwcUYE<@&X%=C1Y$Yb@#Dsxpt(D=Wt8>e@;La%uyEqKi^#
zw2h}WRnaA1afGAOlHD{#w>&wTWXh6{(Dp_yXG)eiTq(lUJhpB-zboEz6%13cl)Yy7ww&*3ZGIkJ6J*-e5p$7oQAbCe
z!w!DFc{}jzhxS8XK<-KRLZ3r>a2<78sSaE%&u-c&a<_X8NZr5NQR~UicHQw#xpvo^
z`WSIe5T2x28Y4RaItiMi!Wf?pj(iGqnhN7H#CbEG1D&VB_yTcG<|WW&DvYn-Zf^yf
zR;H#~E-wCykDK!^Pe<&|iUt4xYr{V4
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileCombinedWithBatchIds/tile.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileCombinedWithBatchIds/tile.vctr
index 6ad7c23e0d827f38ba0a82544226c83e71ab8191..e3ae54bf24d80b7b0a39919c37e92d53cb02535a 100644
GIT binary patch
literal 331
zcmV-R0kr-fiwFP!000003yo22O2a@9oz&uQ5d;1#`#Y6Q^I_6IwYDKyNH)@Jq#_bf
z+5>11rIg;oQ+Na~;c09WCr!1n*5Z4-WqA8$7?{Vq^j-phmm0t;7Kd2Zp~Nxj0QH30
zM@>k;I1Az+@f_xQg0!0|r3wkU!yoR_95_AE<*x6L_H~nN
zef3l~w3gj6RNL0EFqJ>z+tW7+xd{C$H{?;`JKPl>Zt(3Ty)fpu(}dhUr=xH@ei)^s
zO{ePs<9%niJ*HP;=UvhB64sA4LuzZ4@)>u2tx%ZThg+4l9n;Gl7#AC((b>^uPN$7V
zeRa1ZR1JzNPtbi!@zk&fYe>ug5+Vke=O20T7WEf|e2Eltr41rEMn>{HUvzThqEr3N
dI&fA{TFsUqo58;@c+Y0p>=OncMTD9H000b5oKpY*
literal 710
zcmV;%0y+I3iwFP!000003#C;%Y|~H_eQi?$P56JuDtx3$DRLYqwY!8Qc4JG49mTFx
zs2~#1PKbdPL={D0V(7rc05hl?I|Ea3)mAN)SP?7Ch@q-zoAloJC3%h$GxS*}x;Z}g
z_`Dn2dGToR*#IGACrHTWAwu53mjH3rHNZK*OTY<0B~s9ItuS3EtBRIWt;pnfjN_t_
zLVCu|e>Z37W;w6uIZK5wZLXX(rgczNA`h1q=ZyLJg}FuOsdfaK
zE-N#=WdbA1q^+!4)?~9=6z6#=%WJyg$$(^UcadrHvv*Qxy4B?kj9*(4+6s!Px+5V&
zw`@#JnTqAHm2?nzL}GYdgz>-}8CYISrp
zK%d`B^trwPc>Cc&7D0##c$Ffa)t`gDuWJ({^3R1|UywV7Pqy3Vn3?RB*D><6J%TW`
zVR#!3kwJp*$UpVJPj_pC%$;(&o&&DKi2>@;faO%1W5@@7Y>pwf@!k3U1p0Ps75GI6
zI1=#fEc8H*k2^SM>^Jc9-TRJaJG>p<0kFxp!r#JMa2zxaQw=x{UAwEN$erfVVQSvp
z_gasC*K3Y;kfv)T#MHyYxufvT3ep<6lK>pf2nE(507gCyI75N;S>pV=oCjQ>!1^L_
z?$pbGD->8?#ogWtty$u-{4uzmncZKpvEF;Vo}s+W@HXSwyWrmmi_tXyy88Hd1_b+ix&+7jxca$=cqmyJB8w_nRVyV`mZbWpr4^@^0JYTCDkvN^
s=W+pI28Lfi++dICYusYCYTQSFdXG4Hy6pvtRRhff0Bwu)z)%4I09UwBtXy1_yY!2Dt{u`?&hKhj=Ji8N!8>tg4lgDoaxR)6$AlOMr@NYmb_90lnH_
ikLgR?Vzz4BEtXyI{8Pq2FLrj`niXAC|Mao1(d9+m69q;QvK7?ic?E~3TtbRns>Q?FayIc
YAa1b7^eORT)wK!=0PTtXyI{8Pq2FLrj`niXAC|Mao1(d9+m69q;QvK7?ic?E~3TtbRnsd2;FayIc
kAa1b7^eJvJTQ%+@AiYkWZhJvu)wK!=00U!X0Ym`+0M6n{ga7~l
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAll/ur.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAll/ur.vctr
deleted file mode 100644
index 6095c26f2e8577f1cdf8dcc8af21df0ab1c54f9f..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 226
zcmV<803H7yiwFP!000003oA=5DPm+`V3+_TE`VqtW?{e%s+D{_{XBg`ed9e`J>5M*
zl&lPNlzbf{(1n6rokJY`+Lb8!s{j`wl(a}V)QvNA*xRI;j8N~$bL^-oJHPAvgysI5I}&gH_u
z@C%3=>@j_dTg+CC+XbZ8$eoj%TpW_mR+zyZ3zm-qk!004};c`E<_
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAllBatchedChildren/parent.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAllBatchedChildren/parent.vctr
deleted file mode 100644
index 337e9867827f7455ecf07e3e450642ee2ec18b37..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 170
zcmV;b09F4ViwFP!000003oA=5DPm+`U~mBvCxEmM5VJ5~2h~cxo_?Obp}z4RuAc55
zAxc&TI!eBd5$HleuFfHje(pZ5N>tXyI{8Pq2FLrj`niXAC|Mao1(d9+m69q;QvK7?ic?E~3TtbRns>Q?FayIc
YAa1b7^eORT)wK!=0PT@lS
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAllBatchedChildrenWithBatchTable/parent.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAllBatchedChildrenWithBatchTable/parent.vctr
deleted file mode 100644
index 337e9867827f7455ecf07e3e450642ee2ec18b37..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 170
zcmV;b09F4ViwFP!000003oA=5DPm+`U~mBvCxEmM5VJ5~2h~cxo_?Obp}z4RuAc55
zAxc&TI!eBd5$HleuFfHje(pZ5N>tXyI{8Pq2FLrj`niXAC|Mao1(d9+m69q;QvK7?ic?E~3TtbRns>Q?FayIc
YAa1b7^eORT)wK!=0PT0|P^I6H{X&OCwW5OG^_V!%PR4I7z~>
zI!bQ-LB5UacbJd~^qp#n-))k;Z~C8_>tX~n4}K!vqniFhZ+5ND5g
zPZtaYKns9MoFjca{ajpwPz;0%qU$j?L(+oJXcM41S05kGfM9>1JhIscQFL8~CKkxL
z@EH$sMsR?KYY=KcK!q^W8=1h><1^KwwpQV&IhP9vGcf!D;s$%n)PY;fR*m}zNUxKp
z+g^|u1?IS*n?s?Sj-a}UEcd|8U|?WmU}9iq_zwgPlHWCzfqCi0Qf@5}U2y0Rn2!!%
e@?a?ih6aNp5Os_U)wK!=3=9AOE3o{a0{{T>QG~_-
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAllWithBatchIds/parent.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAllWithBatchIds/parent.vctr
deleted file mode 100644
index 6a89304002b37741d7b8fb5a727e68a2eb6eec25..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 190
zcmV;v073sBiwFP!000003oA=5DPm+`V8{UyZ-BHP5VJ5~2h~cxo_?Obp}z4RuAc55
zAxc&TI!eBd5$HleuFfHje(pZ5N>tXyI{8Pq2FLrj`niXAC|Mao1(d9+m69q;QvK7?ic?E~3Twd<@lK8*&K~ie
sE*J{T&1!2E6posAxqvVO!!ICiu*VDyQpBo(CjQX`0LP5{I&1*|0L-^g*8l(j
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAllWithBatchIds/tileset.json b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAllWithBatchIds/tileset.json
deleted file mode 100644
index f0f4990724f9..000000000000
--- a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAllWithBatchIds/tileset.json
+++ /dev/null
@@ -1,59 +0,0 @@
-{
- "asset": {
- "version": "0.0"
- },
- "geometricError": 500,
- "root": {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "transform": [
- 0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- 1,
- 0,
- 0,
- 0,
- 6378137,
- 0,
- 0,
- 1
- ],
- "geometricError": 100,
- "refine": "REPLACE",
- "content": {
- "url": "parent.vctr"
- },
- "children": [
- {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "children.vctr"
- }
- }
- ]
- }
-}
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAllWithBatchTable/ll.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAllWithBatchTable/ll.vctr
deleted file mode 100644
index 36088beac50de66e593d2cda742861a7b1aac22d..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 190
zcmV;v073sBiwFP!000003oA=5DPm+`UtXyy88Hd1_b+ix&+7jxca$=cqmyJB8w_nRVyV`mZbWpr4^@^0JYTCDkvN^
s=W+pI28Lfi++dICYusYCYTQSFdXG4Hy6pvtRRhff0Bwu)z)%4I09UwBtXy1_yY!2Dt{u`?&hKhj=Ji8N!8>tg4lgDoaxR)6$AlOMr@NYmb_90lnH_
ikLgR?Vzz4BEtXyI{8Pq2FLrj`niXAC|Mao1(d9+m69q;QvK7?ic?E~3TtbRns>Q?FayIc
YAa1b7^eORT)wK!=0PTtXyI{8Pq2FLrj`niXAC|Mao1(d9+m69q;QvK7?ic?E~3TtbRnsd2;FayIc
kAa1b7^eJvJTQ%+@AiYkWZhJvu)wK!=00U!X0Ym`+0M6n{ga7~l
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAllWithBatchTable/ur.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryAllWithBatchTable/ur.vctr
deleted file mode 100644
index 5f674ac995478519340e938f080efc43a59755f9..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 254
zcmV5M*
zl&lPNlzbf{(1n6rokJY`+Lb8!s{j`wl(a}V)QvNA*xRI;j8N~$bL^-oJHPAvgysI5I}&gH_u
z@C%3=>@j_dTg+CC+XbZ8$;0LPo>AnDx
zRB()UjB|`}jCPE4jEIkmj*5)%?7s9e{KxtXyI{8Pq2FLrj`niXAC|Mao1(d9+m69q;QvK7?ic?E~3TtbRnsd2;FayIc
lAa1b7^eJvJTQ%+@K)pwtJl*z!#Hwo*6aW-P51~W>001w^OhNzv
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxes/lr.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxes/lr.vctr
deleted file mode 100644
index df5236bd4e448de863565870a229d40d4dff82c2..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 182
zcmV;n07?HJiwFP!000003oA=5DPm+`U~mBvCxEmM5VJ5~2h~cxo_?Obp}z4RuAc55
zAxc&TI!eBd5$HleuFfHje(pZ5N>tXyI{8Pq2FLrj`niXAC|Mao1(d9+m69q;QvK7?ic?E~3TtbRnsd2;FayIc
kAa1b7^eJvJTQzQw-Xl()ZhJvu)wK!=0Q`-E8$tXyI{8Pq2FLrj`niXAC|Mao1(d9+m69q;QvK7?ic?E~3TtbRns>Q?FayIc
YAa1b7^eORT)wK!=0PTtXyI{8Pq2FLrj`niXAC|Mao1(d9+m69q;QvK7?ic?E~3TtbRnsd2;FayIc
kAa1b7^eJvJTQ%+@AiYkWZhJvu)wK!=00U!X0Ym`+0M6n{ga7~l
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxes/ur.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxes/ur.vctr
deleted file mode 100644
index 466d55cc2b7d0e3f605ecf59899b36259bc848bd..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 181
zcmV;m080NKiwFP!000003oA=5DPm+`U~mBvCxEmM5VJ5~2h~cxo_?Obp}z4RuAc55
zAxc&TI!eBd5$HleuFfHje(pZ5N>tXyI{8Pq2FLrj`niXAC|Mao1(d9+m69q;QvK7?ic?E~3TtbRnsd2;FayIc
jAa1b7^eJvJTQzR5UMEkty&$pbS_K6F>!|6wL;(N*kP%F9
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesBatchedChildren/children.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesBatchedChildren/children.vctr
deleted file mode 100644
index ecc818cab929f4a23b3e40117c75a999879d5fa5..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 198
zcmV;%06G63iwFP!000003oA=5DPm+`V9;PK&N-ow??
z-6KTF%0NfS*D(TJD9F`0#L>^)$5qKHTGv3&z`(%J+{Dz_$kNEv(9+Tb$S~8vB~FrX
ztd5eKe~_;u#9Al+2-o0vA6Gy35Dz6Q6R3caRkc!5Wl5@kT3T^x2~c5e?NM_s7Z7G(
z_yxob_Lx4!EoQ66eFUV}$OV
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesBatchedChildren/parent.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesBatchedChildren/parent.vctr
deleted file mode 100644
index 337e9867827f7455ecf07e3e450642ee2ec18b37..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 170
zcmV;b09F4ViwFP!000003oA=5DPm+`U~mBvCxEmM5VJ5~2h~cxo_?Obp}z4RuAc55
zAxc&TI!eBd5$HleuFfHje(pZ5N>tXyI{8Pq2FLrj`niXAC|Mao1(d9+m69q;QvK7?ic?E~3TtbRns>Q?FayIc
YAa1b7^eORT)wK!=0PTK&N-ow??
z-6KTF%0NfS*D(TJD9F`0#L>^)$5qKHTGv3&z`(%J+{Dz_$kNEv(9+Tb$S~8vB~FrX
ztd5eKe~_;u#9Al+2-o0vA6Gy35Dz6Q6R3caRkc!5Wl5@kT3T^x2~c5e?NM_s7Z7G(
z_yxob_Lx4!EoQ66eFUV}$OV
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesBatchedChildrenWithBatchTable/parent.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesBatchedChildrenWithBatchTable/parent.vctr
deleted file mode 100644
index 337e9867827f7455ecf07e3e450642ee2ec18b37..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 170
zcmV;b09F4ViwFP!000003oA=5DPm+`U~mBvCxEmM5VJ5~2h~cxo_?Obp}z4RuAc55
zAxc&TI!eBd5$HleuFfHje(pZ5N>tXyI{8Pq2FLrj`niXAC|Mao1(d9+m69q;QvK7?ic?E~3TtbRns>Q?FayIc
YAa1b7^eORT)wK!=0PTK&N-ow??
z-6KTF%0NfS*D(TJD9F`0#L>^)$5qKHTGv3&z`(%J+{Dz_$kNEv(9+Tb$S~8vB~FrX
ztd5eKe~_;u#9Al+2-o0vA6Gy35Dz6Q6R3caRkc!5Wl5@kT3T^x2~c4zSR&rZF~r#;
z-qQs`fw6%}ZLPvlb1oMUW?=XQ#0~bCp@Cb>R*m}zNUxKp+g^|ug=V=>(JYX=j!@BE
aaI+W~7#Wxtm>H^T6%+sfUNARQ0ssJ-E@gNC
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesWithBatchIds/parent.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesWithBatchIds/parent.vctr
deleted file mode 100644
index 8f64dbc8d57d92766affd5798447771555f6cdee..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 190
zcmV;v073sBiwFP!000003oA=5DPm+`V8{UyZ-BHP5VJ5~2h~cxo_?Obp}z4RuAc55
zAxc&TI!eBd5$HleuFfHje(pZ5N>tXyI{8Pq2FLrj`niXAC|Mao1(d9+m69q;QvK7?ic?E~3Twd<@lK8*&K~ie
sE*J{T&1!2E6posAxqvVO!!ICiu*VDyQpBo(CjQn0000`jb!-6u0K-L3p8x;=
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesWithBatchIds/tileset.json b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesWithBatchIds/tileset.json
deleted file mode 100644
index f0f4990724f9..000000000000
--- a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesWithBatchIds/tileset.json
+++ /dev/null
@@ -1,59 +0,0 @@
-{
- "asset": {
- "version": "0.0"
- },
- "geometricError": 500,
- "root": {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "transform": [
- 0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- 1,
- 0,
- 0,
- 0,
- 6378137,
- 0,
- 0,
- 1
- ],
- "geometricError": 100,
- "refine": "REPLACE",
- "content": {
- "url": "parent.vctr"
- },
- "children": [
- {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "children.vctr"
- }
- }
- ]
- }
-}
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesWithBatchTable/ll.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesWithBatchTable/ll.vctr
deleted file mode 100644
index 9cb69aa7dcc04b49ef66d6981acffc69af366f6d..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 183
zcmV;o07(BIiwFP!000003oA=5DPm+`U~mBvCxEmM5VJ5~2h~cxo_?Obp}z4RuAc55
zAxc&TI!eBd5$HleuFfHje(pZ5N>tXyI{8Pq2FLrj`niXAC|Mao1(d9+m69q;QvK7?ic?E~3TtbRnsd2;FayIc
lAa1b7^eJvJTQ%+@K)pwtJl*z!#Hwo*6aW-P51~W>001w^OhNzv
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesWithBatchTable/lr.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesWithBatchTable/lr.vctr
deleted file mode 100644
index df5236bd4e448de863565870a229d40d4dff82c2..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 182
zcmV;n07?HJiwFP!000003oA=5DPm+`U~mBvCxEmM5VJ5~2h~cxo_?Obp}z4RuAc55
zAxc&TI!eBd5$HleuFfHje(pZ5N>tXyI{8Pq2FLrj`niXAC|Mao1(d9+m69q;QvK7?ic?E~3TtbRnsd2;FayIc
kAa1b7^eJvJTQzQw-Xl()ZhJvu)wK!=0Q`-E8$tXyI{8Pq2FLrj`niXAC|Mao1(d9+m69q;QvK7?ic?E~3TtbRns>Q?FayIc
YAa1b7^eORT)wK!=0PTtXyI{8Pq2FLrj`niXAC|Mao1(d9+m69q;QvK7?ic?E~3TtbRnsd2;FayIc
kAa1b7^eJvJTQ%+@AiYkWZhJvu)wK!=00U!X0Ym`+0M6n{ga7~l
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesWithBatchTable/ur.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesWithBatchTable/ur.vctr
deleted file mode 100644
index 466d55cc2b7d0e3f605ecf59899b36259bc848bd..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 181
zcmV;m080NKiwFP!000003oA=5DPm+`U~mBvCxEmM5VJ5~2h~cxo_?Obp}z4RuAc55
zAxc&TI!eBd5$HleuFfHje(pZ5N>tXyI{8Pq2FLrj`niXAC|Mao1(d9+m69q;QvK7?ic?E~3TtbRnsd2;FayIc
jAa1b7^eJvJTQzR5UMEkty&$pbS_K6F>!|6wL;(N*kP%F9
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylinders/ll.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylinders/ll.vctr
deleted file mode 100644
index 1c1101a5341ca51f8784c9fa2b40aab190086151..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 216
zcmV;}04M(+iwFP!000003oA=5DPm+`V3+_TE`VqtW?{e%s+D{_{XBg`ed9e`J>5M*
zl&lPNlzbf{(1n6rokJY`+Lb8!s{j`wl(a}V)QvNA*xRI;j8N~$bL^-oJHPAvgysI5I}&gH_u
z@C%3=>@j_dTg+CC`v_3)5hqW#y&$m%>uzW&1H*5}%k`@yKnm)fX#R%+96^Z!DjJ`F
S^;g#_C;$LBO)%w<0RRB~$XLq&
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylinders/lr.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylinders/lr.vctr
deleted file mode 100644
index 7aaa234723b0c2da5933cd44d9661b8138741f4f..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 222
zcmV<403rV$iwFP!000003oA=5DPm+`V3+_TE`VqtW?{e%s+D{_{XBg`ed9e`J>5M*
zl&lPNlzbf{(1n6rokJY`+Lb8!s{j`wl(a}V)QvNA*xRI;j8N~$bL^-oJHPAvgysI5I}&gH_u
z@C%3=>@j_dTg+CC+Xblih?A$=UXa*?wkMj(!0R`3+FIx>i8}06(J<(~toG0M(dZO8@`>
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylinders/parent.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylinders/parent.vctr
deleted file mode 100644
index 5ad2375c2ed15a4b365d1d5f4ab3c39214df97b8..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 204
zcmV;-05ks|iwFP!000003oA=5DPm+`V3+_TE`VqtW?{e%s+D{_{XBg`ed9e`J>5M*
zl&lPNlzbf{(1n6rokJY`+Lb8!s{j`wl(a}V)QvNA*xRI;j8N~$bL^-oJHPAvgysI5I}-sQr;
z@C%3=>@j^yy4ZgpK$cNB_Eb|D7_I?OT5i3CElAwp1cV=P8A3Z;h0xWt3JL(O<($co
G0RRA{lT&yA
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylinders/tileset.json b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylinders/tileset.json
deleted file mode 100644
index d56ec9205342..000000000000
--- a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylinders/tileset.json
+++ /dev/null
@@ -1,107 +0,0 @@
-{
- "asset": {
- "version": "0.0"
- },
- "geometricError": 500,
- "root": {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "transform": [
- 0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- 1,
- 0,
- 0,
- 0,
- 6378137,
- 0,
- 0,
- 1
- ],
- "geometricError": 100,
- "refine": "REPLACE",
- "content": {
- "url": "parent.vctr"
- },
- "children": [
- {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- 0,
- 0,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "ul.vctr"
- }
- },
- {
- "boundingVolume": {
- "region": [
- 0,
- 0,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "ur.vctr"
- }
- },
- {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0,
- 0,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "ll.vctr"
- }
- },
- {
- "boundingVolume": {
- "region": [
- 0,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "lr.vctr"
- }
- }
- ]
- }
-}
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylinders/ul.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylinders/ul.vctr
deleted file mode 100644
index 9d9fe9c88abd21f57cd229652ba92cb0bb41478c..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 224
zcmV<603ZJ!iwFP!000003oA=5DPm+`V3+_TE`VqtW?{e%s+D{_{XBg`ed9e`J>5M*
zl&lPNlzbf{(1n6rokJY`+Lb8!s{j`wl(a}V)QvNA*xRI;j8N~$bL^-oJHPAvgysI5I}&gH_u
z@C%3=>@j_dTg+CC`v^#{lc(EWkl249Kvo3`KakjuD^E3*86j+t_=Ufp^1jtGFa(G~
a)Hy=cYcm}<4-Vg21qA?Uzu6#=0RRB#$6OZx
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylinders/ur.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylinders/ur.vctr
deleted file mode 100644
index 3b6a1d1c1552dcfc856a611f10dc10a3df934e9c..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 218
zcmV<0044t)iwFP!000003oA=5DPm+`V3+_TE`VqtW?{e%s+D{_{XBg`ed9e`J>5M*
zl&lPNlzbf{(1n6rokJY`+Lb8!s{j`wl(a}V)QvNA*xRI;j8N~$bL^-oJHPAvgysI5I}&gH_u
z@C%3=>@j_dTg+CC+XbZ8$6HR4cxN<<{cf4G`N&?Nq
U|4;x9-&zF)009$cosa9!XnMu9mlR5AzTo+DIp58NE|bTGsFkESv(u?Rr<
z5kuK%h(Vi
xxR43K2dU2jrtgTwzrp4Qti1uI;pU(Fu8C|eA@Bq0&gxnP1pv}Lfb2j6003zWeRBW+
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersBatchedChildren/parent.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersBatchedChildren/parent.vctr
deleted file mode 100644
index 8bed33a680de66f321b88f7d9d1651bc880120ad..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 224
zcmV<603ZJ!iwFP!000003oA=5DPm+`V3+_TE`VqtW?{e%s+D{_{XBg`ed9e`J>5M*
zl&lPNlzbf{(1n6rokJY`+Lb8!s{j`wl(a}V)QvNA*xRI;j8N~$bL^-oJHPAvgysI5I}-sQr;
z@C%3=>@j^yyx5N)2h^2;;RgywMrinf@WZ+g!G%l=43U8e%Db2u7&s%t*O~#vXSn>)
a1gQrB5S@?=;aArxC;$MF2qkBb0RRB!3tQ6w
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersBatchedChildren/tileset.json b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersBatchedChildren/tileset.json
deleted file mode 100644
index f0f4990724f9..000000000000
--- a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersBatchedChildren/tileset.json
+++ /dev/null
@@ -1,59 +0,0 @@
-{
- "asset": {
- "version": "0.0"
- },
- "geometricError": 500,
- "root": {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "transform": [
- 0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- 1,
- 0,
- 0,
- 0,
- 6378137,
- 0,
- 0,
- 1
- ],
- "geometricError": 100,
- "refine": "REPLACE",
- "content": {
- "url": "parent.vctr"
- },
- "children": [
- {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "children.vctr"
- }
- }
- ]
- }
-}
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersBatchedChildrenWithBatchTable/children.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersBatchedChildrenWithBatchTable/children.vctr
deleted file mode 100644
index 7cc33366e99126db1007f934df9ad303cff94a12..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 348
zcmV-i0i*sOiwFP!000003oA=5DPm+`U~ph&V7LIHnHU&Y7_ftCC0|cJPv21Acn?=k
zcaIPyD+3)RU&jb^p&(c15Jx|EA6F%-Xk7z60|Ns?a}!fzBTFMwLrY5&Aj3=tmpDnn
zu{ug_{z1Nu5Nn+yeLVeKT!Vt+eO&$ALp+qMOppYXtg4lgDoaxR)6$AlOMn_`Ymb_9
zxiB#N0^$aHOyA-bvsL3h0@CZ`>9!XnMu9mlR5AzTo+DIp58RyZoD2-gz{D}*{%=hX
zy}|Qi-nV)NhW|hS;-9dC@Gk+?f#`sn5Oouvw7>%h%?h>U!@o~p^%7hVz99p|d`74|
z$XsMsv9dtKZd`$wBLmeJpOjhRmYJH90#zrG{1t4jM#~>fWb;6aM#F%>Lx?#b0MfStYHoF{f&u{SXys@?0{{SsxRX!-
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersBatchedChildrenWithBatchTable/parent.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersBatchedChildrenWithBatchTable/parent.vctr
deleted file mode 100644
index 2fc6aac498610f3e20713858a9807bc8a10874b6..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 210
zcmV;@04@I?iwFP!000003oA=5DPm+`V3+_TE`VqtW?{e%s+D{_{XBg`ed9e`J>5M*
zl&lPNlzbf{(1n6rokJY`+Lb8!s{j`wl(a}V)QvNA*xRI;j8N~$bL^-oJHPAvgysI5I}-sQr;
z@C%3=>@j^yyjX?U=e%$AK-O+`F#Y59Z%t)jcyd5hSo}Yr4&v{)0}+RX?+rA5b*+K|
M0BgmrUXTF*09aO8+yDRo
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersBatchedChildrenWithBatchTable/tileset.json b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersBatchedChildrenWithBatchTable/tileset.json
deleted file mode 100644
index f0f4990724f9..000000000000
--- a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersBatchedChildrenWithBatchTable/tileset.json
+++ /dev/null
@@ -1,59 +0,0 @@
-{
- "asset": {
- "version": "0.0"
- },
- "geometricError": 500,
- "root": {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "transform": [
- 0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- 1,
- 0,
- 0,
- 0,
- 6378137,
- 0,
- 0,
- 1
- ],
- "geometricError": 100,
- "refine": "REPLACE",
- "content": {
- "url": "parent.vctr"
- },
- "children": [
- {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "children.vctr"
- }
- }
- ]
- }
-}
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersWithBatchIds/children.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersWithBatchIds/children.vctr
deleted file mode 100644
index 3c2aa315dbe214d281dbc6e210901046f6629572..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 356
zcmV-q0h|6GiwFP!000003oA=5DPm+`V8~!*VE6%~9hevxSQxN_Y9(J!KTqFK-*^vK
zPj`JPfYm4je9Ze+58;CV&;bmoC7H<)
zvzfF&>R>bjLwZqSK}KfA9*BMr0O|X%8NmmE6J7}OK;}C_)xngYyNhGi5p|H*i`@`&
z44~%2)PMN*32a^%&^(ZM08|{Cc_4Wfs945+h&f5D5c@UuLip9S3JL&$nus!J0{{Tq
CHL^d8krheTABbEW;(dUNfM6L
zQF8MS@^yq*>m2Fh>F44a6ddp4>gOKfp=4!5M*
zl&lPNlzbf{(1n6rokJY`+Lb8!s{j`wl(a}V)QvNA*xRI;j8N~$bL^-oJHPAvgysI5I}&gH_u
z@C%3=>@j_dTg+CC`v_3)5hqW#y&$m(LLc(J)iW?iBkO2SyGTm1N
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersWithBatchTable/lr.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersWithBatchTable/lr.vctr
deleted file mode 100644
index 959ac34dbafcde379ebcce27642f445c5f966cd4..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 218
zcmV<0044t)iwFP!000003oA=5DPm+`V3+_TE`VqtW?{e%s+D{_{XBg`ed9e`J>5M*
zl&lPNlzbf{(1n6rokJY`+Lb8!s{j`wl(a}V)QvNA*xRI;j8N~$bL^-oJHPAvgysI5I}&gH_u
z@C%3=>@j_dTg+CC+Xblih?A$=UXWNq`5#SXVEFN$g{V4E3gL5>XDjbw2J$(7gZb#-
U15_V8d}|dH07H%6OppNp04dB|x&QzG
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersWithBatchTable/parent.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersWithBatchTable/parent.vctr
deleted file mode 100644
index 496e9d12f24d4c585e71f099560e8fa9ed7e1f2f..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 202
zcmV;*05$&~iwFP!000003oA=5DPm+`V3+_TE`VqtW?{e%s+D{_{XBg`ed9e`J>5M*
zl&lPNlzbf{(1n6rokJY`+Lb8!s{j`wl(a}V)QvNA*xRI;j8N~$bL^-oJHPAvgysI5I}-sQr;
z@C%3=>@j^yyqG}tA5CRo_KPac3?b^KgGCV5M*
zl&lPNlzbf{(1n6rokJY`+Lb8!s{j`wl(a}V)QvNA*xRI;j8N~$bL^-oJHPAvgysI5I}&gH_u
z@C%3=>@j_dTg+CC`v^#{lc(EWWOWmSKIDC?XJA;7@<&q{7@l*$qKr5~69^n2R7Vy>
ReRZvZ0sv5M*
zl&lPNlzbf{(1n6rokJY`+Lb8!s{j`wl(a}V)QvNA*xRI;j8N~$bL^-oJHPAvgysI5I}&gH_u
z@C%3=>@j_dTg+CC+XbZ8$g6IGf2;Jcfp>McC=!9Sh
X%@GDw7Y?DTYZVj#qmj(tkO2Syt|VHn
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoids/ll.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoids/ll.vctr
deleted file mode 100644
index 36088beac50de66e593d2cda742861a7b1aac22d..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 190
zcmV;v073sBiwFP!000003oA=5DPm+`UtXyy88Hd1_b+ix&+7jxca$=cqmyJB8w_nRVyV`mZbWpr4^@^0JYTCDkvN^
s=W+pI28Lfi++dICYusYCYTQSFdXG4Hy6pvtRRhff0Bwu)z)%4I09UwBtXyy88Hd1_b+ix&+7jxca$=cqmyJB8w_nRVyV`mZbWpr4^@^0JYTCDkvN^
r=W+pI28Lfi++dICYusYCYTO{bN1Qy}_JYK!f#v}Kg+O_FPyqk{7bHtXyy88Hd1_b+ix&+7jxca$=cqmyJB8w_nRVyV`mZbWpr4^@^0JYTCDkvN^
f?{WcQ28Lfi++dICYvRSKf#v}KltKkgPyqk{N^D9B
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoids/tileset.json b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoids/tileset.json
deleted file mode 100644
index d56ec9205342..000000000000
--- a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoids/tileset.json
+++ /dev/null
@@ -1,107 +0,0 @@
-{
- "asset": {
- "version": "0.0"
- },
- "geometricError": 500,
- "root": {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "transform": [
- 0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- 1,
- 0,
- 0,
- 0,
- 6378137,
- 0,
- 0,
- 1
- ],
- "geometricError": 100,
- "refine": "REPLACE",
- "content": {
- "url": "parent.vctr"
- },
- "children": [
- {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- 0,
- 0,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "ul.vctr"
- }
- },
- {
- "boundingVolume": {
- "region": [
- 0,
- 0,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "ur.vctr"
- }
- },
- {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0,
- 0,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "ll.vctr"
- }
- },
- {
- "boundingVolume": {
- "region": [
- 0,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "lr.vctr"
- }
- }
- ]
- }
-}
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoids/ul.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoids/ul.vctr
deleted file mode 100644
index 28b9b7939c57843800f21af9019149a5dabbdeeb..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 189
zcmV;u07CyCiwFP!000003oA=5DPm+`UtXyy88Hd1_b+ix&+7jxca$=cqmyJB8w_nRVyV`mZbWpr4^@^0JYTCDkvN^
r=W+pI28Lfi++dICYusYCYTQRadYwGo_JYK!f#v}Kdaj>fPyqk{7g$k-
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoids/ur.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoids/ur.vctr
deleted file mode 100644
index 5651216104327ca8e62ccbe4b4682369bfed0f56..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 187
zcmV;s07U;EiwFP!000003oA=5DPm+`UtXyy88Hd1_b+ix&+7jxca$=cqmyJB8w_nRVyV`mZbWpr4^@^0JYTCDkvN^
p=W+pI28Lfi++dICYusYCYTRJGPM&UiL1NWF^8k`%6WUM#003#MPulK&N-ow??
z-6KTF%0NfS*D(TJD9F`0#L>^)$5qKHTGv3&z`(%J+{Dz_$kNEv(9+Tb$S~8vB~FrX
ztd5eKe~_;u#9CJ$AJ2ebe@~a-cpq0k_Ye;yD-&coJP|+-qyN*!NU2wCifnf#!Ch~tT
HGy(ts^#@{b
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsBatchedChildren/parent.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsBatchedChildren/parent.vctr
deleted file mode 100644
index 0d8ed32a2023faac70840b4bd34acc059e9ebda4..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 177
zcmV;i08alOiwFP!000003oA=5DPm+`UtXyy88Hd1_b+ix&+7jxca$=cqmyJB8w_nRVyV`mZbWpr4^@^0JYTCDkvN^
f?{WcQ28Lfi++dICYvRSKf#v}KltKkgPyqk{N^D9B
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsBatchedChildren/tileset.json b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsBatchedChildren/tileset.json
deleted file mode 100644
index f0f4990724f9..000000000000
--- a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsBatchedChildren/tileset.json
+++ /dev/null
@@ -1,59 +0,0 @@
-{
- "asset": {
- "version": "0.0"
- },
- "geometricError": 500,
- "root": {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "transform": [
- 0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- 1,
- 0,
- 0,
- 0,
- 6378137,
- 0,
- 0,
- 1
- ],
- "geometricError": 100,
- "refine": "REPLACE",
- "content": {
- "url": "parent.vctr"
- },
- "children": [
- {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "children.vctr"
- }
- }
- ]
- }
-}
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsBatchedChildrenWithBatchTable/children.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsBatchedChildrenWithBatchTable/children.vctr
deleted file mode 100644
index 2cf671ff0af4451c53c8f7e74a81943188b3686b..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 205
zcmV;;05bm{iwFP!000003oA=5DPm+`U@&1~V7LOL4S*aL2JE0($=B1*(>K&N-ow??
z-6KTF%0NfS*D(TJD9F`0#L>^)$5qKHTGv3&z`(%J+{Dz_$kNEv(9+Tb$S~8vB~FrX
ztd5eKe~_;u#9CJ$AJ2ebe@~a-cpq0k_Ye;yD-&coJP|+-qyN*!NU2wCifnf#!Ch~tT
HGy(ts^#@{b
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsBatchedChildrenWithBatchTable/parent.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsBatchedChildrenWithBatchTable/parent.vctr
deleted file mode 100644
index 0d8ed32a2023faac70840b4bd34acc059e9ebda4..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 177
zcmV;i08alOiwFP!000003oA=5DPm+`UtXyy88Hd1_b+ix&+7jxca$=cqmyJB8w_nRVyV`mZbWpr4^@^0JYTCDkvN^
f?{WcQ28Lfi++dICYvRSKf#v}KltKkgPyqk{N^D9B
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsBatchedChildrenWithBatchTable/tileset.json b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsBatchedChildrenWithBatchTable/tileset.json
deleted file mode 100644
index f0f4990724f9..000000000000
--- a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsBatchedChildrenWithBatchTable/tileset.json
+++ /dev/null
@@ -1,59 +0,0 @@
-{
- "asset": {
- "version": "0.0"
- },
- "geometricError": 500,
- "root": {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "transform": [
- 0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- 1,
- 0,
- 0,
- 0,
- 6378137,
- 0,
- 0,
- 1
- ],
- "geometricError": 100,
- "refine": "REPLACE",
- "content": {
- "url": "parent.vctr"
- },
- "children": [
- {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "children.vctr"
- }
- }
- ]
- }
-}
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsWithBatchIds/children.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsWithBatchIds/children.vctr
deleted file mode 100644
index 164eeaf9b1398535c8cbdee7149592353052290b..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 228
zcmVK&N-ow??
z-6KTF%0NfS*D(TJD9F`0#L>^)$5qKHTGv3&z`(%J+{Dz_$kNEv(9+Tb$S~8vB~FrX
ztd5eKe~_;u#9CJ$AJ2ebe@~a-cpq0k_Ye;yD-&c2E*)
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsWithBatchIds/parent.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsWithBatchIds/parent.vctr
deleted file mode 100644
index 01d1d4ab26431b2187cb92bfb67fd48a8884b664..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 193
zcmV;y06za8iwFP!000003oA=5DPm+`V5k8Se}J?f5VJ5~2h~cxo_?Obp}z4RuAc55
zAxc&TI!eBd5$HleuFfHje(pZ5N>tXyy88Hd1_b+ix&+7jxca$=cqmyJB8w_nRVyV`mZbWpr4^@^0JYR2$;LZ5
vhB$k~V^L;qR$Hr}aMZlZ1%w$GegScVJ!a^TB32DFk%0jKc(KxLd;tIe*Ar2c
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsWithBatchIds/tileset.json b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsWithBatchIds/tileset.json
deleted file mode 100644
index f0f4990724f9..000000000000
--- a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsWithBatchIds/tileset.json
+++ /dev/null
@@ -1,59 +0,0 @@
-{
- "asset": {
- "version": "0.0"
- },
- "geometricError": 500,
- "root": {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "transform": [
- 0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- 1,
- 0,
- 0,
- 0,
- 6378137,
- 0,
- 0,
- 1
- ],
- "geometricError": 100,
- "refine": "REPLACE",
- "content": {
- "url": "parent.vctr"
- },
- "children": [
- {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "children.vctr"
- }
- }
- ]
- }
-}
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsWithBatchTable/ll.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsWithBatchTable/ll.vctr
deleted file mode 100644
index 36088beac50de66e593d2cda742861a7b1aac22d..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 190
zcmV;v073sBiwFP!000003oA=5DPm+`UtXyy88Hd1_b+ix&+7jxca$=cqmyJB8w_nRVyV`mZbWpr4^@^0JYTCDkvN^
s=W+pI28Lfi++dICYusYCYTQSFdXG4Hy6pvtRRhff0Bwu)z)%4I09UwBtXyy88Hd1_b+ix&+7jxca$=cqmyJB8w_nRVyV`mZbWpr4^@^0JYTCDkvN^
r=W+pI28Lfi++dICYusYCYTO{bN1Qy}_JYK!f#v}Kg+O_FPyqk{7bHtXyy88Hd1_b+ix&+7jxca$=cqmyJB8w_nRVyV`mZbWpr4^@^0JYTCDkvN^
f?{WcQ28Lfi++dICYvRSKf#v}KltKkgPyqk{N^D9B
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsWithBatchTable/tileset.json b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsWithBatchTable/tileset.json
deleted file mode 100644
index d56ec9205342..000000000000
--- a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsWithBatchTable/tileset.json
+++ /dev/null
@@ -1,107 +0,0 @@
-{
- "asset": {
- "version": "0.0"
- },
- "geometricError": 500,
- "root": {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "transform": [
- 0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- 1,
- 0,
- 0,
- 0,
- 6378137,
- 0,
- 0,
- 1
- ],
- "geometricError": 100,
- "refine": "REPLACE",
- "content": {
- "url": "parent.vctr"
- },
- "children": [
- {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- 0,
- 0,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "ul.vctr"
- }
- },
- {
- "boundingVolume": {
- "region": [
- 0,
- 0,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "ur.vctr"
- }
- },
- {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0,
- 0,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "ll.vctr"
- }
- },
- {
- "boundingVolume": {
- "region": [
- 0,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "lr.vctr"
- }
- }
- ]
- }
-}
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsWithBatchTable/ul.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsWithBatchTable/ul.vctr
deleted file mode 100644
index 28b9b7939c57843800f21af9019149a5dabbdeeb..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 189
zcmV;u07CyCiwFP!000003oA=5DPm+`UtXyy88Hd1_b+ix&+7jxca$=cqmyJB8w_nRVyV`mZbWpr4^@^0JYTCDkvN^
r=W+pI28Lfi++dICYusYCYTQRadYwGo_JYK!f#v}Kdaj>fPyqk{7g$k-
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsWithBatchTable/ur.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsWithBatchTable/ur.vctr
deleted file mode 100644
index 5651216104327ca8e62ccbe4b4682369bfed0f56..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 187
zcmV;s07U;EiwFP!000003oA=5DPm+`UtXyy88Hd1_b+ix&+7jxca$=cqmyJB8w_nRVyV`mZbWpr4^@^0JYTCDkvN^
p=W+pI28Lfi++dICYusYCYTRJGPM&UiL1NWF^8k`%6WUM#003#MPultXy1_yY!2Dt{u`?&hKhj=Ji8N!8>tg4lgDoaxR)6$AlOMr@NYmb_90lnH_
jkLgR?Vzz4BM}Yc{IC;A51&LMHDkuN|tXy1_yY!2Dt{u`?&hKhj=Ji8N!8>tg4lgDoaxR)6$AlOMr@NYmb_90lnH_
ikLgR?Vzz4BEtXy1_yY!2Dt{u`?&hKhj=Ji8N!8>tg4lgDoaxR)6$AlOMr@NYmb_D0lnH_
VkLgR|#j0x+6acPq;9Ece005?YM}ztXy1_yY!2Dt{u`?&hKhj=Ji8N!8>tg4lgDoaxR)6$AlOMr@NYmb_90lnH_
hkLgR?Vzz4BM?m_VJl*z!#Hwo*6ae(1=>$Ll003ANPObm|
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheres/ur.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheres/ur.vctr
deleted file mode 100644
index fd203300ba9281b7e65fcb1a2acdd9f0508f757c..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 179
zcmV;k08IZMiwFP!000003oA=5DPm+`U~m8uXMnT|5VJ5~2h~cxo_?Obp}z4RuAc55
zAxc&TI!eBd5$HleuFfHje(pZ5N>tXy1_yY!2Dt{u`?&hKhj=Ji8N!8>tg4lgDoaxR)6$AlOMr@NYmb_90lnH_
hkLgR?Vzz4BE+BnQo^E?VV%4<@3IH5wWxhZG001vK&N-ow??
z-6KTF%0NfS*D(TJD9F`0#L>^)$5qKHTGv3&z`(%J+{Dz_$kNEv(9+Tb$S~8vB~FrX
ztd5eKe~_;u#MGj41qA@~aBa^F0ssK;30ZLf
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresBatchedChildren/parent.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresBatchedChildren/parent.vctr
deleted file mode 100644
index 6c1f1cbaf32e7ebb04ff185e90673e761716ff7c..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 167
zcmV;Y09gMYiwFP!000003oA=5DPm+`U~m8uXMnT|5VJ5~2h~cxo_?Obp}z4RuAc55
zAxc&TI!eBd5$HleuFfHje(pZ5N>tXy1_yY!2Dt{u`?&hKhj=Ji8N!8>tg4lgDoaxR)6$AlOMr@NYmb_D0lnH_
VkLgR|#j0x+6acPq;9Ece005?YM}zK&N-ow??
z-6KTF%0NfS*D(TJD9F`0#L>^)$5qKHTGv3&z`(%J+{Dz_$kNEv(9+Tb$S~8vB~FrX
ztd5eKe~_;u#MGj41qA@~aBa^F0ssK;30ZLf
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresBatchedChildrenWithBatchTable/parent.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresBatchedChildrenWithBatchTable/parent.vctr
deleted file mode 100644
index 6c1f1cbaf32e7ebb04ff185e90673e761716ff7c..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 167
zcmV;Y09gMYiwFP!000003oA=5DPm+`U~m8uXMnT|5VJ5~2h~cxo_?Obp}z4RuAc55
zAxc&TI!eBd5$HleuFfHje(pZ5N>tXy1_yY!2Dt{u`?&hKhj=Ji8N!8>tg4lgDoaxR)6$AlOMr@NYmb_D0lnH_
VkLgR|#j0x+6acPq;9Ece005?YM}zK&N-ow??
z-6KTF%0NfS*D(TJD9F`0#L>^)$5qKHTGv3&z`(%J+{Dz_$kNEv(9+Tb$S~8vB~FrX
ztd5eKe~_;u#MtXy1_yY!2Dt{u`?&hKhj=Ji8N!8>tg4lgDoaxR)6$AlOMr@NVN&rw-
r@t!UiYRoKZYZVj}j+%G5FfcUOV}=GPV%0#S{%8UKC+2W*YykiOO)gI^
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresWithBatchIds/tileset.json b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresWithBatchIds/tileset.json
deleted file mode 100644
index f0f4990724f9..000000000000
--- a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresWithBatchIds/tileset.json
+++ /dev/null
@@ -1,59 +0,0 @@
-{
- "asset": {
- "version": "0.0"
- },
- "geometricError": 500,
- "root": {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "transform": [
- 0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- 1,
- 0,
- 0,
- 0,
- 6378137,
- 0,
- 0,
- 1
- ],
- "geometricError": 100,
- "refine": "REPLACE",
- "content": {
- "url": "parent.vctr"
- },
- "children": [
- {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "children.vctr"
- }
- }
- ]
- }
-}
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresWithBatchTable/ll.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresWithBatchTable/ll.vctr
deleted file mode 100644
index 5042566a43b3c3950d11640dbc251b6d4a93ffe4..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 181
zcmV;m080NKiwFP!000003oA=5DPm+`U~m8uXMnT|5VJ5~2h~cxo_?Obp}z4RuAc55
zAxc&TI!eBd5$HleuFfHje(pZ5N>tXy1_yY!2Dt{u`?&hKhj=Ji8N!8>tg4lgDoaxR)6$AlOMr@NYmb_90lnH_
jkLgR?Vzz4BM}Yc{IC;A51&LMHDkuN|tXy1_yY!2Dt{u`?&hKhj=Ji8N!8>tg4lgDoaxR)6$AlOMr@NYmb_90lnH_
ikLgR?Vzz4BEtXy1_yY!2Dt{u`?&hKhj=Ji8N!8>tg4lgDoaxR)6$AlOMr@NYmb_D0lnH_
VkLgR|#j0x+6acPq;9Ece005?YM}ztXy1_yY!2Dt{u`?&hKhj=Ji8N!8>tg4lgDoaxR)6$AlOMr@NYmb_90lnH_
hkLgR?Vzz4BM?m_VJl*z!#Hwo*6ae(1=>$Ll003ANPObm|
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresWithBatchTable/ur.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresWithBatchTable/ur.vctr
deleted file mode 100644
index fd203300ba9281b7e65fcb1a2acdd9f0508f757c..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 179
zcmV;k08IZMiwFP!000003oA=5DPm+`U~m8uXMnT|5VJ5~2h~cxo_?Obp}z4RuAc55
zAxc&TI!eBd5$HleuFfHje(pZ5N>tXy1_yY!2Dt{u`?&hKhj=Ji8N!8>tg4lgDoaxR)6$AlOMr@NYmb_90lnH_
hkLgR?Vzz4BE+BnQo^E?VV%4<@3IH5wWxhZG001vvzc6cOhGo=r%Q8XE)xYw8#dj)o
zqgLRENm%T&IBl}fOMGhUMUwLHignV+bz_#q)E?08bJmOc{l{Jg$MPSodejbomrPl@
zj$)qhC@gx^Hq0FNa)`Uh6$KsENGbyKSzsPm5PMw|jv4NH8CVgZuL5hpI%+EuOlK{{zsYLT)vECj^2G6Hr|z@k1qQ%KQ)RDX6WVn
h%V*2?m(Nbi%QKYkpO%l$IW3mF004HCohbkS
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileMesh/lr.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileMesh/lr.vctr
deleted file mode 100644
index f8bf27acd680a192db6316a203dfc9ea95b83ae0..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 333
zcmV-T0kZxdiwFP!000003zd<}O2a@DhNs@|*Q(nvxHD=JQzZcxp`Bc$nMjjDu}GlO
zK7a;6N?t&p!L=)2LVNFbzlS7
z1hxd|+dviA0d@uGd-(qA+eP{B&_52I8br#k&L7{)9KHAa-A8{>ihh|N8$}0mboqYy
ftbD(Gc2X|SAm2YJADwejK5ou0qke3)`~m;~*>9sb
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileMesh/parent.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileMesh/parent.vctr
deleted file mode 100644
index fbb32948f82fd00939e409aa9736caded58f90c8..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 334
zcmV-U0kQrciwFP!000003zd+|O2a@DhNs@|*Q(nvxHD=JQzZcxp_yDtlSq?7u}GlO
zK7a;6N?xFS2G_29iIOMqd0co79bsyfYT$#9pK~UM|LHz^C=o(F<_IZ+tbi|&pT9m0
z{Ll}YLFzHz^%80-G7YTO_o%_Di50qaM$PuAa;7MXdZkw`G()SXhM|L8%D?6Ritl9V
zM2*1Wm$2Alaaw1gn|Rbz$4TmkHfyDk;iin^nIWV8~}$L^dtQL+o<+_GAwSd2R3(GaLfxKFFG%y+N(4y&b5Kf-4-14LdXm8
geQ{TOU)-IMi#OPR%qQ-gkx$+E36YFIV*COC0M(43mH+?%
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileMesh/tileset.json b/Specs/Data/Cesium3DTiles/Vector/VectorTileMesh/tileset.json
deleted file mode 100644
index 404ec0e97e47..000000000000
--- a/Specs/Data/Cesium3DTiles/Vector/VectorTileMesh/tileset.json
+++ /dev/null
@@ -1,89 +0,0 @@
-{
- "asset": {
- "version": "0.0"
- },
- "geometricError": 500,
- "root": {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "geometricError": 100,
- "refine": "REPLACE",
- "content": {
- "url": "parent.vctr"
- },
- "children": [
- {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- 0,
- 0,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "ul.vctr"
- }
- },
- {
- "boundingVolume": {
- "region": [
- 0,
- 0,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "ur.vctr"
- }
- },
- {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0,
- 0,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "ll.vctr"
- }
- },
- {
- "boundingVolume": {
- "region": [
- 0,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "lr.vctr"
- }
- }
- ]
- }
-}
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileMesh/ul.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileMesh/ul.vctr
deleted file mode 100644
index f8b2ae83c6d21f05f26f6dfec218ba2beee9d6d7..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 340
zcmV-a0jvHWiwFP!000003zd<}O2a@DhNs@|*Q(nvxHD=JQzZcxp_yDtlSq?7Q6x}l
zA3%d3B`?rEgKJm5MClXwJT5$k&Op=}Fz~_0&p$JVljn!*u|f#>oFk+PvI4$9W`6@3
z_@N)PgVbZb>m}4wWExnVpHYj|6DxF^jGA|+%9)}l>Xlx*&ohGRt+N_gCjuW#arsjZlU$S1*??3f2IF^5F)uVR!yQGWK
zO%(fyABEE%H8nlQy&U6ia!EpmHIfPkeI8f@miS(mxnqXAUIo@T=Dfqpzi}!-~c$}pdaD;@8ibD$!KzWJ+#qrKH-=X-Vy(|`#NsCNu$ZRHnh<(6OOs)
mh<@?@;@RT;#j|C3afagkWx04)%vqMtn)3^EPO+8z0ssI`!>9QG
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileMesh/ur.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileMesh/ur.vctr
deleted file mode 100644
index 151ad6534446428a8bb2184fe88ab4dacf7719b6..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 336
zcmV-W0k8faiwFP!000003zd;uO2bePhEKiUuT@{e!8fBOF;x=qAv7l!X%cBtC>9A+
z+68D3q+|o_8hrN2O}GTtDOq^@tkAl+o#T#38mDdV@k~+
zq>vA*;lHltI-cV;-L`ExRXfxSJ*~N=*8Wn%Du*SnTDLS~eNLa(bv?6`%P(e&*?gv0
z%pnxgqv~UoH_}?gZ@49%#0qRHXxA;T8rqtX>sQ*2XIibcU#SFE7-&XU+x*_y^0&9Y
zZgsG%_g7chZ+e4GnL^yP>IY8f_+GzJGm3>?Dn(bO?tu-TIZNGMzh@FA80AB71dj5Z
zPjRLiUWYmkCm7|Ea0*Vt8AkamOv5=i&nRDji*N}pGs;(B2Cl(XM)^A2gj;X}ZgZv@
z9pDaVjPhMR-+g$%C_kj{2_C}}MtK&}FbDID@&f3Pg$$#-2ze+#4wg7m?I{$&V3eQ1
zb6AEKjPeS+gc7`Bl*?d(1rfIihCGZ|JR)IS)xA@dq$(~LF^fc=SBy3zmZ&X;iin^nIWV8~}$L^dtQL+o<+_GAwSd2R3(GaLfxKFFG%y+N(4y&b5Kf-4-14LdXm8
geQ{TOU)-IMi#OPR%qQ-gkx$+E36YFIV*COC0M(43mH+?%
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileMeshBatchedChildren/tileset.json b/Specs/Data/Cesium3DTiles/Vector/VectorTileMeshBatchedChildren/tileset.json
deleted file mode 100644
index a07e7dd4bf19..000000000000
--- a/Specs/Data/Cesium3DTiles/Vector/VectorTileMeshBatchedChildren/tileset.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- "asset": {
- "version": "0.0"
- },
- "geometricError": 500,
- "root": {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "geometricError": 100,
- "refine": "REPLACE",
- "content": {
- "url": "parent.vctr"
- },
- "children": [
- {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "children.vctr"
- }
- }
- ]
- }
-}
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileMeshBatchedChildrenWithBatchTable/children.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileMeshBatchedChildrenWithBatchTable/children.vctr
deleted file mode 100644
index f9fa7b1f9f5f5b947c89dcccc9e190635abde959..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 599
zcmV-d0;v5TiwFP!000003!T&1ZqrZ@2H?}Ol%2AdJ(!)Qt&=7xF_aQwCw7SK5<3uD
zN~EIpiYthaP?Q&FpMh(xc!|nSz!UM0GM0uWF%6ME>DOq^@tkAl+o#T#38mDdV@k~+
zq>vA*;lHltI-cV;-L`ExRXfxSJ*~N=*8Wn%Du*SnTDLS~eNLa(bv?6`%P(e&*?gv0
z%pnxgqv~UoH_}?gZ@49%#0qRHXxA;T8rqtX>sQ*2XIibcU#SFE7-&XU+x*_y^0&9Y
zZgsG%_g7chZ+e4GnL^yP>IY8f_+GzJGm3>?Dn(bO?tu-TIZNGMzh@FA80AB71dj5Z
zPjRLiUWYmkCm7|Ea0*Vt8AkamOv5=i&nRDji*N}pGs;(B2Cl(XM)^A2gj;X}ZgZv@
z9pDaVjPhMR-+g$%C_kj{2_C}}MtK&}FbDID@&f3Pg$$#-2ze+#4wg7m?I{$&V3eQ1
zb6AEKjPeS+gc7`Bl*?d(1rfIihCGZ|JR)IS)xA@dq$(~LF^fc=SBy3zmZ&X;iin^nIWV8~}$L^dtQL+o<+_GAwSd2R3(GaLfxKFFG%y+N(4y&b5Kf-4-14LdXm8
geQ{TOU)-IMi#OPR%qQ-gkx$+E36YFIV*COC0M(43mH+?%
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileMeshBatchedChildrenWithBatchTable/tileset.json b/Specs/Data/Cesium3DTiles/Vector/VectorTileMeshBatchedChildrenWithBatchTable/tileset.json
deleted file mode 100644
index a07e7dd4bf19..000000000000
--- a/Specs/Data/Cesium3DTiles/Vector/VectorTileMeshBatchedChildrenWithBatchTable/tileset.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- "asset": {
- "version": "0.0"
- },
- "geometricError": 500,
- "root": {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "geometricError": 100,
- "refine": "REPLACE",
- "content": {
- "url": "parent.vctr"
- },
- "children": [
- {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "children.vctr"
- }
- }
- ]
- }
-}
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileMeshWithBatchIds/children.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileMeshWithBatchIds/children.vctr
deleted file mode 100644
index 6299a980e4b279a75ac07ff7a4e93cb0803abe15..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 617
zcmV-v0+#(BiwFP!000003!T&1Zqq;%2H?mno`p$
zp?dw98Tyv^QyHK<4F};6-_2ppRKvBYqi~E-J`N|~B%ETDPs15F3+EW+^Kbz!!X-xe
zGF*XcaFtQM4maTz+<@DhsYV;P0~(`zm-l%e9x%!e)!==53{M#4SxCYh%rnXhphFr`
zjB*BYkcTWRa;Dl66u@AVpTaX(hUbj(3wQ}dSYeb)V1fl@M!CXwS_7L=egzJ=PzR4Q
z)f(^`nvAj!0kq%^qx=@y@D5fP+pe5?m*(_Ztd6XPPn?fZBkY=k2BR3k5T;D
z_`X~FF|!jcq_<7VREsjzqcPEVxxSn$*OznS>aqv9eq23zZq#R7eO#Y=&cu{wC3-ex
z58_Nrc~)Xy=6?E|WWTZpxqe(-?AH|MFtYxyKIOB-_)x4FjyngjW+mel^2mCI}eSVif-
z$tqt1)`1ORQz3l|*amihU4`^LU>`UD4i(amnCd%sC^Un)4H;OgHl+0{{TY->V@2
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileMeshWithBatchIds/tileset.json b/Specs/Data/Cesium3DTiles/Vector/VectorTileMeshWithBatchIds/tileset.json
deleted file mode 100644
index a07e7dd4bf19..000000000000
--- a/Specs/Data/Cesium3DTiles/Vector/VectorTileMeshWithBatchIds/tileset.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- "asset": {
- "version": "0.0"
- },
- "geometricError": 500,
- "root": {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "geometricError": 100,
- "refine": "REPLACE",
- "content": {
- "url": "parent.vctr"
- },
- "children": [
- {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "children.vctr"
- }
- }
- ]
- }
-}
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileMeshWithBatchTable/ll.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileMeshWithBatchTable/ll.vctr
deleted file mode 100644
index 9c03a5215cd300cdd47f5cfea250e10c32b6b6ba..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 335
zcmV-V0kHlbiwFP!000003zd<}O2a@DhNs@|*Q(nvxHD=JQzZcxp-z%1O(IPSMUgvzc6cOhGo=r%Q8XE)xYw8#dj)o
zqgLRENm%T&IBl}fOMGhUMUwLHignV+bz_#q)E?08bJmOc{l{Jg$MPSodejbomrPl@
zj$)qhC@gx^Hq0FNa)`Uh6$KsENGbyKSzsPm5PMw|jv4NH8CVgZuL5hpI%+EuOlK{{zsYLT)vECj^2G6Hr|z@k1qQ%KQ)RDX6WVn
h%V*2?m(Nbi%QKYkpO%l$IW3mF004HCohbkS
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileMeshWithBatchTable/lr.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileMeshWithBatchTable/lr.vctr
deleted file mode 100644
index f8bf27acd680a192db6316a203dfc9ea95b83ae0..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 333
zcmV-T0kZxdiwFP!000003zd<}O2a@DhNs@|*Q(nvxHD=JQzZcxp`Bc$nMjjDu}GlO
zK7a;6N?t&p!L=)2LVNFbzlS7
z1hxd|+dviA0d@uGd-(qA+eP{B&_52I8br#k&L7{)9KHAa-A8{>ihh|N8$}0mboqYy
ftbD(Gc2X|SAm2YJADwejK5ou0qke3)`~m;~*>9sb
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileMeshWithBatchTable/parent.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileMeshWithBatchTable/parent.vctr
deleted file mode 100644
index fbb32948f82fd00939e409aa9736caded58f90c8..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 334
zcmV-U0kQrciwFP!000003zd+|O2a@DhNs@|*Q(nvxHD=JQzZcxp_yDtlSq?7u}GlO
zK7a;6N?xFS2G_29iIOMqd0co79bsyfYT$#9pK~UM|LHz^C=o(F<_IZ+tbi|&pT9m0
z{Ll}YLFzHz^%80-G7YTO_o%_Di50qaM$PuAa;7MXdZkw`G()SXhM|L8%D?6Ritl9V
zM2*1Wm$2Alaaw1gn|Rbz$4TmkHfyDk;iin^nIWV8~}$L^dtQL+o<+_GAwSd2R3(GaLfxKFFG%y+N(4y&b5Kf-4-14LdXm8
geQ{TOU)-IMi#OPR%qQ-gkx$+E36YFIV*COC0M(43mH+?%
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileMeshWithBatchTable/tileset.json b/Specs/Data/Cesium3DTiles/Vector/VectorTileMeshWithBatchTable/tileset.json
deleted file mode 100644
index 404ec0e97e47..000000000000
--- a/Specs/Data/Cesium3DTiles/Vector/VectorTileMeshWithBatchTable/tileset.json
+++ /dev/null
@@ -1,89 +0,0 @@
-{
- "asset": {
- "version": "0.0"
- },
- "geometricError": 500,
- "root": {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "geometricError": 100,
- "refine": "REPLACE",
- "content": {
- "url": "parent.vctr"
- },
- "children": [
- {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- 0,
- 0,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "ul.vctr"
- }
- },
- {
- "boundingVolume": {
- "region": [
- 0,
- 0,
- 0.00017453292519943296,
- 0.00017453292519943296,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "ur.vctr"
- }
- },
- {
- "boundingVolume": {
- "region": [
- -0.00017453292519943296,
- -0.00017453292519943296,
- 0,
- 0,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "ll.vctr"
- }
- },
- {
- "boundingVolume": {
- "region": [
- 0,
- -0.00017453292519943296,
- 0.00017453292519943296,
- 0,
- -1000,
- 1000
- ]
- },
- "geometricError": 0,
- "content": {
- "url": "lr.vctr"
- }
- }
- ]
- }
-}
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileMeshWithBatchTable/ul.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileMeshWithBatchTable/ul.vctr
deleted file mode 100644
index f8b2ae83c6d21f05f26f6dfec218ba2beee9d6d7..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 340
zcmV-a0jvHWiwFP!000003zd<}O2a@DhNs@|*Q(nvxHD=JQzZcxp_yDtlSq?7Q6x}l
zA3%d3B`?rEgKJm5MClXwJT5$k&Op=}Fz~_0&p$JVljn!*u|f#>oFk+PvI4$9W`6@3
z_@N)PgVbZb>m}4wWExnVpHYj|6DxF^jGA|+%9)}l>Xlx*&ohGRt+N_gCjuW#arsjZlU$S1*??3f2IF^5F)uVR!yQGWK
zO%(fyABEE%H8nlQy&U6ia!EpmHIfPkeI8f@miS(mxnqXAUIo@T=Dfqpzi}!-~c$}pdaD;@8ibD$!KzWJ+#qrKH-=X-Vy(|`#NsCNu$ZRHnh<(6OOs)
mh<@?@;@RT;#j|C3afagkWx04)%vqMtn)3^EPO+8z0ssI`!>9QG
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTileMeshWithBatchTable/ur.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTileMeshWithBatchTable/ur.vctr
deleted file mode 100644
index 151ad6534446428a8bb2184fe88ab4dacf7719b6..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 336
zcmV-W0k8faiwFP!000003zd;uO2bePhEKiUuT@{e!8fBOF;x=qAv7l!X%cBtC>9A+
z+68D3q+|o_8hrN2O}GTtt!1V4l3kN>A10d)ZYs2>=4
delta 76
zcmeBToWdw3-_5}Q2He`-dYVZo2?-VKN317`1?rwWYk%UpV21I9TMYI7`zJi8kPo;2
cF2KJaI!km_wy4Ozo6L!}45D#GHSd7>0ekNma{vGU
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePoints/lr.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePoints/lr.vctr
index f6d54b6888397e16e01ded0c68fe6bfe41cb7339..ea16f8769d7738a87af38bce51797e874e41b52c 100644
GIT binary patch
delta 68
zcmbQn*uy9$-_5}Q2He`-dYVZo2?-S}N3ti11*&QuxPMt+#p2%atLJTxFu!QH^(u|7-_5}Q2He`-dYVZo2?-VKN317`1?rzXYk%UpV21I9TMYI7`zJi8kPo;2
fF2KJaI!km_wy4OzxBt`sua{$Je>dgqJD>>w*0&v#
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePoints/parent.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePoints/parent.vctr
index 5cde6d53fc1c4a54fa72e933fa39f69ae6a979a9..940c9b60e95901d685b98ab27bc580b19beb8160 100644
GIT binary patch
delta 65
zcmbQt*vTj+-_5}Q2He`-dYVZo2?-S}N3ti11uAJCxPMt+#p2%atLJTxFu!QH^(uK9P}
delta 75
zcmeBVoXjXD-_5}Q2He`-dYVZo2?-VKN317`1?rqUYk%UpV21I9TMYI7`zJi8kPo;2
cF2KJaI!km_wy4OztIY}wbGoHN-T}1(0B1}YqW}N^
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePoints/ul.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePoints/ul.vctr
index 6f8ee1bdb9d957fb3d988994b613c3dea61edea3..067a51cd7578c64b40a29018ef6f180587fdb603 100644
GIT binary patch
delta 68
zcmbQn*uy9$-_5}Q2He`-dYVZo2?-S}N3ti11*&QuxPMt+#p2%atLJTxFu!QH^(u|7-_5}Q2He`-dYVZo2?-VKN317`1?rzXYk%UpV21I9TMYI7`zJi8kPo;2
fF2KJaI!km_wy4OzoBwbBUoXcn)zy9OJD>>w)Pfw_
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePoints/ur.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePoints/ur.vctr
index d5ae71e6d26f3f7d0de44fe65f0c2981768d4a9c..84e4abe7b6ae7e934b1701d3a2dcafa0527c829c 100644
GIT binary patch
delta 66
zcmbQj*u^L&-_5}Q2He`-dYVZo2?-S}N3ti11uAPExPMt+#p2%atLJTxFu!QH^(uVp)hpVT%
zM~IS@uAzZ}fsT@|V+4vYL^R0NImFS=-N#kQDq7b-4=846ZenU|WNBn-XlZEzWSHsT
z5+_MGR!1qo-_tK7INrzA&ppIL$;za*x>iBqpFKkZ1H=FNfBQis1H-?1h+hDOWWpl!
G0001;OhTIg
literal 161
zcmV;S0ABweiwFP!000003oA=5DPm**0wA%20RmVUFo6URS1b8?`g!_>`o?>>db)dr
zC|T(m8Wrp88=My7_AmL@=knGP;-
zl7wS*l-&G-d>w%{1Fa44_w)-1j`wl(a}V)QvNEYvsIFB|_-D`1z`*do{@;EO$-wZh
P9^x+mE0>8@009617Fb5w
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePointsBatchedChildren/parent.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePointsBatchedChildren/parent.vctr
index 5cde6d53fc1c4a54fa72e933fa39f69ae6a979a9..940c9b60e95901d685b98ab27bc580b19beb8160 100644
GIT binary patch
delta 65
zcmbQt*vTj+-_5}Q2He`-dYVZo2?-S}N3ti11uAJCxPMt+#p2%atLJTxFu!QH^(uK9P}
delta 75
zcmeBVoXjXD-_5}Q2He`-dYVZo2?-VKN317`1?rqUYk%UpV21I9TMYI7`zJi8kPo;2
cF2KJaI!km_wy4OztIY}wbGoHN-T}1(0B1}YqW}N^
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePointsBatchedChildrenWithBatchTable/children.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePointsBatchedChildrenWithBatchTable/children.vctr
index 2f5d8ad985c2edfabfd696cea29232e681bd2f10..fc0253075c9a4a9ccf4cc2556a5a5428a1e1f53b 100644
GIT binary patch
delta 114
zcmX@YxQkItzMF#q47jzu^)!=G5)up;gt8}!1qN##xPMt+#p2%atLJTxIG;SVWLuP`
zzM;8j#^#_*N5`y*PJUTYos;;c1W%bckMYsdC)1NZ9N;QnQO6^nbvub#I(!u+D)R@Txz
iNA83yIP1mQ>AJE~)obHcuK%wb1sE8!G`Kzi%>V#yYaV|9
delta 90
zcmbQixQJ0qzMF#q47jzu^)!=G5)yu}AF-Y&7HEC)to@1Wf*HmaZZXvR@1O9XLO$I7
sy8!=!=q%AyQ$Gn62RE(@(DKmnI;$PnwKnueIDZoZL+{UB|A3|e0Av**djJ3c
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePointsWithBatchIds/children.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePointsWithBatchIds/children.vctr
index 59a27fd352ea11f2e09995a7538a82b9522f5988..9200758bf12c79b5da4cfa042a1e359c5c6e8989 100644
GIT binary patch
delta 119
zcmX@fc#u&{zMF#q47jzu^)!=G5)uL!gv2L`1xK*{sQ%T;a{Tv>Upw0?G$Lm@xIUUI
z<2=Xqk!@_#)HSQ7PSWxY`g{3OSFrb#H9T3_q7o7kk~1V{NUX{h75R75*u=o#&-(w{
X>=#f4dgH0X$iM&qtq?K(
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePointsWithBatchIds/parent.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePointsWithBatchIds/parent.vctr
index 43c0f44a637bab7c183df2fa7dff5ea083a36636..cea686422540f658be89a8ed772fe2b805bbae2b 100644
GIT binary patch
delta 97
zcmdnQxSCN+zMF#q47jzu^)!=G5)vLT35ib>3wC1tQT?lx<@oO%zjn4)Fvv29c9s|M
z6n^XYUcwo+X;qllDjm8l;swKnueI)BSohNg_^tC$!W7y!^YB5MEu
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePointsWithBatchTable/lr.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePointsWithBatchTable/lr.vctr
index 3248f04bbaba86c0d5a04819ce2f49c4e6a16a8c..08e491cde99aacf6b78adfa8c5a1ebb1e6230e07 100644
GIT binary patch
delta 87
zcmZ3Wh-CxDv$8_G9iIIT;05lsU
AkN^Mx
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePointsWithBatchTable/parent.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePointsWithBatchTable/parent.vctr
index 334da4349d608599570fd268dc0b4a563fbce5fa..01827f70cee2ae948165d5152e98988acb4e776b 100644
GIT binary patch
delta 80
zcmZ3)ID=74zMF#q47jzu^)!=G5)yu}9Lb(27HFt>;QnQO6^nbvub#I(!u+D)R@Txz
iNA83yIP1mQ>AJE~)obHcuK%wb1sE8!G`Kzi%>V#yYaV|9
delta 90
zcmbQixQJ0qzMF#q47jzu^)!=G5)yu}AF-Y&7HEC)to@1Wf*HmaZZXvR@1O9XLO$I7
sy8!=!=q%AyQ$Gn62RE(@(DKmnI;$PnwKnueIDZoZL+{UB|A3|e0Av**djJ3c
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePointsWithBatchTable/ul.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePointsWithBatchTable/ul.vctr
index 11ec9f61bc3ad20804912efd2a7f15505e6f3cbc..6f47ccc45653f6249565352e2845989e0b141e5f 100644
GIT binary patch
delta 87
zcmZ3{|PGyFABh#{EBvtC<)X7yz}FA<_T<
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePolygons/ll.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePolygons/ll.vctr
index a16a15777003bdc54e7838f30d27c3750d8d5eb6..4ab0bcabc05d16c561a485032d1a1c29434931e2 100644
GIT binary patch
delta 127
zcmV-_0D%9|0muOwABzY80000001GQiE-7MUU|@&<5o)+#7~!h;Ru
he;}I)NHZga2`KECpzMG3Ap93h0szJyGy7Np006sFG9&;1
delta 136
zcmV;30C)e$0nq^(ABzY80000001GQiE-7MUU|>iA5-dQ>0c4RHQf0}_Kgib+Xfx2-
z0DqrIcYnX&cpq0k_Ye=DYv5w>&io
q)+#6{fWn3i6c#`Z6Od*`3Lj87GC|q@>OuG~m;?a%Ty3Rf0RRAPPBhp6
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePolygons/lr.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePolygons/lr.vctr
index 8c9be2070dabb0aa97268704556c68ab0f13027c..bcc1530a2c52787b0600e857cf1d38f3e3770d17 100644
GIT binary patch
delta 126
zcmV-^0D=F|0mlIvABzY80000001GQiE-7MUU|@&<5o)+#7~!h;Ru
ge;}I)NHZga2`KD9V*l!4_%E0Q0I{$B3RnRE0EViA5-dQ>0c4RHQe?@^Kgib+Xfx2-
z0DqrIcYnX&cpq0k_Ye=DYv5w>&io
p)+#6{fWn3i6c#`Z6Od*`3Lj87g2evS!|-1)2>_1mpj2c5002TDH3$Fz
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePolygons/parent.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePolygons/parent.vctr
index 80b376a67892e71510c841e84739f91225d27e04..393811ffa8eeb84009208f48524aaac56224ae24 100644
GIT binary patch
delta 127
zcmV-_0D%9|0muOwABzY80000001GQiE-7MUU|@&<5o)+#7~!h;Ru
he;}I)NHZga2`KECpzJ^YLHIYA1OQ~}>k?Q2006+EGO_>w
delta 136
zcmX@Xc#%;`zMF#q47jzu^)!=G5)wQZg>)RwFs4kD3Q9eB*8aqG!3^UIw;1Z@dz9Dj
ze^4PGZvS0?e?j(xq>tzREv$10z3SyTRdwaR%*>-JRUK@%a+-zU=D-!C}c
z$JNh0!~^IAxLCZif2beOQPoOGl_jbEX=%l&B}!HXwFm{CelD&N*p->o)+#7~!h;Ru
ke;}I)NHZga2`KECpzMG33=Dt%|E&kH07>%zF<1cr0B5K)0RR91
delta 140
zcmV;70CWG#0o4H-ABzY80000001GQiE-7MUU|>iA5-dQ>0c4RHQfbM}Kgib+Xfx2-
z0DqrIcYnX&cpq0k_Ye=DYv5w>&io
u)+#6{fWn3i6c#`Z6Od*`3Lj87GC|q@>KPdR{Qp}IVgUelv0iUv0RR9{JvL(i
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePolygons/ur.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePolygons/ur.vctr
index 7cd950eb0ab7df3812ac334ec4564df7611cce5e..21dbc3604e45ada05fa33b6c2ec3aa4052a85b4f 100644
GIT binary patch
delta 128
zcmV-`0Du3|0m%UxABzY80000001GQiE-7MUU|@&<5o)+#7~!h;Ru
ie;}I)NHZga2`KD9V*lzP_|N~pU={#ALe0Qf0RRB|lryjZ
delta 137
zcmV;40CxY$0nz~)ABzY80000001GQiE-7MUU|>iA5-dQ>0c4RHQfA4`Kgib+Xfx2-
z0DqrIcYnX&cpq0k_Ye=DYv5w>&io
r)+#6{fWn3i6c#`Z6Od*`3Lj87g2evSL-3#ff59vO0RWSpWB~vGwM8|<
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePolygonsBatchedChildren/children.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePolygonsBatchedChildren/children.vctr
index 4f9218e671a0ea59062fc509fefdca567daa215d..ee3ffaa18fad4cca7dfaf32342aff328a00436ee 100644
GIT binary patch
delta 125
zcmZo*`oSnA-_5}Q2He`-dYVZo2?-U9Ds>E*tO^sQg8YIS_WLi{y+6KSPyg!q)gA4V
zrgFyU+`DOih5yBhtffm%O$zzHWy_;0LaN%$Q7ugV_Ttw$-kjn&o0TmZu^^G@a8AaK
dU15%moF2x?t)dz}6Azhjl!(q*@q&?o0RT1?Fkt`y
delta 133
zcmV;00DAxU0e}J;ABzY80000001GQiE-7MUU|{$HBv^o00mzXWQdW|ie~_;u&}N{u
z0scOb?*4wk@jkA8?jasZRwi(+~YWH
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePolygonsBatchedChildren/parent.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePolygonsBatchedChildren/parent.vctr
index 80b376a67892e71510c841e84739f91225d27e04..393811ffa8eeb84009208f48524aaac56224ae24 100644
GIT binary patch
delta 127
zcmV-_0D%9|0muOwABzY80000001GQiE-7MUU|@&<5o)+#7~!h;Ru
he;}I)NHZga2`KECpzJ^YLHIYA1OQ~}>k?Q2006+EGO_>w
delta 136
zcmX@Xc#%;`zMF#q47jzu^)!=G5)wQZg>)RwFs4kD3Q9eB*8aqG!3^UIw;1Z@dz9Dj
ze^4PGZvS0?e?j(xq>tzREv$10z3SyTRdwaR%*>-JRUK@%a6@=^N@B
z@8Rm{?h&G7rE6$lV4$Pq>llF|3=s`-bq;a#bN6vovWnI<&;yDYnwyv!8(A8e8d_SK
z02yXFxWq{kj@3~L@b`&y_xB5q_i^=e5Ajg4GJ%W5JNt+F0UcGXlvG)g>YtWYoLZt}
zWl)Py;OXb$8i8Gzp;>LM0t?XZ$e0ZcS1aWu=B5IDsZ?4}kXodWlbTkdqyyy?Wu|9<
zcscpy7(B4T*jixFGcY5CGblcopk}ip*~hGw<33JNU1a6ravXt-J_FEKY2=wqeQf`Zf{g`Cv1
z5+xldrzkT$1H{Y8FUR146~@*Aqk(}LDa=7}!vr;(9m!r+s2CRza|1C46mvqw_<)!n
pho)+#8l0R7Ge
x_J3YtZYt0>N(G5Usd*(zv9$_JKyhZIFam`o6O{euKM4N@lK`P!bF63q003g1IUfK3
delta 153
zcmV;K0A~N#0pbA~ABzY80000001GQiE-7MUU|=W#5-dQ>0c4RHQg+GBKgib+Xfx2-
z0DqrIcYnX&cpq0k_Ye=DYv5w>&io
z)+#6{umHn>4ICDEiMgpjpD7h27NzEuD8<$)FagDxk-`fUu1rw&pZ_5I8%zQKZd?`e
HbO8VWh@m|_
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePolygonsWithBatchIds/children.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePolygonsWithBatchIds/children.vctr
index 634258b93f23616ba78c4d59bd6b431a785a5bf8..aa9cf7dfe273625eea06ab69ed58d31b2f79d381 100644
GIT binary patch
delta 120
zcmbQnG?7VMzMF#q47jzu^)!=G5)vjPBqan)6c5*C{qfsn*YDq~$A9nmwX?lKBXZ_}
zqmSnPb^hDXw<^qQm5%3Ee{XF+-M~#oD<&?Km1SjR70bAB&_G%$Eg>N#AuSu7IzMF#q47jzu^)!=G5)uLuk`gXV6c0Dv`IG&p6;m!-l=Or5!Y|*w7ngbe
z_|`rAf@Md<
zp3U_ufR&>eDKgib+Xfx2-0DqrI
zcYnX&cpq0k_Ye=DYv5w>&ifp002r{
BI(Ps8
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePolygonsWithBatchTable/ll.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePolygonsWithBatchTable/ll.vctr
index 0c55180d82a9542c461adf6ecda9f5b5cd7b85f9..31e2938c254f2965d7d3e518cb3725d9ccc12616 100644
GIT binary patch
delta 147
zcmV;E0Brx|0owr@ABzY80000001GQiE-7MUU|`4r50c4RHQF@Y_e~_;u&}N{u
z0scOb?*4wk@jkA8?jasP*TBW%o&7`ofU2sMk}6A5{nOHlQ%it)Y7q)N{ajoluq!jE
ztyNG^U;%~$8#pZT5_405K2yrcFHbE}$Vp8rQHrfqU;@f9BZV0#Y?+|!fAt{z7fb>G
LoxZQ_cmV(akLW=g
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePolygonsWithBatchTable/lr.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePolygonsWithBatchTable/lr.vctr
index 123689a82d8f5740b473da7c951728238b64d0b4..a8795eb5afac00b315f51914d239e865a342d736 100644
GIT binary patch
delta 146
zcmV;D0B!%|0onl?ABzY80000001GQiE-7MUU|`4r50c4RHQF)S^e~_;u&}N{u
z0scOb?*4wk@jkA8?jasP*TBW%o&7`ofU2sMk}6A5{nOHlQ%it)Y7q)N{ajoluq!jE
ztyNG^U;%~$8#pZT5_405K2yrcFHbE}D9TLFC{c>7Wdh1EBZV0#Y(ZlG>S6dVm;?Z0
K2SV+50RR9>Za=I5
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePolygonsWithBatchTable/parent.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePolygonsWithBatchTable/parent.vctr
index 34ac8409f962845fcbeb5e2afd9aa253ebddc9aa..9f72dfed04e562e05c4aa23571747c26ee51fd2c 100644
GIT binary patch
delta 143
zcmV;A0C4}}0oVZ=ABzY80000001GQiE-7MUU|`4q5o)+#8l0R7Ge
x_J3YtZYt0>N(G5Usd*(zv9$_JKyhZIFam`o6O{euKM4N@lK`P!bF63q003g1IUfK3
delta 153
zcmV;K0A~N#0pbA~ABzY80000001GQiE-7MUU|=W#5-dQ>0c4RHQg+GBKgib+Xfx2-
z0DqrIcYnX&cpq0k_Ye=DYv5w>&io
z)+#6{umHn>4ICDEiMgpjpD7h27NzEuD8<$)FagDxk-`fUu1rw&pZ_5I8%zQKZd?`e
HbO8VWh@m|_
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePolygonsWithBatchTable/ul.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePolygonsWithBatchTable/ul.vctr
index c6fb211af6339867271112bcc80cb1c3632ef790..2bc70b7ab19bffbcaaf9c648e9e0b962572ed67b 100644
GIT binary patch
delta 151
zcmV;I0BHZ{0p9@{ABzY80000001GQiE-7MUU|`4r50c4RHQGJq|e~_;u&}N{u
z0scOb?*4wk@jkA8?jasP*TBW%o&7`ofU2sMk}6A5{nOHlQ%it)Y7q)N{ajoluq!jE
ztyNG^U;%~$8#pZT5_405K2s_!C`c_*$Vp8rQHrfqU;@f9BZV0#Y?+|!fAtIufByfi
O2eAMST1%980RR9c>_DRc
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePolygonsWithBatchTable/ur.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePolygonsWithBatchTable/ur.vctr
index 4d2687f6c250f2a73710085a204bf87dce4c66b0..3d75d871e2b66052dd2625cbf8d6c01a8d5d38a9 100644
GIT binary patch
delta 149
zcmV;G0BZl{0o?%_ABzY80000001GQiE-7MUU|`4r5$c`FPH@YCoRj4YykiO
Dyz4y$
delta 158
zcmV;P0Ac^#0p0c4RHQG1e`e~_;u&}N{u
z0scOb?*4wk@jkA8?jasP*TBW%o&7`ofU2sMk}6A5{nOHlQ%it)Y7q)N{ajoluq!jE
ztyNG^U;%~$8#pZT5_405K2s_!C`c_*D9TLFC{c>7Wdh1EBZV0#Y(ZlG>LK{g|G!`s
M0Py3clz0IE0JXnC)c^nh
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePolylines/ll.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePolylines/ll.vctr
index 0ed59d15e5c205d134076c5e1e84bd3a3d191793..527389243c1dc879143cf1c8e8e30ffb135f5e19 100644
GIT binary patch
delta 116
zcmV-)0E_>`0lEPeABzY80000001GQiE-7MUU|^^L5*LvcPgPQYzfYu(r=M$ZypOA&
zdx(dUl_5ef-q}CY59q9FrKHM|RR6TJ;?xo)D}&lv5s;s16%>&D`cIxg0SuAAe|Zr6
WEB~(^#v-JHH~;|Z2d@Zx0RR9KKQANz
delta 126
zcmdnRc!W_*zMF#q47jzu^)!=G5)xi82$fG1^N*i2yMDrYzMF#q47jzu^)!=G5)xi82$fG1^G}^LyMDrY1xwgg9$tg^L=u|Iv5!k05Y;PrvLx|
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePolylines/parent.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePolylines/parent.vctr
index 5d089134b1f7f169ae29f1cc202c5c690b673de0..b5e7b67ab4647d369fcc0d89f6da231edb4db87b 100644
GIT binary patch
delta 129
zcmV-{0Dk|`0mlIrABzY80000001GQiE-7MUU|^^L5*LvcPhwJlzfYu(r=M$ZypOA&
zdx(dUl_5ef-q}CY59q9FrKHM|RR6TJ;?xo)D}&lv5s;s16%>&D`p=%hfx!Vt!T}S*
je|r%8Yyao}UnmPx2ZIA6P$dX3G7t*@Q!G4dd;tIe*=RE|
delta 139
zcmV;60CfMy0nq^#ABzY80000001GQiE-7MUU|{F~5_gdnPi&H#e~_;u&}IW2r2v1Q
zNFPr>*Wh>`S3ma<4<#!@gkZe0f2bc&UA0nDWl5@kT3T^x2~byUt%3;1f3*q<$o~Fk
t&)~q|03_jniQ&IJ2>!MI^ZzfDg{gzVff1+@1Q;2J1povq@zaO_007YNH+BF3
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePolylines/ul.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePolylines/ul.vctr
index 406d3e9d3f2d7f610456be65fc61cd5b9309dc4f..ea576807bc9bdb40529454c53bf3a2a8024b4be3 100644
GIT binary patch
delta 128
zcmV-`0Du3`0mcCqABzY80000001GQiE-7MUU|^^L5*LvcPhnDkzfYu(r=M$ZypOA&
zdx(dUl_5ef-q}CY59q9FrKHM|RR6TJ;?xo)D}&lv5s;s16%>&D`cIxg0SuAAe|Zr6
iEC1*JUwH@{C3qm}6&M+qz+6TKVgUdtg&6C60RRAoS~G3{
delta 138
zcmX@cc!5z&zMF#q47jzu^)!=G5)xi82$fG1^Ut0%yMDrYuZ
GfdK$tpDa@V
delta 112
zcmeyu_>WOSzMF#q47jzu^)!=G5)ytKK60RdeWFB=bJ1u1Po*rkauzHWdGKEN<>Qyn
zrDWbee)U}L(ZZC}CV`&vZ~R}GSFH~7TBYOp)!$p&PnYr4s?;;D6}7(
QxY(0p!h~X&D`p=%hfx!Vt!T}S*
je|r%8Yyao}UnmPx2ZIA6P$dX3G7t*@Q!G4dd;tIe*=RE|
delta 139
zcmV;60CfMy0nq^#ABzY80000001GQiE-7MUU|{F~5_gdnPi&H#e~_;u&}IW2r2v1Q
zNFPr>*Wh>`S3ma<4<#!@gkZe0f2bc&UA0nDWl5@kT3T^x2~byUt%3;1f3*q<$o~Fk
t&)~q|03_jniQ&IJ2>!MI^ZzfDg{gzVff1+@1Q;2J1povq@zaO_007YNH+BF3
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePolylinesBatchedChildrenWithBatchTable/children.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePolylinesBatchedChildrenWithBatchTable/children.vctr
index 74a0c3d1cb46011820c1b21a4be20c6e3bdae28c..f7ead5e05fb4de66f8ea75ef977a004750ada101 100644
GIT binary patch
delta 206
zcmV;<05Sid0+s?8ABzY80000001GQiE-7MUU|`T;W?;Agkr+~c1^D|!`gr=e2FLrj
z`niXAC|Q{x1mm6kL;Zlxs#Z#>EJ^iGODj$-QL-|qtrY?K2^m)_z)ER-&W>zA-SC1qJRs~cI2TV|P
z|K*YOVya_c_zP7n_ZP`LeD?nN{}-pp3<``un?ZmP$z=TM{?@}xCf4VK)D3O`06aY4
IAS?p_0MYbZt^fc4
delta 216
zcmV;}04M*J0-ypIABzY80000001GQiE-7MUU|_IdW?;Ajkr+~cx%mhAIs$Dr&`}ET
z_lflJ^m7f4_i^=e5Ajg4GC>H&JNt+F0o7G2B~_NB`lqE8rI
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePolylinesBatchedChildrenWithBatchTable/parent.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePolylinesBatchedChildrenWithBatchTable/parent.vctr
index 60e3ecdeedc647cfd7733fd28187f8d22bbf3103..d2e783faec5cf3c853dda39eecdc69ecfd6c20aa 100644
GIT binary patch
literal 216
zcmV;}04M(+iwFP!000003oA=5DPm+`VCVr77l1Si5Q{LNf(j^It>o+J=jj{j8}H%j
z>FyDtWR+K%lcS^L>llGWG|1IC#L>^)$5qKHTGv3&z`(%J+{Dz_$kNEv(9+Tb$S~8v
zB~FrXtd3HEzfYu(r=M$ZypOA&dx(dUl_5ef-q}CY59q9FrKHM|RR6TJ;?xo)D}&lv
z5wM@~5_405PE;yLEK1EQQHrfqK=%7TdjLP$ttfjCr3xg*D(T%XppOOh@+pokE@bZw61}kfq{XcxrwQkYT2S
zOPnO(SRExd{~%vSpv?w4N&)^pkv^V&uEFs>u72(z9!ge*2*G$~|4=`mx@x7Q%92$7
zw6x;X5}>ZyS_KiX|MC)ZQ-RJ^Do89!%_~ugtyMq{hky1A4h#-J5)POc{@a7#U;97*
c|3X=qIv5-nfhs|Ok%3qM0BXJQUYG#@0Et~>DF6Tf
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePolylinesWithBatchIds/children.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePolylinesWithBatchIds/children.vctr
index 79dc285b1d1d6ea727f34148dda09cc350acd3e8..093564fa1e764b7f736f7a909bbe8e4a5770886b 100644
GIT binary patch
literal 269
zcmV+o0rLJIiwFP!000003oA=5DPm+`U{GLYVE6%~C4iWP0Tn!8gwWMWzMg)bzM;PH
z9;UQBfi41b~O{vw%&&)z@(|Kc>6L4gryGsHg#lkuzjTMsjt
TSf3M8H@E=+VPO1UAOipZM6i6P
literal 278
zcmV+x0qOo9iwFP!000003oA=5DPm+`V9;S^U|<0INrzA&ppIL$;t#F81L*K>IYO;t&~(*
zlIow9R-9S_)K!b5!pSkj*(2W5B^X_mp;>LMf`SMz9FQ>s10w@70~13vP!2iF{>d{a
zfFTn2FAsu$<^R51+k%{{O{kGJ^sm&}N8#
c5GLbS_qQHqGO<1;M1&
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePolylinesWithBatchIds/parent.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePolylinesWithBatchIds/parent.vctr
index aa5184aec8713b3add46048375f5e94be8bf5316..b4f6c45e6ff0a3930846d387ff169205c1c73c73 100644
GIT binary patch
delta 118
zcmaFDc#Ba=zMF#q47jzu^)!=G5)vX9Rq7Zr%@ig|`MNJ-JRlUO4wt8sIk#U}5`^Yx7>0;>2E7!C%Ivi^F
VQx>+Jp14DWW5I=!b}JYe7y$R?E3p6o
delta 128
zcmV-`0Du450ptN1ABzY80000001GQiE-7MUU|`q+Bv^o$4akuiO;IH`{~%vSpv?w4
zN&)^pkv^V&uEFs>u72(z9!ge*2*G$~|4=`mx@x7Q%92$7w6x;X5}>YHBo$7MAz9f1gMnPe0e-cpq0k
z_Ye;yD?@}}yt99(AJAFVN=cO^ss3qc#i=DqRtB}TB49t|CFZ6Aov4(PU!Gc|kdvBL
oq7+-Jfb9Q&@(c=Khy?!2gWzBJfAugHAsxg4009cVrjP*u0J~~63jhEB
delta 126
zcmV-^0D=F`0oVZ+ABzY80000001GQiE-7MUU|^U7B<_(GQBx&1{~%vSpv?w4N&)^p
zkv^V&uEFs>u72(z9!ge*2*G$~|4=`mx@x7Q%92$7w6x;X5}>ZyS_KiX|MC)ZQ-RJ^
g%E>QJEmFuyO)F7~tyMq{i;=Jv2yosi3Y-A|0N_b8NB{r;
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePolylinesWithBatchTable/lr.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePolylinesWithBatchTable/lr.vctr
index 02d4a9a3a8f4a2552ac4479807f495688afb13b1..e53535ff9b90efe0ca37c3c1792369c34a033256 100644
GIT binary patch
delta 141
zcmV;80CNA|0o4H(ABzY80000001GQiE-7MUU|^U4BrcH_QEsIGf1gMnPe0e-cpq0k
z_Ye;yD?@}}yt99(AJAFVN=cO^ss3qc#i=DqRtB}TB49t|CFZ6Aov4(PU!Gc|P?VXT
vQKA%E`>!4;02Dy*pFDDy{FVO?hX3jz^j{QNpjxmV29f~)I7#zEkO2SyDa|)w
delta 151
zcmV;I0BHZ!0p9@@ABzY80000001GQiE-7MUU|^U7B<_(GQFtXc{~%vSpv?w4N&)^p
zkv^V&uEFs>u72(z9!ge*2*G$~|4=`mx@x7Q%92$7w6x;X5}>ZyS_KiX|MC)ZQ-RJ^
z%E>QJEmA1TOwTA$imm-uj}#aRAox!nIeh-g{|Cc=^$_|miY!nqSPuiq002pyXYZT=
F007rFKT7}r
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePolylinesWithBatchTable/parent.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePolylinesWithBatchTable/parent.vctr
index 60e3ecdeedc647cfd7733fd28187f8d22bbf3103..d2e783faec5cf3c853dda39eecdc69ecfd6c20aa 100644
GIT binary patch
literal 216
zcmV;}04M(+iwFP!000003oA=5DPm+`VCVr77l1Si5Q{LNf(j^It>o+J=jj{j8}H%j
z>FyDtWR+K%lcS^L>llGWG|1IC#L>^)$5qKHTGv3&z`(%J+{Dz_$kNEv(9+Tb$S~8v
zB~FrXtd3HEzfYu(r=M$ZypOA&dx(dUl_5ef-q}CY59q9FrKHM|RR6TJ;?xo)D}&lv
z5wM@~5_405PE;yLEK1EQQHrfqK=%7TdjLP$ttfjCr3xg*D(T%XppOOh@+pokE@bZw61}kfq{XcxrwQkYT2S
zOPnO(SRExd{~%vSpv?w4N&)^pkv^V&uEFs>u72(z9!ge*2*G$~|4=`mx@x7Q%92$7
zw6x;X5}>ZyS_KiX|MC)ZQ-RJ^Do89!%_~ugtyMq{hky1A4h#-J5)POc{@a7#U;97*
c|3X=qIv5-nfhs|Ok%3qM0BXJQUYG#@0Et~>DF6Tf
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePolylinesWithBatchTable/ul.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePolylinesWithBatchTable/ul.vctr
index 46daa167ca4e3d86572fcdee85dab55fa19c399e..04f40718adf4cae19736b1aa2ea30660e19a3342 100644
GIT binary patch
delta 146
zcmV;D0B!%|0onl;ABzY80000001GQiE-7MUU|^U4BrcH_QFEmLf1gMnPe0e-cpq0k
z_Ye;yD?@}}yt99(AJAFVN=cO^ss3qc#i=DqRtB}TB49t|CFZ6Aov2h=P>@=rkdvBL
zq7+-Jfb9Q&@(c=Khy?!2gWzBJKmY&AL)a)m22roT$iM{VGBOYg0CP_#vXB7)0FLQ9
AN&o-=
delta 140
zcmV;70CWG^0ptM|ABzY80000001GQiE-7MUU|^U7B<_(GQBx&1{~%vSpv?w4N&)^p
zkv^V&uEFs>u72(z9!ge*2*G$~|4=`mx@x7Q%92$7w6x;X5}>ZyS_KiX|MC)ZQ-RJ^
uDlI5TEmFuyO)F7~tyMq{i;=Jt7QqKmufWK_1m-d_5DNeTo3kFA0RRBRhBt=*
diff --git a/Specs/Data/Cesium3DTiles/Vector/VectorTilePolylinesWithBatchTable/ur.vctr b/Specs/Data/Cesium3DTiles/Vector/VectorTilePolylinesWithBatchTable/ur.vctr
index d28144ef004e39f87951b6179af9c9e5e4a0231f..18ff2aa21d0260e48946259244b6b7de47db24aa 100644
GIT binary patch
delta 146
zcmV;D0B!%|0onl;ABzY80000001GQiE-7MUU|^U4BrcH_QFEmLf1gMnPe0e-cpq0k
z_Ye;yD?@}}yt99(AJAFVN=cO^ss3qc#i=DqRtB}TB49t|CFZ6Aov2h=P>@=rP?VXT
zQKA%E`>!4;02Dy*pFBcu72(z9!ge*2*G$~|4=`mx@x7Q%92$7w6x;X5}>ZyS_KiX|MC)ZQ-RJ^
zDlI5TEmA1TOwTA$imm-uj}#aRAox!nA;84&UmgPg{QnDOp#+}-1Tq3uf&e1}u>b(J
KAPY&H0RRBDP(4oo
diff --git a/Specs/Scene/Vector3DTileContentSpec.js b/Specs/Scene/Vector3DTileContentSpec.js
index 6c72b4832574..5de27e5c1c9d 100644
--- a/Specs/Scene/Vector3DTileContentSpec.js
+++ b/Specs/Scene/Vector3DTileContentSpec.js
@@ -51,42 +51,6 @@ defineSuite([
var tilesetRectangle = Rectangle.fromDegrees(-0.01, -0.01, 0.01, 0.01);
var combinedRectangle = Rectangle.fromDegrees(-0.02, -0.01, 0.02, 0.01);
- var vectorGeometryAll = './Data/Cesium3DTiles/Vector/VectorTileGeometryAll';
- var vectorGeometryAllBatchedChildren = './Data/Cesium3DTiles/Vector/VectorTileGeometryAllBatchedChildren';
- var vectorGeometryAllBatchedChildrenWithBatchTable = './Data/Cesium3DTiles/Vector/VectorTileGeometryAllBatchedChildrenWithBatchTable';
- var vectorGeometryAllWithBatchTable = './Data/Cesium3DTiles/Vector/VectorTileGeometryAllWithBatchTable';
- var vectorGeometryAllWithBatchIds = './Data/Cesium3DTiles/Vector/VectorTileGeometryAllWithBatchIds';
-
- var vectorGeometryBoxes = './Data/Cesium3DTiles/Vector/VectorTileGeometryBoxes';
- var vectorGeometryBoxesBatchedChildren = './Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesBatchedChildren';
- var vectorGeometryBoxesBatchedChildrenWithBatchTable = './Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesBatchedChildrenWithBatchTable';
- var vectorGeometryBoxesWithBatchTable = './Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesWithBatchTable';
- var vectorGeometryBoxesWithBatchIds = './Data/Cesium3DTiles/Vector/VectorTileGeometryBoxesWithBatchIds';
-
- var vectorGeometryCylinders = './Data/Cesium3DTiles/Vector/VectorTileGeometryCylinders';
- var vectorGeometryCylindersBatchedChildren = './Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersBatchedChildren';
- var vectorGeometryCylindersBatchedChildrenWithBatchTable = './Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersBatchedChildrenWithBatchTable';
- var vectorGeometryCylindersWithBatchTable = './Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersWithBatchTable';
- var vectorGeometryCylindersWithBatchIds = './Data/Cesium3DTiles/Vector/VectorTileGeometryCylindersWithBatchIds';
-
- var vectorGeometryEllipsoids = './Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoids';
- var vectorGeometryEllipsoidsBatchedChildren = './Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsBatchedChildren';
- var vectorGeometryEllipsoidsBatchedChildrenWithBatchTable = './Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsBatchedChildrenWithBatchTable';
- var vectorGeometryEllipsoidsWithBatchTable = './Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsWithBatchTable';
- var vectorGeometryEllipsoidsWithBatchIds = './Data/Cesium3DTiles/Vector/VectorTileGeometryEllipsoidsWithBatchIds';
-
- var vectorGeometrySpheres = './Data/Cesium3DTiles/Vector/VectorTileGeometrySpheres';
- var vectorGeometrySpheresBatchedChildren = './Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresBatchedChildren';
- var vectorGeometrySpheresBatchedChildrenWithBatchTable = './Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresBatchedChildrenWithBatchTable';
- var vectorGeometrySpheresWithBatchTable = './Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresWithBatchTable';
- var vectorGeometrySpheresWithBatchIds = './Data/Cesium3DTiles/Vector/VectorTileGeometrySpheresWithBatchIds';
-
- var vectorMesh = './Data/Cesium3DTiles/Vector/VectorTileMesh';
- var vectorMeshBatchedChildren = './Data/Cesium3DTiles/Vector/VectorTileMeshBatchedChildren';
- var vectorMeshBatchedChildrenWithBatchTable = './Data/Cesium3DTiles/Vector/VectorTileMeshBatchedChildrenWithBatchTable';
- var vectorMeshWithBatchTable = './Data/Cesium3DTiles/Vector/VectorTileMeshWithBatchTable';
- var vectorMeshWithBatchIds = './Data/Cesium3DTiles/Vector/VectorTileMeshWithBatchIds';
-
var vectorPoints = './Data/Cesium3DTiles/Vector/VectorTilePoints';
var vectorPointsBatchedChildren = './Data/Cesium3DTiles/Vector/VectorTilePointsBatchedChildren';
var vectorPointsBatchedChildrenWithBatchTable = './Data/Cesium3DTiles/Vector/VectorTilePointsBatchedChildrenWithBatchTable';
@@ -395,36 +359,19 @@ defineSuite([
}
function verifyPickCombined(scene) {
- var center = Rectangle.center(combinedRectangle);
var width = combinedRectangle.width;
- var step = width / 5;
- var halfStep = step * 0.5;
+ var step = width / 3;
var west = combinedRectangle.west;
var north = combinedRectangle.north;
var south = combinedRectangle.south;
- var meshRect = new Rectangle(west, south, west + step, north);
- var polygonRect = new Rectangle(west + step, south, west + 2 * step, north);
- var boxRect = new Rectangle(west + step * 2, center.latitude, west + step * 2 + halfStep, north);
- var cylinderRect = new Rectangle(west + step * 2 + halfStep, center.latitude, west + step * 3, north);
- var ellipsoidRect = new Rectangle(west + step * 2, south, west + step * 2 + halfStep, center.latitude);
- var sphereRect = new Rectangle(west + step * 2 + halfStep, south, west + step * 3, center.latitude);
- var polylineRect = new Rectangle(west + step * 3, south, west + step * 4, north);
- var pointRect = new Rectangle(west + step * 4, south, west + step * 5, north);
+ var polygonRect = new Rectangle(west, south, west + step, north);
+ var polylineRect = new Rectangle(west + step, south, west + step * 2, north);
+ var pointRect = new Rectangle(west + step * 2, south, west + step * 3, north);
- scene.camera.lookAt(ellipsoid.cartographicToCartesian(Rectangle.center(meshRect)), new Cartesian3(0.0, 0.0, 5.0));
- expectPick(scene);
scene.camera.lookAt(ellipsoid.cartographicToCartesian(Rectangle.center(polygonRect)), new Cartesian3(0.0, 0.0, 5.0));
expectPick(scene);
- scene.camera.lookAt(ellipsoid.cartographicToCartesian(Rectangle.center(boxRect)), new Cartesian3(0.0, 0.0, 5.0));
- expectPick(scene);
- scene.camera.lookAt(ellipsoid.cartographicToCartesian(Rectangle.center(cylinderRect)), new Cartesian3(0.0, 0.0, 5.0));
- expectPick(scene);
- scene.camera.lookAt(ellipsoid.cartographicToCartesian(Rectangle.center(ellipsoidRect)), new Cartesian3(0.0, 0.0, 5.0));
- expectPick(scene);
- scene.camera.lookAt(ellipsoid.cartographicToCartesian(Rectangle.center(sphereRect)), new Cartesian3(0.0, 0.0, 5.0));
- expectPick(scene);
scene.camera.lookAt(ellipsoid.cartographicToCartesian(Rectangle.northeast(polylineRect)), new Cartesian3(0.0, 0.0, 5.0));
expectPick(scene);
scene.camera.lookAt(ellipsoid.cartographicToCartesian(Rectangle.center(pointRect)), new Cartesian3(0.0, 0.0, 5.0));
@@ -454,36 +401,19 @@ defineSuite([
}
function expectRenderCombined(scene, color) {
- var center = Rectangle.center(combinedRectangle);
var width = combinedRectangle.width;
- var step = width / 5;
- var halfStep = step * 0.5;
+ var step = width / 3;
var west = combinedRectangle.west;
var north = combinedRectangle.north;
var south = combinedRectangle.south;
- var meshRect = new Rectangle(west, south, west + step, north);
- var polygonRect = new Rectangle(west + step, south, west + 2 * step, north);
- var boxRect = new Rectangle(west + step * 2, center.latitude, west + step * 2 + halfStep, north);
- var cylinderRect = new Rectangle(west + step * 2 + halfStep, center.latitude, west + step * 3, north);
- var ellipsoidRect = new Rectangle(west + step * 2, south, west + step * 2 + halfStep, center.latitude);
- var sphereRect = new Rectangle(west + step * 2 + halfStep, south, west + step * 3, center.latitude);
- var polylineRect = new Rectangle(west + step * 3, south, west + step * 4, north);
- var pointRect = new Rectangle(west + step * 4, south, west + step * 5, north);
+ var polygonRect = new Rectangle(west, south, west + step, north);
+ var polylineRect = new Rectangle(west + step, south, west + step * 2, north);
+ var pointRect = new Rectangle(west + step * 2, south, west + step * 3, north);
- scene.camera.lookAt(ellipsoid.cartographicToCartesian(Rectangle.center(meshRect)), new Cartesian3(0.0, 0.0, 5.0));
- expect(scene).toRender(color);
scene.camera.lookAt(ellipsoid.cartographicToCartesian(Rectangle.center(polygonRect)), new Cartesian3(0.0, 0.0, 5.0));
expect(scene).toRender(color);
- scene.camera.lookAt(ellipsoid.cartographicToCartesian(Rectangle.center(boxRect)), new Cartesian3(0.0, 0.0, 5.0));
- expect(scene).toRender(color);
- scene.camera.lookAt(ellipsoid.cartographicToCartesian(Rectangle.center(cylinderRect)), new Cartesian3(0.0, 0.0, 5.0));
- expect(scene).toRender(color);
- scene.camera.lookAt(ellipsoid.cartographicToCartesian(Rectangle.center(ellipsoidRect)), new Cartesian3(0.0, 0.0, 5.0));
- expect(scene).toRender(color);
- scene.camera.lookAt(ellipsoid.cartographicToCartesian(Rectangle.center(sphereRect)), new Cartesian3(0.0, 0.0, 5.0));
- expect(scene).toRender(color);
scene.camera.lookAt(ellipsoid.cartographicToCartesian(Rectangle.northeast(polylineRect)), new Cartesian3(0.0, 0.0, 5.0));
expect(scene).toRender(color);
scene.camera.lookAt(ellipsoid.cartographicToCartesian(Rectangle.center(pointRect)), new Cartesian3(0.0, 0.0, 5.0));
@@ -665,336 +595,6 @@ defineSuite([
});
});
- it('renders meshes', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorMesh
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
- it('renders batched meshes', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorMeshBatchedChildren
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
- it('renders meshes with a batch table', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorMeshWithBatchTable
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
- it('renders batched meshes with a batch table', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorMeshBatchedChildrenWithBatchTable
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
- it('renders meshes with batch ids', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorMeshWithBatchIds
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
- it('renders boxes', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorGeometryBoxes
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
- it('renders batched boxes', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorGeometryBoxesBatchedChildren
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
- it('renders boxes with a batch table', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorGeometryBoxesWithBatchTable
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
- it('renders batched boxes with a batch table', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorGeometryBoxesBatchedChildrenWithBatchTable
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
- it('renders boxes with batch ids', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorGeometryBoxesWithBatchIds
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
- it('renders cylinders', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorGeometryCylinders
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
- it('renders batched cylinders', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorGeometryCylindersBatchedChildren
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
- it('renders cylinders with a batch table', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorGeometryCylindersWithBatchTable
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
- it('renders batched cylinders with a batch table', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorGeometryCylindersBatchedChildrenWithBatchTable
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
- it('renders cylinders with batch ids', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorGeometryCylindersWithBatchIds
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
- it('renders ellipsoids', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorGeometryEllipsoids
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
- it('renders batched ellipsoids', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorGeometryEllipsoidsBatchedChildren
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
- it('renders ellipsoids with a batch table', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorGeometryEllipsoidsWithBatchTable
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
- it('renders batched ellipsoids with a batch table', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorGeometryEllipsoidsBatchedChildrenWithBatchTable
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
- it('renders ellipsoids with batch ids', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorGeometryEllipsoidsWithBatchIds
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
- it('renders spheres', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorGeometrySpheres
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
- it('renders batched spheres', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorGeometrySpheresBatchedChildren
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
- it('renders spheres with a batch table', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorGeometrySpheresWithBatchTable
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
- it('renders batched spheres with a batch table', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorGeometrySpheresBatchedChildrenWithBatchTable
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
- it('renders spheres with batch ids', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorGeometrySpheresWithBatchIds
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
- it('renders all geometries', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorGeometryAll
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
- it('renders batched all geometries', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorGeometryAllBatchedChildren
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
- it('renders all geometries with a batch table', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorGeometryAllWithBatchTable
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
- it('renders batched all geometries with a batch table', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorGeometryAllBatchedChildrenWithBatchTable
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
- it('renders all geometries with batch ids', function() {
- scene.primitives.add(depthPrimitive);
- tileset = scene.primitives.add(new Cesium3DTileset({
- url : vectorGeometryAllWithBatchIds
- }));
- return loadTileset(tileset).then(function(tileset) {
- verifyRender(tileset, scene);
- verifyPick(scene);
- });
- });
-
it('renders combined tile', function() {
scene.primitives.add(depthPrimitive);
tileset = scene.primitives.add(new Cesium3DTileset({
From 124d29015488265968236817472161af479cfa02 Mon Sep 17 00:00:00 2001
From: Dan Bagnell
Date: Wed, 6 Dec 2017 16:28:37 -0500
Subject: [PATCH 22/51] Add Geometry3DTileContent tests.
---
.../Geometry/GeometryTileAll/ll.geom | Bin 0 -> 119 bytes
.../Geometry/GeometryTileAll/lr.geom | Bin 0 -> 110 bytes
.../Geometry/GeometryTileAll/parent.geom | Bin 0 -> 100 bytes
.../Geometry/GeometryTileAll/tileset.json | 107 ++++
.../Geometry/GeometryTileAll/ul.geom | Bin 0 -> 112 bytes
.../Geometry/GeometryTileAll/ur.geom | Bin 0 -> 138 bytes
.../children.geom | Bin 0 -> 227 bytes
.../parent.geom | Bin 0 -> 100 bytes
.../tileset.json | 59 ++
.../children.geom | Bin 0 -> 212 bytes
.../parent.geom | Bin 0 -> 100 bytes
.../tileset.json | 59 ++
.../GeometryTileAllWithBatchIds/children.geom | Bin 0 -> 261 bytes
.../GeometryTileAllWithBatchIds/parent.geom | Bin 0 -> 117 bytes
.../GeometryTileAllWithBatchIds/tileset.json | 59 ++
.../GeometryTileAllWithBatchTable/ll.geom | Bin 0 -> 140 bytes
.../GeometryTileAllWithBatchTable/lr.geom | Bin 0 -> 130 bytes
.../GeometryTileAllWithBatchTable/parent.geom | Bin 0 -> 116 bytes
.../tileset.json | 107 ++++
.../GeometryTileAllWithBatchTable/ul.geom | Bin 0 -> 132 bytes
.../GeometryTileAllWithBatchTable/ur.geom | Bin 0 -> 158 bytes
.../Geometry/GeometryTileBoxes/ll.geom | Bin 0 -> 113 bytes
.../Geometry/GeometryTileBoxes/lr.geom | Bin 0 -> 112 bytes
.../Geometry/GeometryTileBoxes/parent.geom | Bin 0 -> 100 bytes
.../Geometry/GeometryTileBoxes/tileset.json | 107 ++++
.../Geometry/GeometryTileBoxes/ul.geom | Bin 0 -> 112 bytes
.../Geometry/GeometryTileBoxes/ur.geom | Bin 0 -> 111 bytes
.../children.geom | Bin 0 -> 126 bytes
.../parent.geom | Bin 0 -> 100 bytes
.../tileset.json | 59 ++
.../children.geom | Bin 0 -> 126 bytes
.../parent.geom | Bin 0 -> 100 bytes
.../tileset.json | 59 ++
.../children.geom | Bin 0 -> 152 bytes
.../GeometryTileBoxesWithBatchIds/parent.geom | Bin 0 -> 117 bytes
.../tileset.json | 59 ++
.../GeometryTileBoxesWithBatchTable/ll.geom | Bin 0 -> 133 bytes
.../GeometryTileBoxesWithBatchTable/lr.geom | Bin 0 -> 132 bytes
.../parent.geom | Bin 0 -> 116 bytes
.../tileset.json | 107 ++++
.../GeometryTileBoxesWithBatchTable/ul.geom | Bin 0 -> 132 bytes
.../GeometryTileBoxesWithBatchTable/ur.geom | Bin 0 -> 131 bytes
.../Geometry/GeometryTileCylinders/ll.geom | Bin 0 -> 153 bytes
.../Geometry/GeometryTileCylinders/lr.geom | Bin 0 -> 177 bytes
.../GeometryTileCylinders/parent.geom | Bin 0 -> 153 bytes
.../GeometryTileCylinders/tileset.json | 107 ++++
.../Geometry/GeometryTileCylinders/ul.geom | Bin 0 -> 169 bytes
.../Geometry/GeometryTileCylinders/ur.geom | Bin 0 -> 155 bytes
.../children.geom | Bin 0 -> 245 bytes
.../parent.geom | Bin 0 -> 144 bytes
.../tileset.json | 59 ++
.../children.geom | Bin 0 -> 267 bytes
.../parent.geom | Bin 0 -> 144 bytes
.../tileset.json | 59 ++
.../children.geom | Bin 0 -> 275 bytes
.../parent.geom | Bin 0 -> 157 bytes
.../tileset.json | 59 ++
.../ll.geom | Bin 0 -> 167 bytes
.../lr.geom | Bin 0 -> 163 bytes
.../parent.geom | Bin 0 -> 160 bytes
.../tileset.json | 107 ++++
.../ul.geom | Bin 0 -> 159 bytes
.../ur.geom | Bin 0 -> 175 bytes
.../Geometry/GeometryTileEllipsoids/ll.geom | Bin 0 -> 119 bytes
.../Geometry/GeometryTileEllipsoids/lr.geom | Bin 0 -> 118 bytes
.../GeometryTileEllipsoids/parent.geom | Bin 0 -> 106 bytes
.../GeometryTileEllipsoids/tileset.json | 107 ++++
.../Geometry/GeometryTileEllipsoids/ul.geom | Bin 0 -> 118 bytes
.../Geometry/GeometryTileEllipsoids/ur.geom | Bin 0 -> 117 bytes
.../children.geom | Bin 0 -> 133 bytes
.../parent.geom | Bin 0 -> 106 bytes
.../tileset.json | 59 ++
.../children.geom | Bin 0 -> 133 bytes
.../parent.geom | Bin 0 -> 106 bytes
.../tileset.json | 59 ++
.../children.geom | Bin 0 -> 155 bytes
.../parent.geom | Bin 0 -> 120 bytes
.../tileset.json | 59 ++
.../ll.geom | Bin 0 -> 140 bytes
.../lr.geom | Bin 0 -> 139 bytes
.../parent.geom | Bin 0 -> 123 bytes
.../tileset.json | 107 ++++
.../ul.geom | Bin 0 -> 139 bytes
.../ur.geom | Bin 0 -> 138 bytes
.../Geometry/GeometryTileSpheres/ll.geom | Bin 0 -> 110 bytes
.../Geometry/GeometryTileSpheres/lr.geom | Bin 0 -> 110 bytes
.../Geometry/GeometryTileSpheres/parent.geom | Bin 0 -> 97 bytes
.../Geometry/GeometryTileSpheres/tileset.json | 107 ++++
.../Geometry/GeometryTileSpheres/ul.geom | Bin 0 -> 109 bytes
.../Geometry/GeometryTileSpheres/ur.geom | Bin 0 -> 109 bytes
.../children.geom | Bin 0 -> 124 bytes
.../parent.geom | Bin 0 -> 97 bytes
.../tileset.json | 59 ++
.../children.geom | Bin 0 -> 124 bytes
.../parent.geom | Bin 0 -> 97 bytes
.../tileset.json | 59 ++
.../children.geom | Bin 0 -> 151 bytes
.../parent.geom | Bin 0 -> 113 bytes
.../tileset.json | 59 ++
.../GeometryTileSpheresWithBatchTable/ll.geom | Bin 0 -> 130 bytes
.../GeometryTileSpheresWithBatchTable/lr.geom | Bin 0 -> 130 bytes
.../parent.geom | Bin 0 -> 113 bytes
.../tileset.json | 107 ++++
.../GeometryTileSpheresWithBatchTable/ul.geom | Bin 0 -> 129 bytes
.../GeometryTileSpheresWithBatchTable/ur.geom | Bin 0 -> 129 bytes
Specs/Scene/Geometry3DTileContentSpec.js | 513 ++++++++++++++++++
106 files changed, 2468 insertions(+)
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileAll/ll.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileAll/lr.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileAll/parent.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileAll/tileset.json
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileAll/ul.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileAll/ur.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllBatchedChildren/children.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllBatchedChildren/parent.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllBatchedChildren/tileset.json
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllBatchedChildrenWithBatchTable/children.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllBatchedChildrenWithBatchTable/parent.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllBatchedChildrenWithBatchTable/tileset.json
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllWithBatchIds/children.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllWithBatchIds/parent.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllWithBatchIds/tileset.json
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllWithBatchTable/ll.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllWithBatchTable/lr.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllWithBatchTable/parent.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllWithBatchTable/tileset.json
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllWithBatchTable/ul.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllWithBatchTable/ur.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxes/ll.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxes/lr.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxes/parent.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxes/tileset.json
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxes/ul.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxes/ur.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesBatchedChildren/children.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesBatchedChildren/parent.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesBatchedChildren/tileset.json
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesBatchedChildrenWithBatchTable/children.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesBatchedChildrenWithBatchTable/parent.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesBatchedChildrenWithBatchTable/tileset.json
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesWithBatchIds/children.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesWithBatchIds/parent.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesWithBatchIds/tileset.json
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesWithBatchTable/ll.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesWithBatchTable/lr.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesWithBatchTable/parent.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesWithBatchTable/tileset.json
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesWithBatchTable/ul.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesWithBatchTable/ur.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileCylinders/ll.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileCylinders/lr.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileCylinders/parent.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileCylinders/tileset.json
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileCylinders/ul.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileCylinders/ur.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileCylindersBatchedChildren/children.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileCylindersBatchedChildren/parent.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileCylindersBatchedChildren/tileset.json
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileCylindersBatchedChildrenWithBatchTable/children.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileCylindersBatchedChildrenWithBatchTable/parent.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileCylindersBatchedChildrenWithBatchTable/tileset.json
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileCylindersWithBatchIds/children.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileCylindersWithBatchIds/parent.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileCylindersWithBatchIds/tileset.json
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileCylindersWithBatchTable/ll.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileCylindersWithBatchTable/lr.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileCylindersWithBatchTable/parent.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileCylindersWithBatchTable/tileset.json
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileCylindersWithBatchTable/ul.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileCylindersWithBatchTable/ur.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileEllipsoids/ll.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileEllipsoids/lr.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileEllipsoids/parent.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileEllipsoids/tileset.json
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileEllipsoids/ul.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileEllipsoids/ur.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileEllipsoidsBatchedChildren/children.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileEllipsoidsBatchedChildren/parent.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileEllipsoidsBatchedChildren/tileset.json
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileEllipsoidsBatchedChildrenWithBatchTable/children.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileEllipsoidsBatchedChildrenWithBatchTable/parent.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileEllipsoidsBatchedChildrenWithBatchTable/tileset.json
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileEllipsoidsWithBatchIds/children.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileEllipsoidsWithBatchIds/parent.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileEllipsoidsWithBatchIds/tileset.json
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileEllipsoidsWithBatchTable/ll.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileEllipsoidsWithBatchTable/lr.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileEllipsoidsWithBatchTable/parent.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileEllipsoidsWithBatchTable/tileset.json
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileEllipsoidsWithBatchTable/ul.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileEllipsoidsWithBatchTable/ur.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileSpheres/ll.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileSpheres/lr.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileSpheres/parent.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileSpheres/tileset.json
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileSpheres/ul.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileSpheres/ur.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileSpheresBatchedChildren/children.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileSpheresBatchedChildren/parent.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileSpheresBatchedChildren/tileset.json
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileSpheresBatchedChildrenWithBatchTable/children.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileSpheresBatchedChildrenWithBatchTable/parent.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileSpheresBatchedChildrenWithBatchTable/tileset.json
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileSpheresWithBatchIds/children.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileSpheresWithBatchIds/parent.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileSpheresWithBatchIds/tileset.json
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileSpheresWithBatchTable/ll.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileSpheresWithBatchTable/lr.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileSpheresWithBatchTable/parent.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileSpheresWithBatchTable/tileset.json
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileSpheresWithBatchTable/ul.geom
create mode 100644 Specs/Data/Cesium3DTiles/Geometry/GeometryTileSpheresWithBatchTable/ur.geom
create mode 100644 Specs/Scene/Geometry3DTileContentSpec.js
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAll/ll.geom b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAll/ll.geom
new file mode 100644
index 0000000000000000000000000000000000000000..9ea82f0234c6a709bb8669db9e7d2fdeb190c923
GIT binary patch
literal 119
zcmb2|=3oE=Zg2my=TlP>5+az6h&jArKBB`T5U}>itH+Ne1>U@WDJ1j$@vG-@j~1q+
zu4qwn$3UF%~x4GP51fO*e!$4!VZz2Lx5Gw)Z(5}5@s+RVRLxHbVP?oAYiSC%!7wgPo!ktKYsOG?$N@O)D_Ia
zL7P^Ed9Bj%{Oa$m?WY^K$!NveP>ZZ{tXJ+OoNr((=)SqCa5uwO*}_jHx4DH@uL})e
NV0b54<}d|l4FDc2EII%H
literal 0
HcmV?d00001
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAll/parent.geom b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAll/parent.geom
new file mode 100644
index 0000000000000000000000000000000000000000..a7bb938c66b8806f3f609287a35df2ae6490bf61
GIT binary patch
literal 100
zcmb2|=3oE=Zg2my=TlP>5@s+Sv2u9Bd_;#wAYkp2C-M)aWZpl1^<3`J!j#k%%z^=%
zR)u-3(((N2@2%~p8@S16#oADdtb0$H4)O5pZ`g5g9wW1Wepu}41q=+)CGPAqfQADA
DfzBo$
literal 0
HcmV?d00001
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAll/tileset.json b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAll/tileset.json
new file mode 100644
index 000000000000..4aed1065eb00
--- /dev/null
+++ b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAll/tileset.json
@@ -0,0 +1,107 @@
+{
+ "asset": {
+ "version": "0.0"
+ },
+ "geometricError": 500,
+ "root": {
+ "boundingVolume": {
+ "region": [
+ -0.00017453292519943296,
+ -0.00017453292519943296,
+ 0.00017453292519943296,
+ 0.00017453292519943296,
+ -1000,
+ 1000
+ ]
+ },
+ "transform": [
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 6378137,
+ 0,
+ 0,
+ 1
+ ],
+ "geometricError": 100,
+ "refine": "REPLACE",
+ "content": {
+ "url": "parent.geom"
+ },
+ "children": [
+ {
+ "boundingVolume": {
+ "region": [
+ -0.00017453292519943296,
+ 0,
+ 0,
+ 0.00017453292519943296,
+ -1000,
+ 1000
+ ]
+ },
+ "geometricError": 0,
+ "content": {
+ "url": "ul.geom"
+ }
+ },
+ {
+ "boundingVolume": {
+ "region": [
+ 0,
+ 0,
+ 0.00017453292519943296,
+ 0.00017453292519943296,
+ -1000,
+ 1000
+ ]
+ },
+ "geometricError": 0,
+ "content": {
+ "url": "ur.geom"
+ }
+ },
+ {
+ "boundingVolume": {
+ "region": [
+ -0.00017453292519943296,
+ -0.00017453292519943296,
+ 0,
+ 0,
+ -1000,
+ 1000
+ ]
+ },
+ "geometricError": 0,
+ "content": {
+ "url": "ll.geom"
+ }
+ },
+ {
+ "boundingVolume": {
+ "region": [
+ 0,
+ -0.00017453292519943296,
+ 0.00017453292519943296,
+ 0,
+ -1000,
+ 1000
+ ]
+ },
+ "geometricError": 0,
+ "content": {
+ "url": "lr.geom"
+ }
+ }
+ ]
+ }
+}
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAll/ul.geom b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAll/ul.geom
new file mode 100644
index 0000000000000000000000000000000000000000..53a18841da93496afdbd405cdd64b388f78153dc
GIT binary patch
literal 112
zcmb2|=3oE=Zg2my=TlP>5@s+Sv2u9Bd_;#wAYkp2C-M)aWZpl1^<3`J!j#k%%z^=%
zR)u-3(((N2@2%~p8@S16#oADdtaDG94)O5pZ`g5g9wYMuvCW~6?U*jTe)4jgxJp>;
Q>IDo8TW8$WoB^~50K$qcq5uE@
literal 0
HcmV?d00001
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAll/ur.geom b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAll/ur.geom
new file mode 100644
index 0000000000000000000000000000000000000000..18328e0e20b19a6fd54d7f928c563cb860b74dfe
GIT binary patch
literal 138
zcmV;50CoQ#iwFP!000003rkPU&t+s_V0Z$=CO|v^h*=mQpjyc}(#O-!#Wg56-pAF?
zJ;X!F%1{R(sAN^GlvG)g>YtWYoLZt}Wl&qIaMYa3g@NH05I5K}U;x}=wrboiAiYkW
sZhMi{t#~VUavdY4E{E?3aS%P@2ZYarqz1&Vu2oO~0MtWW5aa*=0EDzUssI20
literal 0
HcmV?d00001
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllBatchedChildren/children.geom b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllBatchedChildren/children.geom
new file mode 100644
index 0000000000000000000000000000000000000000..d3ddd86d4b4ea43b51d3753a1ccfb3f614bdda1b
GIT binary patch
literal 227
zcmV<90381xiwFP!000003rkPU&t+s_UYvL
zP_i=Afe0vBRVyV`mZbWpr4^@^C|McQ>L@u!`gr=exCWu9h6|$WFgF8garN=>3<&o3
zbV1RB5JlHyXkr1>6&&E<8ieX7s1Uk(BO{aA+N0)NE+EXn@C%3=>=`fsZZTUm?js<*
zPM&UiL1Gk`E{6>L#+>12i>y}yafK(!ZcLiho5@s+Sv2u9Bd_;#wAYkp2C-M)aWZpl1^<3`J!j#k%%z^=%
zR)u-3(((N2@2%~p8@S16#oADdtb0$H4)O5pZ`g5g9wW1Wepu}41q=+)CGPAqfQADA
DfzBo$
literal 0
HcmV?d00001
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllBatchedChildren/tileset.json b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllBatchedChildren/tileset.json
new file mode 100644
index 000000000000..d673ef8ee994
--- /dev/null
+++ b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllBatchedChildren/tileset.json
@@ -0,0 +1,59 @@
+{
+ "asset": {
+ "version": "0.0"
+ },
+ "geometricError": 500,
+ "root": {
+ "boundingVolume": {
+ "region": [
+ -0.00017453292519943296,
+ -0.00017453292519943296,
+ 0.00017453292519943296,
+ 0.00017453292519943296,
+ -1000,
+ 1000
+ ]
+ },
+ "transform": [
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 6378137,
+ 0,
+ 0,
+ 1
+ ],
+ "geometricError": 100,
+ "refine": "REPLACE",
+ "content": {
+ "url": "parent.geom"
+ },
+ "children": [
+ {
+ "boundingVolume": {
+ "region": [
+ -0.00017453292519943296,
+ -0.00017453292519943296,
+ 0.00017453292519943296,
+ 0.00017453292519943296,
+ -1000,
+ 1000
+ ]
+ },
+ "geometricError": 0,
+ "content": {
+ "url": "children.geom"
+ }
+ }
+ ]
+ }
+}
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllBatchedChildrenWithBatchTable/children.geom b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllBatchedChildrenWithBatchTable/children.geom
new file mode 100644
index 0000000000000000000000000000000000000000..827c70ff69c114d1b236e3b57ae11a6e80badb1b
GIT binary patch
literal 212
zcmV;_04x6=iwFP!000003rkPU&t+s_UYvL
zP_i=Afe0vBRVyV`mZbWpr4^@^C|McQ>L@u!`gr=exCWu9h6|$WFgF8garN=>3<&o3
zbV1RB5JlHyXkr1>6&&E<8ieX7s1Uk(BO{aA+N0)NE+EXn@C%3=>=`fsZZTUm?js<*
zPM&UiL1Gk`E{6>L#+>12+RKRRB>DQ7(6K9V0@=e<*m7k1Fmb$iRTi2Z8EZ
O1qA@p-9SrF0ssIq%2%TR
literal 0
HcmV?d00001
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllBatchedChildrenWithBatchTable/parent.geom b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllBatchedChildrenWithBatchTable/parent.geom
new file mode 100644
index 0000000000000000000000000000000000000000..a7bb938c66b8806f3f609287a35df2ae6490bf61
GIT binary patch
literal 100
zcmb2|=3oE=Zg2my=TlP>5@s+Sv2u9Bd_;#wAYkp2C-M)aWZpl1^<3`J!j#k%%z^=%
zR)u-3(((N2@2%~p8@S16#oADdtb0$H4)O5pZ`g5g9wW1Wepu}41q=+)CGPAqfQADA
DfzBo$
literal 0
HcmV?d00001
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllBatchedChildrenWithBatchTable/tileset.json b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllBatchedChildrenWithBatchTable/tileset.json
new file mode 100644
index 000000000000..d673ef8ee994
--- /dev/null
+++ b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllBatchedChildrenWithBatchTable/tileset.json
@@ -0,0 +1,59 @@
+{
+ "asset": {
+ "version": "0.0"
+ },
+ "geometricError": 500,
+ "root": {
+ "boundingVolume": {
+ "region": [
+ -0.00017453292519943296,
+ -0.00017453292519943296,
+ 0.00017453292519943296,
+ 0.00017453292519943296,
+ -1000,
+ 1000
+ ]
+ },
+ "transform": [
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 6378137,
+ 0,
+ 0,
+ 1
+ ],
+ "geometricError": 100,
+ "refine": "REPLACE",
+ "content": {
+ "url": "parent.geom"
+ },
+ "children": [
+ {
+ "boundingVolume": {
+ "region": [
+ -0.00017453292519943296,
+ -0.00017453292519943296,
+ 0.00017453292519943296,
+ 0.00017453292519943296,
+ -1000,
+ 1000
+ ]
+ },
+ "geometricError": 0,
+ "content": {
+ "url": "children.geom"
+ }
+ }
+ ]
+ }
+}
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllWithBatchIds/children.geom b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllWithBatchIds/children.geom
new file mode 100644
index 0000000000000000000000000000000000000000..a7d8bc01a9ab74766084caadafd2dedc17cbac7f
GIT binary patch
literal 261
zcmV+g0s8(QiwFP!000003rkPU&t+s_VEDwuz>olB6ag^{0|ZnnIr&Gp2FLrj`niXA
zC|McmKm?Sms+E!|OH%#Q(uz|{l&lPD!4mOKjv>w-@t!Ui3XCj`fJ&SreLVeKT!T;y
zgbSkUF*iffg3o9ZpgLC{AJ2ebf1o_F*$7c|U4|wW$hz5^k^`VRU%Ienf{yAYkp2C-M)aWZpl1^<3`J!j#k%%z^=%
zR)u-3(((N2@2%~p8@S161*`WFYs)r^>Lb;=5;P3VSFa5X2(ZYy_mt@n56}LF9S7$z
UGEYzn<24atSYM_2Xdlov0AgY-e*gdg
literal 0
HcmV?d00001
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllWithBatchIds/tileset.json b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllWithBatchIds/tileset.json
new file mode 100644
index 000000000000..d673ef8ee994
--- /dev/null
+++ b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllWithBatchIds/tileset.json
@@ -0,0 +1,59 @@
+{
+ "asset": {
+ "version": "0.0"
+ },
+ "geometricError": 500,
+ "root": {
+ "boundingVolume": {
+ "region": [
+ -0.00017453292519943296,
+ -0.00017453292519943296,
+ 0.00017453292519943296,
+ 0.00017453292519943296,
+ -1000,
+ 1000
+ ]
+ },
+ "transform": [
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 6378137,
+ 0,
+ 0,
+ 1
+ ],
+ "geometricError": 100,
+ "refine": "REPLACE",
+ "content": {
+ "url": "parent.geom"
+ },
+ "children": [
+ {
+ "boundingVolume": {
+ "region": [
+ -0.00017453292519943296,
+ -0.00017453292519943296,
+ 0.00017453292519943296,
+ 0.00017453292519943296,
+ -1000,
+ 1000
+ ]
+ },
+ "geometricError": 0,
+ "content": {
+ "url": "children.geom"
+ }
+ }
+ ]
+ }
+}
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllWithBatchTable/ll.geom b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllWithBatchTable/ll.geom
new file mode 100644
index 0000000000000000000000000000000000000000..10658d39e50b4b78fef0837a5db71b539106ff96
GIT binary patch
literal 140
zcmV;70CWEziwFP!000003rkPU&t+s_VAuh~7C`I+#1ae;P_5+ZB&uXpt&~(*lIow9R-9U*WMxoWtDvB8)SSx&gc%rq0da#p0|vk?W~;`1
u1gQ6jlc(EWkXW@+USe*ll2x=)PJVf6kwQ*tT8UC@tpWf%S#kZi0002RTs@uu
literal 0
HcmV?d00001
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllWithBatchTable/lr.geom b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllWithBatchTable/lr.geom
new file mode 100644
index 0000000000000000000000000000000000000000..4124f19fabbd4d9514cbf4f9e0cb74f5109bf01f
GIT binary patch
literal 130
zcmb2|=3oE=Zg2my=TlP>5+WFnusOV8IwHg)5U^H6=D|a$CsH!+AHRAo_h?~C>I!Dz
zpiQg7yjJOWe)ad(_R|gAWVB*!s72N})+_fC&Nna?bl+T6xSQdtY~iPp+uTB{!%lgh
i@eSS76?W>RzQ1me#wnlk8i8GFSs9+J5xlViXf*%^r8XG=
literal 0
HcmV?d00001
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllWithBatchTable/parent.geom b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllWithBatchTable/parent.geom
new file mode 100644
index 0000000000000000000000000000000000000000..e20d3e1cfd29181280bd61ac49e2e3d1e0476f7a
GIT binary patch
literal 116
zcmb2|=3oE=Zg2my=TlP>5+WFnSUJ35KBB}U5U}>i6ZwZyGVdS1dM@{9VM^)>X2F0>
ztHQii>3Dwi_ty5)4cuh3Vr{5J*1e}phj@7QH|#h#kC9nGKWy!k=`&`pN)cTfG9hBh
Utnfu5(W@C4vVWxBUjeiX07!5z9{>OV
literal 0
HcmV?d00001
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllWithBatchTable/tileset.json b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllWithBatchTable/tileset.json
new file mode 100644
index 000000000000..4aed1065eb00
--- /dev/null
+++ b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllWithBatchTable/tileset.json
@@ -0,0 +1,107 @@
+{
+ "asset": {
+ "version": "0.0"
+ },
+ "geometricError": 500,
+ "root": {
+ "boundingVolume": {
+ "region": [
+ -0.00017453292519943296,
+ -0.00017453292519943296,
+ 0.00017453292519943296,
+ 0.00017453292519943296,
+ -1000,
+ 1000
+ ]
+ },
+ "transform": [
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 6378137,
+ 0,
+ 0,
+ 1
+ ],
+ "geometricError": 100,
+ "refine": "REPLACE",
+ "content": {
+ "url": "parent.geom"
+ },
+ "children": [
+ {
+ "boundingVolume": {
+ "region": [
+ -0.00017453292519943296,
+ 0,
+ 0,
+ 0.00017453292519943296,
+ -1000,
+ 1000
+ ]
+ },
+ "geometricError": 0,
+ "content": {
+ "url": "ul.geom"
+ }
+ },
+ {
+ "boundingVolume": {
+ "region": [
+ 0,
+ 0,
+ 0.00017453292519943296,
+ 0.00017453292519943296,
+ -1000,
+ 1000
+ ]
+ },
+ "geometricError": 0,
+ "content": {
+ "url": "ur.geom"
+ }
+ },
+ {
+ "boundingVolume": {
+ "region": [
+ -0.00017453292519943296,
+ -0.00017453292519943296,
+ 0,
+ 0,
+ -1000,
+ 1000
+ ]
+ },
+ "geometricError": 0,
+ "content": {
+ "url": "ll.geom"
+ }
+ },
+ {
+ "boundingVolume": {
+ "region": [
+ 0,
+ -0.00017453292519943296,
+ 0.00017453292519943296,
+ 0,
+ -1000,
+ 1000
+ ]
+ },
+ "geometricError": 0,
+ "content": {
+ "url": "lr.geom"
+ }
+ }
+ ]
+ }
+}
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllWithBatchTable/ul.geom b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllWithBatchTable/ul.geom
new file mode 100644
index 0000000000000000000000000000000000000000..878252d7b1724436d4c392b5aea835d9a388eab0
GIT binary patch
literal 132
zcmV-~0DJ!*iwFP!000003rkPU&t+s_U|0jhIza3L#1ae;P_5+TAK@At@8jy{9^#>7
zWvBxYP_n94N~$bL^-oJHPAyTgGN`RpIBL%20>TUozks;Go&f{k7PD33J_6F~z)ER-zPJs{jDL1rP_U0002Rk~VVy
literal 0
HcmV?d00001
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllWithBatchTable/ur.geom b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileAllWithBatchTable/ur.geom
new file mode 100644
index 0000000000000000000000000000000000000000..8577a957d186e56a81b1ba68eb103aa13ea79a86
GIT binary patch
literal 158
zcmV;P0Ac?hiwFP!000003rkPU&t+s_VE6&VCO|v^h$R>xpjyc}(#O-!#Wg56-pAF?
zJ;X!F%1{R(sAN^GlvG)g>YtWYoLZt}Wl&qIaMYa3g@NH05I5K}U;x}=wrboiAiYkW
zZhJvuCxYcqu49C#08u-l5qxA2k%V1bA{ioHt(2FTo2q0LtyEf2kXocrl$oAUq7+*T
M094kXsrUc@0El%%JOBUy
literal 0
HcmV?d00001
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxes/ll.geom b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxes/ll.geom
new file mode 100644
index 0000000000000000000000000000000000000000..d202f19aa9abebc62ea463fc75d26a66394b3c6f
GIT binary patch
literal 113
zcmb2|=3oE=Zg2my=TlP>5@s+Sv2u9Bd_;#wAYkp2C-M)aWZpl1^<3`J!j#k%%z^=%
zR)u-3(((N2@2%~p8@S16#oADdtaDG94)O5pZ`g5g9wYMuvCW~6?U=4qA31qBSKnjJ
Rt}sVNhDCd~cg_IX1OV;SF9rYr
literal 0
HcmV?d00001
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxes/lr.geom b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxes/lr.geom
new file mode 100644
index 0000000000000000000000000000000000000000..3ae6ab10b1e942ecb676da57ac0a078f76fc18d8
GIT binary patch
literal 112
zcmb2|=3oE=Zg2my=TlP>5@s+Sv2u9Bd_;#wAYkp2C-M)aWZpl1^<3`J!j#k%%z^=%
zR)u-3(((N2@2%~p8@S16#oADdtaDG94)O5pZ`g5g9wYMuvCW~6*;
Q>IDo8US-zCGk_KW0KAVajsO4v
literal 0
HcmV?d00001
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxes/parent.geom b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxes/parent.geom
new file mode 100644
index 0000000000000000000000000000000000000000..a7bb938c66b8806f3f609287a35df2ae6490bf61
GIT binary patch
literal 100
zcmb2|=3oE=Zg2my=TlP>5@s+Sv2u9Bd_;#wAYkp2C-M)aWZpl1^<3`J!j#k%%z^=%
zR)u-3(((N2@2%~p8@S16#oADdtb0$H4)O5pZ`g5g9wW1Wepu}41q=+)CGPAqfQADA
DfzBo$
literal 0
HcmV?d00001
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxes/tileset.json b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxes/tileset.json
new file mode 100644
index 000000000000..4aed1065eb00
--- /dev/null
+++ b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxes/tileset.json
@@ -0,0 +1,107 @@
+{
+ "asset": {
+ "version": "0.0"
+ },
+ "geometricError": 500,
+ "root": {
+ "boundingVolume": {
+ "region": [
+ -0.00017453292519943296,
+ -0.00017453292519943296,
+ 0.00017453292519943296,
+ 0.00017453292519943296,
+ -1000,
+ 1000
+ ]
+ },
+ "transform": [
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 6378137,
+ 0,
+ 0,
+ 1
+ ],
+ "geometricError": 100,
+ "refine": "REPLACE",
+ "content": {
+ "url": "parent.geom"
+ },
+ "children": [
+ {
+ "boundingVolume": {
+ "region": [
+ -0.00017453292519943296,
+ 0,
+ 0,
+ 0.00017453292519943296,
+ -1000,
+ 1000
+ ]
+ },
+ "geometricError": 0,
+ "content": {
+ "url": "ul.geom"
+ }
+ },
+ {
+ "boundingVolume": {
+ "region": [
+ 0,
+ 0,
+ 0.00017453292519943296,
+ 0.00017453292519943296,
+ -1000,
+ 1000
+ ]
+ },
+ "geometricError": 0,
+ "content": {
+ "url": "ur.geom"
+ }
+ },
+ {
+ "boundingVolume": {
+ "region": [
+ -0.00017453292519943296,
+ -0.00017453292519943296,
+ 0,
+ 0,
+ -1000,
+ 1000
+ ]
+ },
+ "geometricError": 0,
+ "content": {
+ "url": "ll.geom"
+ }
+ },
+ {
+ "boundingVolume": {
+ "region": [
+ 0,
+ -0.00017453292519943296,
+ 0.00017453292519943296,
+ 0,
+ -1000,
+ 1000
+ ]
+ },
+ "geometricError": 0,
+ "content": {
+ "url": "lr.geom"
+ }
+ }
+ ]
+ }
+}
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxes/ul.geom b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxes/ul.geom
new file mode 100644
index 0000000000000000000000000000000000000000..53a18841da93496afdbd405cdd64b388f78153dc
GIT binary patch
literal 112
zcmb2|=3oE=Zg2my=TlP>5@s+Sv2u9Bd_;#wAYkp2C-M)aWZpl1^<3`J!j#k%%z^=%
zR)u-3(((N2@2%~p8@S16#oADdtaDG94)O5pZ`g5g9wYMuvCW~6?U*jTe)4jgxJp>;
Q>IDo8TW8$WoB^~50K$qcq5uE@
literal 0
HcmV?d00001
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxes/ur.geom b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxes/ur.geom
new file mode 100644
index 0000000000000000000000000000000000000000..89cf94f7c5051c3decbc5b20b84c3cfdfaf63e02
GIT binary patch
literal 111
zcmb2|=3oE=Zg2my=TlP>5@s+Sv2u9Bd_;#wAYkp2C-M)aWZpl1^<3`J!j#k%%z^=%
zR)u-3(((N2@2%~p8@S16#oADdtaDG94)O5pZ`g5g9wYMuvCW~6*iwFP!000003rkPU&t+s_V5k8SIzZY0NV70NK(&&Se}rprypOA&dx(dU
zm5B~SK*_3FDXFp~)jut*IJHE{%AmGZ;ix&63kWkX`~uh($
literal 0
HcmV?d00001
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesBatchedChildren/parent.geom b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesBatchedChildren/parent.geom
new file mode 100644
index 0000000000000000000000000000000000000000..a7bb938c66b8806f3f609287a35df2ae6490bf61
GIT binary patch
literal 100
zcmb2|=3oE=Zg2my=TlP>5@s+Sv2u9Bd_;#wAYkp2C-M)aWZpl1^<3`J!j#k%%z^=%
zR)u-3(((N2@2%~p8@S16#oADdtb0$H4)O5pZ`g5g9wW1Wepu}41q=+)CGPAqfQADA
DfzBo$
literal 0
HcmV?d00001
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesBatchedChildren/tileset.json b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesBatchedChildren/tileset.json
new file mode 100644
index 000000000000..d673ef8ee994
--- /dev/null
+++ b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesBatchedChildren/tileset.json
@@ -0,0 +1,59 @@
+{
+ "asset": {
+ "version": "0.0"
+ },
+ "geometricError": 500,
+ "root": {
+ "boundingVolume": {
+ "region": [
+ -0.00017453292519943296,
+ -0.00017453292519943296,
+ 0.00017453292519943296,
+ 0.00017453292519943296,
+ -1000,
+ 1000
+ ]
+ },
+ "transform": [
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 6378137,
+ 0,
+ 0,
+ 1
+ ],
+ "geometricError": 100,
+ "refine": "REPLACE",
+ "content": {
+ "url": "parent.geom"
+ },
+ "children": [
+ {
+ "boundingVolume": {
+ "region": [
+ -0.00017453292519943296,
+ -0.00017453292519943296,
+ 0.00017453292519943296,
+ 0.00017453292519943296,
+ -1000,
+ 1000
+ ]
+ },
+ "geometricError": 0,
+ "content": {
+ "url": "children.geom"
+ }
+ }
+ ]
+ }
+}
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesBatchedChildrenWithBatchTable/children.geom b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesBatchedChildrenWithBatchTable/children.geom
new file mode 100644
index 0000000000000000000000000000000000000000..c23803f577e0a7083abc5d72c3ab50722a5b7232
GIT binary patch
literal 126
zcmV-^0D=D>iwFP!000003rkPU&t+s_V5k8SIzZY0NV70NK(&&Se}rprypOA&dx(dU
zm5B~SK*_3FDXFp~)jut*IJHE{%AmGZ;ix&63kWkX`~uh($
literal 0
HcmV?d00001
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesBatchedChildrenWithBatchTable/parent.geom b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesBatchedChildrenWithBatchTable/parent.geom
new file mode 100644
index 0000000000000000000000000000000000000000..a7bb938c66b8806f3f609287a35df2ae6490bf61
GIT binary patch
literal 100
zcmb2|=3oE=Zg2my=TlP>5@s+Sv2u9Bd_;#wAYkp2C-M)aWZpl1^<3`J!j#k%%z^=%
zR)u-3(((N2@2%~p8@S16#oADdtb0$H4)O5pZ`g5g9wW1Wepu}41q=+)CGPAqfQADA
DfzBo$
literal 0
HcmV?d00001
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesBatchedChildrenWithBatchTable/tileset.json b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesBatchedChildrenWithBatchTable/tileset.json
new file mode 100644
index 000000000000..d673ef8ee994
--- /dev/null
+++ b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesBatchedChildrenWithBatchTable/tileset.json
@@ -0,0 +1,59 @@
+{
+ "asset": {
+ "version": "0.0"
+ },
+ "geometricError": 500,
+ "root": {
+ "boundingVolume": {
+ "region": [
+ -0.00017453292519943296,
+ -0.00017453292519943296,
+ 0.00017453292519943296,
+ 0.00017453292519943296,
+ -1000,
+ 1000
+ ]
+ },
+ "transform": [
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 6378137,
+ 0,
+ 0,
+ 1
+ ],
+ "geometricError": 100,
+ "refine": "REPLACE",
+ "content": {
+ "url": "parent.geom"
+ },
+ "children": [
+ {
+ "boundingVolume": {
+ "region": [
+ -0.00017453292519943296,
+ -0.00017453292519943296,
+ 0.00017453292519943296,
+ 0.00017453292519943296,
+ -1000,
+ 1000
+ ]
+ },
+ "geometricError": 0,
+ "content": {
+ "url": "children.geom"
+ }
+ }
+ ]
+ }
+}
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesWithBatchIds/children.geom b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesWithBatchIds/children.geom
new file mode 100644
index 0000000000000000000000000000000000000000..f2dc508d2225d2250d4b83d93f74df67975e3567
GIT binary patch
literal 152
zcmb2|=3oE=Zg2my=TlP>5+WE?m>RaQPDo2^Xvk7k|Icy#L4|y{{dWO=Rc&F}j)qC0
zTZ4j9Jy+F7MHOasPMYed8=-XXq~Vd9%J(j_IyY`?^vqq`bSSV`Ph21^;Rovx-fuh-
z4BKa{mHI9?Ax_5^k^`VRU%Ienf{yAYkp2C-M)aWZpl1^<3`J!j#k%%z^=%
zR)u-3(((N2@2%~p8@S161*`WFYs)r^>Lb;=5;P3VSFa5X2(ZYy_mt@n56}LF9S7$z
UGEYzn<24atSYM_2Xdlov0AgY-e*gdg
literal 0
HcmV?d00001
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesWithBatchIds/tileset.json b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesWithBatchIds/tileset.json
new file mode 100644
index 000000000000..d673ef8ee994
--- /dev/null
+++ b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesWithBatchIds/tileset.json
@@ -0,0 +1,59 @@
+{
+ "asset": {
+ "version": "0.0"
+ },
+ "geometricError": 500,
+ "root": {
+ "boundingVolume": {
+ "region": [
+ -0.00017453292519943296,
+ -0.00017453292519943296,
+ 0.00017453292519943296,
+ 0.00017453292519943296,
+ -1000,
+ 1000
+ ]
+ },
+ "transform": [
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 6378137,
+ 0,
+ 0,
+ 1
+ ],
+ "geometricError": 100,
+ "refine": "REPLACE",
+ "content": {
+ "url": "parent.geom"
+ },
+ "children": [
+ {
+ "boundingVolume": {
+ "region": [
+ -0.00017453292519943296,
+ -0.00017453292519943296,
+ 0.00017453292519943296,
+ 0.00017453292519943296,
+ -1000,
+ 1000
+ ]
+ },
+ "geometricError": 0,
+ "content": {
+ "url": "children.geom"
+ }
+ }
+ ]
+ }
+}
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesWithBatchTable/ll.geom b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesWithBatchTable/ll.geom
new file mode 100644
index 0000000000000000000000000000000000000000..6c9bbfeaa92c0fdea1f2c9af40e8c2a03dce6cba
GIT binary patch
literal 133
zcmb2|=3oE=Zg2my=TlP>5+az7SUJ35J|e^;5U}>i6ZwZyGVdS1dM@{9VM^)>X2F0>
ztHQii>3Dwi_ty5)4cuh3Vr{5J*14xlhj@7QH|#h#kCFL-*yhm3c1%~QkDR=mtM9QU
lN>ks^JoKbil&1QAo2?#->ZWU5G`EE@GN{LW3s?iR9RQ_}G(-RZ
literal 0
HcmV?d00001
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesWithBatchTable/lr.geom b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesWithBatchTable/lr.geom
new file mode 100644
index 0000000000000000000000000000000000000000..c650b3048ac012cdc5d9fdcf3c580d2133e69b2d
GIT binary patch
literal 132
zcmV-~0DJ!*iwFP!000003rkPU&t+s_U|0jhIza3L#1ae;P_5+TAK@At@8jy{9^#>7
zWvBxYP_n94N~$bL^-oJHPAyTgGN`RpIBL%20>TUozks;Go&f{k7PD332I)QG8I{TMGdGA-)Ez0002lSU21N
literal 0
HcmV?d00001
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesWithBatchTable/parent.geom b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesWithBatchTable/parent.geom
new file mode 100644
index 0000000000000000000000000000000000000000..e20d3e1cfd29181280bd61ac49e2e3d1e0476f7a
GIT binary patch
literal 116
zcmb2|=3oE=Zg2my=TlP>5+WFnSUJ35KBB}U5U}>i6ZwZyGVdS1dM@{9VM^)>X2F0>
ztHQii>3Dwi_ty5)4cuh3Vr{5J*1e}phj@7QH|#h#kC9nGKWy!k=`&`pN)cTfG9hBh
Utnfu5(W@C4vVWxBUjeiX07!5z9{>OV
literal 0
HcmV?d00001
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesWithBatchTable/tileset.json b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesWithBatchTable/tileset.json
new file mode 100644
index 000000000000..4aed1065eb00
--- /dev/null
+++ b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesWithBatchTable/tileset.json
@@ -0,0 +1,107 @@
+{
+ "asset": {
+ "version": "0.0"
+ },
+ "geometricError": 500,
+ "root": {
+ "boundingVolume": {
+ "region": [
+ -0.00017453292519943296,
+ -0.00017453292519943296,
+ 0.00017453292519943296,
+ 0.00017453292519943296,
+ -1000,
+ 1000
+ ]
+ },
+ "transform": [
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 6378137,
+ 0,
+ 0,
+ 1
+ ],
+ "geometricError": 100,
+ "refine": "REPLACE",
+ "content": {
+ "url": "parent.geom"
+ },
+ "children": [
+ {
+ "boundingVolume": {
+ "region": [
+ -0.00017453292519943296,
+ 0,
+ 0,
+ 0.00017453292519943296,
+ -1000,
+ 1000
+ ]
+ },
+ "geometricError": 0,
+ "content": {
+ "url": "ul.geom"
+ }
+ },
+ {
+ "boundingVolume": {
+ "region": [
+ 0,
+ 0,
+ 0.00017453292519943296,
+ 0.00017453292519943296,
+ -1000,
+ 1000
+ ]
+ },
+ "geometricError": 0,
+ "content": {
+ "url": "ur.geom"
+ }
+ },
+ {
+ "boundingVolume": {
+ "region": [
+ -0.00017453292519943296,
+ -0.00017453292519943296,
+ 0,
+ 0,
+ -1000,
+ 1000
+ ]
+ },
+ "geometricError": 0,
+ "content": {
+ "url": "ll.geom"
+ }
+ },
+ {
+ "boundingVolume": {
+ "region": [
+ 0,
+ -0.00017453292519943296,
+ 0.00017453292519943296,
+ 0,
+ -1000,
+ 1000
+ ]
+ },
+ "geometricError": 0,
+ "content": {
+ "url": "lr.geom"
+ }
+ }
+ ]
+ }
+}
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesWithBatchTable/ul.geom b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesWithBatchTable/ul.geom
new file mode 100644
index 0000000000000000000000000000000000000000..878252d7b1724436d4c392b5aea835d9a388eab0
GIT binary patch
literal 132
zcmV-~0DJ!*iwFP!000003rkPU&t+s_U|0jhIza3L#1ae;P_5+TAK@At@8jy{9^#>7
zWvBxYP_n94N~$bL^-oJHPAyTgGN`RpIBL%20>TUozks;Go&f{k7PD33J_6F~z)ER-zPJs{jDL1rP_U0002Rk~VVy
literal 0
HcmV?d00001
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesWithBatchTable/ur.geom b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileBoxesWithBatchTable/ur.geom
new file mode 100644
index 0000000000000000000000000000000000000000..e379f53b128fc4d3abcff10a8538188a11597a99
GIT binary patch
literal 131
zcmb2|=3oE=Zg2my=TlP>5+az7SUJ35J|e^;5U}>i6ZwZyGVdS1dM@{9VM^)>X2F0>
ztHQii>3Dwi_ty5)4cuh3Vr{5J*14xlhj@7QH|#h#kCFL-*yhm3Y_Cf{mE7hQS{-)E
j`;2esrmiq8T@4T2AdOQ#=QRSm*0M6BS49M_0on}!UJEq7
literal 0
HcmV?d00001
diff --git a/Specs/Data/Cesium3DTiles/Geometry/GeometryTileCylinders/ll.geom b/Specs/Data/Cesium3DTiles/Geometry/GeometryTileCylinders/ll.geom
new file mode 100644
index 0000000000000000000000000000000000000000..00b4dcc1bae0577767fee87a4848798c2a4869fb
GIT binary patch
literal 153
zcmV;K0A~LmiwFP!000003rkPU&t+s_V0Z$=CO|v^h*=mQpjyc}(#O-!#Wg56-pAF?
zJ;X!F%1{R(sAN^GlvG)g>YtWYoLZt}Wl&qIaMYa3g@NH05I5K}U;x}=wrbo*fO?NO
zdAjXIRmZ3RavumgXBH)E9KU#S9gtH1rFTH-hLaHb1eDIH49hIeEJ>}dRZsu`Exn&%
H