Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into velocityOrientation
Browse files Browse the repository at this point in the history
  • Loading branch information
shunter committed Sep 5, 2017
2 parents 78f149c + 411944b commit 6f9e013
Show file tree
Hide file tree
Showing 22 changed files with 80 additions and 160 deletions.
6 changes: 3 additions & 3 deletions Apps/Sandcastle/gallery/Video.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
<div id="toolbar"></div>

<video id="trailer" style="display: none;" autoplay loop crossorigin controls>
<source src="http://cesiumjs.org/videos/Sandcastle/big-buck-bunny_trailer.webm" type="video/webm">
<source src="http://cesiumjs.org/videos/Sandcastle/big-buck-bunny_trailer.mp4" type="video/mp4">
<source src="http://cesiumjs.org/videos/Sandcastle/big-buck-bunny_trailer.mov" type="video/quicktime">
<source src="https://cesiumjs.org/videos/Sandcastle/big-buck-bunny_trailer.webm" type="video/webm">
<source src="https://cesiumjs.org/videos/Sandcastle/big-buck-bunny_trailer.mp4" type="video/mp4">
<source src="https://cesiumjs.org/videos/Sandcastle/big-buck-bunny_trailer.mov" type="video/quicktime">
Your browser does not support the <code>video</code> element.
</video>
<script id="cesium_sandcastle_script">
Expand Down
28 changes: 17 additions & 11 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,28 @@ Change Log

### 1.37 - 2017-09-01

