Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into parallels-and-merid…
Browse files Browse the repository at this point in the history
…ians
  • Loading branch information
lilleyse committed Apr 4, 2020
2 parents f8e5539 + 4f72902 commit b58e790
Show file tree
Hide file tree
Showing 60 changed files with 597 additions and 365 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"overrides": [
{
"files": [
"index.js",
"index.cjs",
"server.cjs",
"gulpfile.js",
"Source/Workers/transferTypedArrayTest.js"
Expand Down
5 changes: 5 additions & 0 deletions .gulp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"flags": {
"gulpfile": "gulpfile.cjs"
}
}
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ script:

# Various Node.js smoke-screen tests
- node -e "const Cesium = require('./');"
- NODE_ENV=development node index.js
- NODE_ENV=production node index.js
- NODE_ENV=development node index.cjs
- NODE_ENV=production node index.cjs

- npm --silent run cloc
15 changes: 14 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
Change Log
==========

### 1.69.0 - 2020-05-01

##### Fixes :wrench:

* Fixed several problems with polylines when the logarithmic depth buffer is enabled, which is the default on most systems. [#8706](https://github.com/CesiumGS/cesium/pull/8706)

### 1.68.0 - 2020-04-01

##### Additions :tada:

* Added basic underground rendering support. When the camera is underground the globe will be rendered as a solid surface and underground entities will not be culled. [#8572](https://github.com/AnalyticalGraphicsInc/cesium/pull/8572)
* The `CesiumUnminified` build now includes sourcemaps. [#8572](https://github.com/CesiumGS/cesium/pull/8659)
* Added the ability to edit CesiumJS shaders on-the-fly using the [SpectorJS](https://spector.babylonjs.com/) Shader Editor. [#8608](https://github.com/CesiumGS/cesium/pull/8608)

##### Fixes :wrench:

* Interacting with the Cesium canvas will now blur the previously focused element. This prevents unintended modification of input elements when interacting with the globe.
* Cesium can now be used in Node.JS 12 and later, with or without `--experimental-modules`. It can still be used in earlier versions as well. [#8572](https://github.com/CesiumGS/cesium/pull/8659)
* Interacting with the Cesium canvas will now blur the previously focused element. This prevents unintended modification of input elements when interacting with the globe. [#8662](https://github.com/CesiumGS/cesium/pull/8662)
* `TileMapServiceImageryProvider` will now force `minimumLevel` to 0 if the `tilemapresource.xml` metadata request fails and the `rectangle` is too large for the given detail level [#8448](https://github.com/AnalyticalGraphicsInc/cesium/pull/8448)
* Fixed ground atmosphere rendering when using a smaller ellipsoid. [#8683](https://github.com/CesiumGS/cesium/issues/8683)
* Fixed globe incorrectly occluding objects when using a smaller ellipsoid. [#7124](https://github.com/CesiumGS/cesium/issues/7124)
* Fixed a regression introduced in 1.67 which caused overlapping colored ground geometry to have visual artifacts. [#8694](https://github.com/CesiumGS/cesium/pull/8694)
* Fixed a clipping problem when viewing a polyline up close with the logarithmic depth buffer enabled, which is the default on most systems. [#8703](https://github.com/CesiumGS/cesium/pull/8703)

### 1.67.0 - 2020-03-02

Expand Down
4 changes: 3 additions & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
* [Omar Shehata](https://github.com/OmarShehata)
* [Matt Petry](https://github.com/MattPetry)
* [Michael Squires](https://github.com/mksquires)
* [Sam Suhag](https://github.com/sanjeetsuhag)
* [NICTA/CSIRO's Data61](https://www.data61.csiro.au/)
* [Kevin Ring](https://github.com/kring)
* [Keith Grochow](https://github.com/kgrochow)
Expand Down Expand Up @@ -117,6 +116,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
* [Jeremy Marzano](https://github.com/JeremyMarzano-ISPA/)
* [Orbit Logic](http://www.orbitlogic.com)
* [Roderick Green](https://github.com/roderickgreen/)
* [Sam Parrish](https://github.com/sgparrish/)
* [Hexastack](https://www.hexastack.com)
* [Mohamed Marrouchi](https://github.com/marrouchi/)
* [PropellerAero](https://www.propelleraero.com/)
Expand All @@ -141,6 +141,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
* [Peter Gagliardi](https://github.com/ptrgags)
* [Ian Lilley](https://github.com/IanLilleyT)
* [Samuel Vargas](https://github.com/Samulus)
* [Sam Suhag](https://github.com/sanjeetsuhag)
* [Northrop Grumman](http://www.northropgrumman.com)
* [Joseph Stein](https://github.com/nahgrin)
* [EOX IT Services GmbH](https://eox.at)
Expand Down Expand Up @@ -249,3 +250,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
* [Julian Fell](https://github.com/jtfell)
* [Richard Becker](https://github.com/richard3d)
* [Daniel Leone](https://github.com/danielleone)
* [Zhou Jiang](https://github.com/aboutqx)
4 changes: 2 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ Copyright 2011-2020 CesiumJS Contributors
See the License for the specific language governing permissions and
limitations under the License.

Patents US9153063B2 US9865085B1
Patents US9153063B2 US9865085B1 US10592242

Patents pending US15/829,786 US16/516,997 US62/837,358 US62/837,381
Patents pending US15/829,786 US62/837,358 US62/837,381

Third-Party Code
================
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</p>

[![Build Status](https://travis-ci.org/CesiumGS/cesium.svg?branch=master)](https://travis-ci.org/CesiumGS/cesium)&nbsp;
[![Docs](https://img.shields.io/badge/docs-online-orange.svg)](https://cesium.com/docs/) [![Greenkeeper badge](https://badges.greenkeeper.io/CesiumGS/cesium.svg)](https://greenkeeper.io/)
[![Docs](https://img.shields.io/badge/docs-online-orange.svg)](https://cesium.com/docs/)

CesiumJS is a JavaScript library for creating 3D globes and 2D maps in a web browser without a plugin. It uses WebGL for hardware-accelerated graphics, and is cross-platform, cross-browser, and tuned for dynamic-data visualization.

Expand Down
Binary file modified Source/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Source/Assets/Textures/SkyBox/tycho2t3_80_my.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Source/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Source/Assets/Textures/SkyBox/tycho2t3_80_px.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Source/Assets/Textures/SkyBox/tycho2t3_80_py.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Source/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions Source/Core/Ion.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import defined from './defined.js';
import Resource from './Resource.js';

var defaultTokenCredit;
var defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhZmRiYzgzMy1hODQ3LTRkMDktYjE0Ni0zNTViMTdmNGEyZWEiLCJpZCI6MjU5LCJzY29wZXMiOlsiYXNyIiwiZ2MiXSwiaWF0IjoxNTgzMTYzMTYwfQ.blu_ATsUNqSYK0fIBrNRvxq9HiCzY5Ul_4v_4-3F5QY';

var defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIwZGE4MzljNy1iNjVkLTQ1YmYtYmQ1MC0wNjUwYmEyYjQ3OWEiLCJpZCI6MjU5LCJzY29wZXMiOlsiYXNyIiwiZ2MiXSwiaWF0IjoxNTg1NzQ2MTM0fQ.2IfAIAuWWqz4C5NVq8sSTWqfrWkw1bjYW3RflwlpCuo';
/**
* Default settings for accessing the Cesium ion API.
* @exports Ion
Expand Down
3 changes: 3 additions & 0 deletions Source/DataSources/KmlDataSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -1352,6 +1352,9 @@ import WallGraphics from './WallGraphics.js';
if (defined(zIndex)) {
oneTimeWarning('kml-gx:drawOrder', 'KML - gx:drawOrder is not supported in LineStrings when clampToGround is false');
}
if (dataSource._clampToGround && !tessellate) {
oneTimeWarning('kml-line-tesselate', 'Ignoring clampToGround for KML lines without the tessellate flag.');
}

polyline = defined(polyline) ? polyline.clone() : new PolylineGraphics();
entity.polyline = polyline;
Expand Down
69 changes: 40 additions & 29 deletions Source/DataSources/StaticGroundGeometryColorBatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ import ShowGeometryInstanceAttribute from '../Core/ShowGeometryInstanceAttribute
import GroundPrimitive from '../Scene/GroundPrimitive.js';
import BoundingSphereState from './BoundingSphereState.js';
import Property from './Property.js';
import RectangleCollisionChecker from '../Core/RectangleCollisionChecker.js';

var colorScratch = new Color();
var distanceDisplayConditionScratch = new DistanceDisplayCondition();
var defaultDistanceDisplayCondition = new DistanceDisplayCondition();

function Batch(primitives, classificationType, color, key, zIndex) {
function Batch(primitives, classificationType, color, zIndex) {
this.primitives = primitives;
this.zIndex = zIndex;
this.classificationType = classificationType;
this.color = color;
this.key = key;
this.createPrimitive = false;
this.waitingOnCreate = false;
this.primitive = undefined;
Expand All @@ -31,13 +31,19 @@ import Property from './Property.js';
this.showsUpdated = new AssociativeArray();
this.itemsToRemove = [];
this.isDirty = false;
this.rectangleCollisionCheck = new RectangleCollisionChecker();
}

Batch.prototype.overlapping = function(rectangle) {
return this.rectangleCollisionCheck.collides(rectangle);
};

Batch.prototype.add = function(updater, instance) {
var id = updater.id;
this.createPrimitive = true;
this.geometry.set(id, instance);
this.updaters.set(id, updater);
this.rectangleCollisionCheck.insert(id, instance.geometry.rectangle);
if (!updater.hasConstantFill || !updater.fillMaterialProperty.isConstant || !Property.isConstant(updater.distanceDisplayConditionProperty)) {
this.updatersWithAttributes.set(id, updater);
} else {
Expand All @@ -52,8 +58,10 @@ import Property from './Property.js';

Batch.prototype.remove = function(updater) {
var id = updater.id;
var geometryInstance = this.geometry.get(id);
this.createPrimitive = this.geometry.remove(id) || this.createPrimitive;
if (this.updaters.remove(id)) {
this.rectangleCollisionCheck.remove(id, geometryInstance.geometry.rectangle);
this.updatersWithAttributes.remove(id);
var unsubscribe = this.subscriptions.get(id);
if (defined(unsubscribe)) {
Expand Down Expand Up @@ -227,33 +235,39 @@ import Property from './Property.js';
* @private
*/
function StaticGroundGeometryColorBatch(primitives, classificationType) {
this._batches = new AssociativeArray();
this._batches = [];
this._primitives = primitives;
this._classificationType = classificationType;
}

StaticGroundGeometryColorBatch.prototype.add = function(time, updater) {
var instance = updater.createFillGeometryInstance(time);
var batches = this._batches;
// zIndex is a batch breaker, so we'll use that for the key
var zIndex = Property.getValueOrDefault(updater.zIndex, 0);
var batchKey = zIndex;
var batch;
if (batches.contains(batchKey)) {
batch = batches.get(batchKey);
} else {
batch = new Batch(this._primitives, this._classificationType, instance.attributes.color.value, batchKey, zIndex);
batches.set(batchKey, batch);
var length = batches.length;
for (var i = 0; i < length; ++i) {
var item = batches[i];
if (item.zIndex === zIndex &&
!item.overlapping(instance.geometry.rectangle)) {
batch = item;
break;
}
}

if (!defined(batch)) {
batch = new Batch(this._primitives, this._classificationType, instance.attributes.color.value, zIndex);
batches.push(batch);
}
batch.add(updater, instance);
return batch;
};

StaticGroundGeometryColorBatch.prototype.remove = function(updater) {
var batchesArray = this._batches.values;
var count = batchesArray.length;
var batches = this._batches;
var count = batches.length;
for (var i = 0; i < count; ++i) {
if (batchesArray[i].remove(updater)) {
if (batches[i].remove(updater)) {
return;
}
}
Expand All @@ -266,15 +280,14 @@ import Property from './Property.js';
//Perform initial update
var isUpdated = true;
var batches = this._batches;
var batchesArray = batches.values;
var batchCount = batchesArray.length;
var batchCount = batches.length;
for (i = 0; i < batchCount; ++i) {
isUpdated = batchesArray[i].update(time) && isUpdated;
isUpdated = batches[i].update(time) && isUpdated;
}

//If any items swapped between batches we need to move them
for (i = 0; i < batchCount; ++i) {
var oldBatch = batchesArray[i];
var oldBatch = batches[i];
var itemsToRemove = oldBatch.itemsToRemove;
var itemsToMoveLength = itemsToRemove.length;
for (var j = 0; j < itemsToMoveLength; j++) {
Expand All @@ -287,27 +300,25 @@ import Property from './Property.js';
}

//If we moved anything around, we need to re-build the primitive and remove empty batches
var batchesArrayCopy = batchesArray.slice();
var batchesCopyCount = batchesArrayCopy.length;
for (i = 0; i < batchesCopyCount; ++i) {
var batch = batchesArrayCopy[i];
for (i = batchCount - 1; i >= 0; --i) {
var batch = batches[i];
if (batch.isDirty) {
isUpdated = batchesArrayCopy[i].update(time) && isUpdated;
isUpdated = batches[i].update(time) && isUpdated;
batch.isDirty = false;
}
if (batch.geometry.length === 0) {
batches.remove(batch.key);
batches.splice(i, 1);
}
}

return isUpdated;
};

StaticGroundGeometryColorBatch.prototype.getBoundingSphere = function(updater, result) {
var batchesArray = this._batches.values;
var batchCount = batchesArray.length;
var batches = this._batches;
var batchCount = batches.length;
for (var i = 0; i < batchCount; ++i) {
var batch = batchesArray[i];
var batch = batches[i];
if (batch.contains(updater)) {
return batch.getBoundingSphere(updater, result);
}
Expand All @@ -317,10 +328,10 @@ import Property from './Property.js';
};

StaticGroundGeometryColorBatch.prototype.removeAllPrimitives = function() {
var batchesArray = this._batches.values;
var batchCount = batchesArray.length;
var batches = this._batches;
var batchCount = batches.length;
for (var i = 0; i < batchCount; ++i) {
batchesArray[i].removeAllPrimitives();
batches[i].removeAllPrimitives();
}
};
export default StaticGroundGeometryColorBatch;
28 changes: 28 additions & 0 deletions Source/Renderer/AutomaticUniforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -1864,6 +1864,34 @@ import WebGLConstants from '../Core/WebGLConstants.js';
getValue : function(uniformState) {
return uniformState.gamma;
}
}),

/**
* An automatic GLSL uniform that stores the ellipsoid radii.
*
* @alias czm_ellipsoidRadii
* @glslUniform
*/
czm_ellipsoidRadii : new AutomaticUniform({
size : 1,
datatype : WebGLConstants.FLOAT_VEC3,
getValue : function(uniformState) {
return uniformState.ellipsoid.radii;
}
}),

/**
* An automatic GLSL uniform that stores the ellipsoid inverse radii.
*
* @alias czm_ellipsoidRadii
* @glslUniform
*/
czm_ellipsoidInverseRadii : new AutomaticUniform({
size : 1,
datatype : WebGLConstants.FLOAT_VEC3,
getValue : function(uniformState) {
return uniformState.ellipsoid.oneOverRadii;
}
})
};
export default AutomaticUniforms;
7 changes: 7 additions & 0 deletions Source/Renderer/Sampler.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,11 @@ import TextureWrap from './TextureWrap.js';
(left._magnificationFilter === right._magnificationFilter) &&
(left._maximumAnisotropy === right._maximumAnisotropy));
};

Sampler.NEAREST = Object.freeze(new Sampler({
wrapS : TextureWrap.CLAMP_TO_EDGE,
wrapT : TextureWrap.CLAMP_TO_EDGE,
minificationFilter : TextureMinificationFilter.NEAREST,
magnificationFilter : TextureMagnificationFilter.NEAREST
}));
export default Sampler;
Loading

0 comments on commit b58e790

Please sign in to comment.