* Fixed `Entity` id type to be `String` in `EntityCollection` and `CompositeEntityCollection` [#5791](https://github.com/AnalyticalGraphicsInc/cesium/pull/579)
* Fixed `replaceState` bug that was causing the `CesiumViewer` demo application to crash in Safari and iOS
* Fixed issue where `Model` and `BillboardCollection` would throw an error if the globe is undefined [#5638](https://github.com/AnalyticalGraphicsInc/cesium/issues/5638)
* Breaking changes
* Passing `options.clock` when creating a new `Viewer` instance is removed, pass `options.clockViewModel` instead.
* Removed `GoogleEarthImageryProvider`, use `GoogleEarthEnterpriseMapsProvider` instead.
* Removed the `throttleRequest` parameter from `TerrainProvider.requestTileGeometry` and inherited terrain providers. It is replaced with an optional `Request` object. Set the request's `throttle` property to `true` to throttle requests.
* Removed the ability to provide a Promise for the `options.url` parameter of `loadWithXhr` and for the `url` parameter of `loadArrayBuffer`, `loadBlob`, `loadImageViaBlob`, `loadText`, `loadJson`, `loadXML`, `loadImage`, `loadCRN`, `loadKTX`, and `loadCubeMap`. Instead `url` must be a string.
* Added `classificationType` to `ClassificationPrimitive` and `GroundPrimitive` to choose whether terrain, 3D Tiles, or both are classified. [#5770](https://github.com/AnalyticalGraphicsInc/cesium/pull/5770)
* Fixed depth picking on 3D Tiles. [#5676](https://github.com/AnalyticalGraphicsInc/cesium/issues/5676)
* Fixed glTF model translucency bug. [#5731](https://github.com/AnalyticalGraphicsInc/cesium/issues/5731)
* Fixed `replaceState` bug that was causing the `CesiumViewer` demo application to crash in Safari and iOS. [#5691](https://github.com/AnalyticalGraphicsInc/cesium/issues/5691)
* Fixed a 3D Tiles traversal bug for tilesets using additive refinement. [#5766](https://github.com/AnalyticalGraphicsInc/cesium/issues/5766)
* Fixed a 3D Tiles traversal bug where out-of-view children were being loaded unnecessarily. [#5477](https://github.com/AnalyticalGraphicsInc/cesium/issues/5477)
* Fixed `Entity` id type to be `String` in `EntityCollection` and `CompositeEntityCollection` [#5791](https://github.com/AnalyticalGraphicsInc/cesium/pull/5791)
* Fixed issue where `Model` and `BillboardCollection` would throw an error if the globe is undefined. [#5638](https://github.com/AnalyticalGraphicsInc/cesium/issues/5638)
* Fixed issue where the `Model` glTF cache loses reference to the model's buffer data. [#5720](https://github.com/AnalyticalGraphicsInc/cesium/issues/5720)
* Fixed some issues with `disableDepthTestDistance` [#5501](https://github.com/AnalyticalGraphicsInc/cesium/issues/5501) [#5331](https://github.com/AnalyticalGraphicsInc/cesium/issues/5331) [#5621](https://github.com/AnalyticalGraphicsInc/cesium/issues/5621)
* Added several new Bing Maps styles: `CANVAS_DARK`, `CANVAS_LIGHT`, and `CANVAS_GRAY`.
* Fixed some issues with `disableDepthTestDistance`. [#5501](https://github.com/AnalyticalGraphicsInc/cesium/issues/5501) [#5331](https://github.com/AnalyticalGraphicsInc/cesium/issues/5331) [#5621](https://github.com/AnalyticalGraphicsInc/cesium/issues/5621)
* Added several new Bing Maps styles: `CANVAS_DARK`, `CANVAS_LIGHT`, and `CANVAS_GRAY`. [#5737](https://github.com/AnalyticalGraphicsInc/cesium/pull/5737)
* Added small improvements to the atmosphere. [#5741](https://github.com/AnalyticalGraphicsInc/cesium/pull/5741)
* Fixed a bug that caused imagery splitting to work incorrectly when CSS pixels were not equivalent to WebGL drawing buffer pixels, such as on high DPI displays in Microsoft Edge and Internet Explorer.
* Fixed a bug that caused imagery splitting to work incorrectly when CSS pixels were not equivalent to WebGL drawing buffer pixels, such as on high DPI displays in Microsoft Edge and Internet Explorer. [#5743](https://github.com/AnalyticalGraphicsInc/cesium/pull/5743)
* Added `Cesium3DTileset.loadJson` to support overriding the default tileset loading behavior. [#5685](https://github.com/AnalyticalGraphicsInc/cesium/pull/5685)
* Fixed loading of binary glTFs containing CRN or KTX textures. [#5753](https://github.com/AnalyticalGraphicsInc/cesium/pull/5753)
* Fixed specular computation for certain models using the `KHR_materials_common` extension. [#5773](https://github.com/AnalyticalGraphicsInc/cesium/pull/5773)
* Fixed a bug where developer error was thrown in Sandcastle example [#5703](https://github.com/AnalyticalGraphicsInc/cesium/issues/5703)
* Fixed a 3D Tiles traversal bug for tilesets using additive refinement. [#5766](https://github.com/AnalyticalGraphicsInc/cesium/issues/5766)
* Fixed depth picking on 3D Tiles. [#5676](https://github.com/AnalyticalGraphicsInc/cesium/issues/5676)
* Fixed glTF model translucency bug. [#5731](https://github.com/AnalyticalGraphicsInc/cesium/issues/5731)
* Added `classificationType` to `ClassificationPrimitive` and `GroundPrimitive` to choose whether terrain, 3D Tiles, or both are classified. [#5683](https://github.com/AnalyticalGraphicsInc/cesium/issues/5676)
* Fixed a picking bug in the `3D Tiles Interactivity` Sandcastle demo. [#5703](https://github.com/AnalyticalGraphicsInc/cesium/issues/5703)

### 1.36 - 2017-08-01

Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
* [Jason Crow](https://github.com/jason-crow)
* [Flightradar24 AB](https://www.flightradar24.com)
* [Aleksei Kalmykov](https://github.com/kalmykov)
* [virtualcitySYSTEMS GmbH](https://www.virtualcitysystems.de)
* [Jannes Bolling](https://github.com/jbo023)

## [Individual CLA](Documentation/Contributors/CLAs/individual-cla-agi-v1.0.txt)
* [Victor Berchet](https://github.com/vicb)
Expand Down
11 changes: 0 additions & 11 deletions Source/Core/CesiumTerrainProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ define([
'./defaultValue',
'./defined',
'./defineProperties',
'./deprecationWarning',
'./DeveloperError',
'./Event',
'./GeographicTilingScheme',
Expand All @@ -33,7 +32,6 @@ define([
defaultValue,
defined,
defineProperties,
deprecationWarning,
DeveloperError,
Event,
GeographicTilingScheme,
Expand Down Expand Up @@ -531,15 +529,6 @@ define([
extensionList.push('watermask');
}

if (typeof request === 'boolean') {
deprecationWarning('throttleRequests', 'The throttleRequest parameter for requestTileGeometry was deprecated in Cesium 1.35. It will be removed in 1.37.');
request = new Request({
throttle : request,
throttleByServer : request,
type : RequestType.TERRAIN
});
}

var promise = loadArrayBuffer(url, getRequestHeader(extensionList), request);

if (!defined(promise)) {
Expand Down
11 changes: 0 additions & 11 deletions Source/Core/GoogleEarthEnterpriseTerrainProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ define([
'./defaultValue',
'./defined',
'./defineProperties',
'./deprecationWarning',
'./DeveloperError',
'./Event',
'./GeographicTilingScheme',
Expand All @@ -27,7 +26,6 @@ define([
defaultValue,
defined,
defineProperties,
deprecationWarning,
DeveloperError,
Event,
GeographicTilingScheme,
Expand Down Expand Up @@ -446,15 +444,6 @@ define([
sharedPromise = terrainPromises[q];
sharedRequest = terrainRequests[q];
} else { // Create new request for terrain
if (typeof request === 'boolean') {
deprecationWarning('throttleRequests', 'The throttleRequest parameter for requestTileGeometry was deprecated in Cesium 1.35. It will be removed in 1.37.');
request = new Request({
throttle : request,
throttleByServer : request,
type : RequestType.TERRAIN
});
}

sharedRequest = request;
var requestPromise = loadArrayBuffer(url, undefined, sharedRequest);

Expand Down
1 change: 1 addition & 0 deletions Source/Core/TerrainProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ define([
* @see EllipsoidTerrainProvider
* @see CesiumTerrainProvider
* @see VRTheWorldTerrainProvider
* @see GoogleEarthEnterpriseTerrainProvider
*/
function TerrainProvider() {
DeveloperError.throwInstantiationError();
Expand Down
11 changes: 0 additions & 11 deletions Source/Core/VRTheWorldTerrainProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ define([
'./defaultValue',
'./defined',
'./defineProperties',
'./deprecationWarning',
'./DeveloperError',
'./Ellipsoid',
'./Event',
Expand All @@ -25,7 +24,6 @@ define([
defaultValue,
defined,
defineProperties,
deprecationWarning,
DeveloperError,
Ellipsoid,
Event,
Expand Down Expand Up @@ -279,15 +277,6 @@ define([
url = proxy.getURL(url);
}

if (typeof request === 'boolean') {
deprecationWarning('throttleRequests', 'The throttleRequest parameter for requestTileGeometry was deprecated in Cesium 1.35. It will be removed in 1.37.');
request = new Request({
throttle : request,
throttleByServer : request,
type : RequestType.TERRAIN
});
}

var promise = loadImage(url, undefined, request);
if (!defined(promise)) {
return undefined;
Expand Down
15 changes: 0 additions & 15 deletions Source/Core/loadImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ define([
'./Check',
'./defaultValue',
'./defined',
'./deprecationWarning',
'./DeveloperError',
'./isCrossOriginUrl',
'./isDataUri',
Expand All @@ -15,7 +14,6 @@ define([
Check,
defaultValue,
defined,
deprecationWarning,
DeveloperError,
isCrossOriginUrl,
isDataUri,
Expand Down Expand Up @@ -61,19 +59,6 @@ define([

allowCrossOrigin = defaultValue(allowCrossOrigin, true);

if (typeof url !== 'string') {
// Returning a promise here is okay because it is unlikely that anyone using the deprecated functionality is also
// providing a Request object marked as throttled.
deprecationWarning('url promise', 'url as a Promise is deprecated and will be removed in 1.37');
return url.then(function(url) {
return makeRequest(url, allowCrossOrigin, request);
});
}

return makeRequest(url, allowCrossOrigin, request);
}

function makeRequest(url, allowCrossOrigin, request) {
request = defined(request) ? request : new Request();
request.url = url;
request.requestFunction = function() {
Expand Down
15 changes: 0 additions & 15 deletions Source/Core/loadWithXhr.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ define([
'./Check',
'./defaultValue',
'./defined',
'./deprecationWarning',
'./DeveloperError',
'./Request',
'./RequestErrorEvent',
Expand All @@ -15,7 +14,6 @@ define([
Check,
defaultValue,
defined,
deprecationWarning,
DeveloperError,
Request,
RequestErrorEvent,
Expand Down Expand Up @@ -70,19 +68,6 @@ define([

var url = options.url;

if (typeof url !== 'string') {
// Returning a promise here is okay because it is unlikely that anyone using the deprecated functionality is also
// providing a Request object marked as throttled.
deprecationWarning('url promise', 'options.url as a Promise is deprecated and will be removed in Cesium 1.37');
return url.then(function(url) {
return makeRequest(options, url);
});
}

return makeRequest(options);
}

function makeRequest(options, url) {
var responseType = options.responseType;
var method = defaultValue(options.method, 'GET');
var data = options.data;
Expand Down
4 changes: 2 additions & 2 deletions Source/Renderer/Pass.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ define([
ENVIRONMENT : 0,
COMPUTE : 1,
GLOBE : 2,
CESIUM_3D_TILE : 3,
TERRAIN_CLASSIFICATION : 4,
TERRAIN_CLASSIFICATION : 3,
CESIUM_3D_TILE : 4,
CESIUM_3D_TILE_CLASSIFICATION : 5,
OPAQUE : 6,
TRANSLUCENT : 7,
Expand Down
53 changes: 29 additions & 24 deletions Source/Scene/Cesium3DTilesetTraversal.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ define([
return;
}

loadTile(tileset, root, frameState);
loadTile(tileset, root, frameState, true);

if (!tileset.skipLevelOfDetail) {
// just execute base traversal and add tiles to _desiredTiles
Expand Down Expand Up @@ -313,7 +313,7 @@ define([
var replacementWithContent = tile.refine === Cesium3DTileRefine.REPLACE && tile.hasRenderableContent;
for (var i = 0; i < childrenLength; ++i) {
var child = children[i];
loadTile(tileset, child, frameState);
loadTile(tileset, child, frameState, true);
touch(tileset, child, outOfCore);

// content cannot be replaced until all of the nearest descendants with content are all loaded
Expand Down Expand Up @@ -413,7 +413,7 @@ define([
var childrenLength = children.length;
for (var i = 0; i < childrenLength; ++i) {
var child = children[i];
loadTile(tileset, child, frameState);
loadTile(tileset, child, frameState, true);
touch(tileset, child, outOfCore);
if (!tile.contentAvailable) {
this.allLoaded = false;
Expand Down Expand Up @@ -507,8 +507,12 @@ define([
}

if (!tile.hasTilesetContent) {
if (hasAdditiveContent(tile)) {
tileset._desiredTiles.push(tile);
if (tile.refine === Cesium3DTileRefine.ADD) {
// Always load additive tiles
loadTile(tileset, tile, this.frameState);
if (hasAdditiveContent(tile)) {
tileset._desiredTiles.push(tile);
}
}

// stop traversal when we've attained the desired level of error
Expand Down Expand Up @@ -540,12 +544,7 @@ define([
var children = tile.children;
var childrenLength = children.length;
for (var i = 0; i < childrenLength; ++i) {
var child = children[i];
if (child.refine === Cesium3DTileRefine.ADD && isVisible(child._visibilityPlaneMask)) {
// Additive refinement tiles are always loaded when they are reached
loadTile(tileset, child, this.frameState);
}
touch(tileset, child, this.outOfCore);
touch(tileset, children[i], this.outOfCore);
}
return children;
}
Expand All @@ -554,14 +553,7 @@ define([
};

InternalSkipTraversal.prototype.shouldVisit = function(tile) {
var maximumScreenSpaceError = this.tileset._maximumScreenSpaceError;
var parent = tile.parent;
if (!defined(parent)) {
return isVisible(tile._visibilityPlaneMask);
}
var showAdditive = parent.refine === Cesium3DTileRefine.ADD && parent._screenSpaceError > maximumScreenSpaceError;

return isVisible(tile._visibilityPlaneMask) && (!showAdditive || getScreenSpaceError(this.tileset, parent.geometricError, tile, this.frameState) > maximumScreenSpaceError);
return isVisibleAndMeetsSSE(this.tileset, tile, this.frameState);
};

InternalSkipTraversal.prototype.leafHandler = function(tile) {
Expand All @@ -576,11 +568,11 @@ define([
var tiles = parent.children;
var length = tiles.length;
for (var i = 0; i < length; ++i) {
loadTile(this.tileset, tiles[i], this.frameState);
loadTile(this.tileset, tiles[i], this.frameState, false);
touch(this.tileset, tiles[i], this.outOfCore);
}
} else {
loadTile(this.tileset, tile, this.frameState);
loadTile(this.tileset, tile, this.frameState, true);
touch(this.tileset, tile, this.outOfCore);
}
}
Expand Down Expand Up @@ -643,10 +635,12 @@ define([
}
}

function loadTile(tileset, tile, frameState) {
function loadTile(tileset, tile, frameState, checkVisibility) {
if ((tile.contentUnloaded || tile.contentExpired) && tile._requestedFrame !== frameState.frameNumber) {
tile._requestedFrame = frameState.frameNumber;
tileset._requestedTiles.push(tile);
if (!checkVisibility || isVisibleAndMeetsSSE(tileset, tile, frameState)) {
tile._requestedFrame = frameState.frameNumber;
tileset._requestedTiles.push(tile);
}
}
}

Expand Down Expand Up @@ -741,6 +735,17 @@ define([
return visibilityPlaneMask !== CullingVolume.MASK_OUTSIDE;
}

function isVisibleAndMeetsSSE(tileset, tile, frameState) {
var maximumScreenSpaceError = tileset._maximumScreenSpaceError;
var parent = tile.parent;
if (!defined(parent)) {
return isVisible(tile._visibilityPlaneMask);
}
var showAdditive = parent.refine === Cesium3DTileRefine.ADD && parent._screenSpaceError > maximumScreenSpaceError;

return isVisible(tile._visibilityPlaneMask) && (!showAdditive || getScreenSpaceError(tileset, parent.geometricError, tile, frameState) > maximumScreenSpaceError);
}

function childrenAreVisible(tile) {
// optimization does not apply for additive refinement
return tile.refine === Cesium3DTileRefine.ADD || tile.children.length === 0 || tile._childrenVisibility & Cesium3DTileChildrenVisibility.VISIBLE !== 0;
Expand Down
Loading

0 comments on commit 6f9e013

Please sign in to comment.