Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into noReproject
Browse files Browse the repository at this point in the history
  • Loading branch information
kring committed Sep 29, 2016
2 parents 23dc61d + ae118d5 commit 32c4117
Show file tree
Hide file tree
Showing 34 changed files with 506 additions and 1,048 deletions.
9 changes: 6 additions & 3 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ Change Log

* Breaking changes
* Vertex texture fetch is now required to be supported to render polylines. Maximum vertex texture image units must be greater than zero.
* Removed `castShadows` and `receiveShadows` properties from `Model`, `Primitive`, and `Globe`. Instead, use `shadows` with the `ShadowMode` enum, e.g. `model.shadows = ShadowMode.ENABLED`.
* `Viewer.terrainShadows` now uses the `ShadowMode` enum instead of a Boolean, e.g. `viewer.terrainShadows = ShadowMode.RECEIVE_ONLY`.
* Removed the default gamma correction for Bing Maps aerial imagery, because it is no longer an improvement to current versions of the tiles. To restore the previous look, set the `defaultGamma` property of your `BingMapsImageryProvider` instance to 1.3.
* Fixed billboard rotation when sized in meters. [#3979](https://github.com/AnalyticalGraphicsInc/cesium/issues/3979)
* Fixed timeline touch events. [#4305](https://github.com/AnalyticalGraphicsInc/cesium/pull/4305)
* Fixed a bug that could lead to incorrect terrain heights when using `HeightmapTerrainData` with an encoding in which actual heights were equal to the minimum representable height.
* Fixed a bug in `AttributeCompression.compressTextureCoordinates` and `decompressTextureCoordinates` that could cause a small inaccuracy in the encoded texture coordinates.
* Added `DebugCameraPrimitive` to visualize the view frustum of a camera.
* Fixed touch events for the timeline [#4305](https://github.com/AnalyticalGraphicsInc/cesium/pull/4305)
* Removed the default gamma correction for Bing Maps aerial imagery, because we no longer think it is an improvement in current versions of the tiles. To restore the previous look, set the `defaultGamma` property of your `BingMapsImageryProvider` instance to 1.3.
* Added `Rectangle.simpleIntersection`.
* Fixed a bug that could lead to incorrect terrain heights when using `HeightmapTerrainData` with an encoding in which actual heights were equal to the minimum representable height.
* Removed an unnecessary reprojection of Web Mercator imagery tiles to the Geographic projection on load. This should improve both visual quality and load performance slightly.

### 1.25 - 2016-09-01
Expand Down
22 changes: 12 additions & 10 deletions Source/Core/AttributeCompression.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ define([
* @param {Cartesian3} vector The normalized vector to be compressed into 2 byte 'oct' encoding.
* @param {Cartesian2} result The 2 byte oct-encoded unit length vector.
* @returns {Cartesian2} The 2 byte oct-encoded unit length vector.
*
*
* @exception {DeveloperError} vector must be normalized.
*
*
* @see AttributeCompression.octEncodeInRange
* @see AttributeCompression.octDecode
*/
Expand Down Expand Up @@ -124,14 +124,14 @@ define([

/**
* Decodes a unit-length vector in 2 byte 'oct' encoding to a normalized 3-component vector.
*
*
* @param {Number} x The x component of the oct-encoded unit length vector.
* @param {Number} y The y component of the oct-encoded unit length vector.
* @param {Cartesian3} result The decoded and normalized vector.
* @returns {Cartesian3} The decoded and normalized vector.
*
*
* @exception {DeveloperError} x and y must be an unsigned normalized integer between 0 and 255.
*
*
* @see AttributeCompression.octDecodeInRange
*/
AttributeCompression.octDecode = function(x, y, result) {
Expand Down Expand Up @@ -268,7 +268,7 @@ define([
/**
* Pack texture coordinates into a single float. The texture coordinates will only preserve 12 bits of precision.
*
* @param {Cartesian2} textureCoordinates The texture coordinates to compress
* @param {Cartesian2} textureCoordinates The texture coordinates to compress. Both coordinates must be in the range 0.0-1.0.
* @returns {Number} The packed texture coordinates.
*
*/
Expand All @@ -279,8 +279,9 @@ define([
}
//>>includeEnd('debug');

var x = textureCoordinates.x === 1.0 ? 4095.0 : (textureCoordinates.x * 4096.0) | 0;
var y = textureCoordinates.y === 1.0 ? 4095.0 : (textureCoordinates.y * 4096.0) | 0;
// Move x and y to the range 0-4095;
var x = (textureCoordinates.x * 4095.0) | 0;
var y = (textureCoordinates.y * 4095.0) | 0;
return 4096.0 * x + y;
};

Expand All @@ -303,8 +304,9 @@ define([
//>>includeEnd('debug');

var temp = compressed / 4096.0;
result.x = Math.floor(temp) / 4096.0;
result.y = temp - Math.floor(temp);
var xZeroTo4095 = Math.floor(temp);
result.x = xZeroTo4095 / 4095.0;
result.y = (compressed - xZeroTo4095 * 4096) / 4095;
return result;
};

Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Geometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ define([
/**
* @private
*/
this.boundingSphereCV = undefined;
this.boundingSphereCV = options.boundingSphereCV;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/GeometryPipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ define([
var instance = instances[i];
if (defined(instance.geometry)) {
instanceGeometry.push(instance);
} else {
} else if (defined(instance.westHemisphereGeometry) && defined(instance.eastHemisphereGeometry)) {
instanceSplitGeometry.push(instance);
}
}
Expand Down
2 changes: 0 additions & 2 deletions Source/DataSources/CzmlDataSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -1409,8 +1409,6 @@ define([
processPacketData(Number, model, 'maximumScale', modelData.maximumScale, interval, sourceUri, entityCollection);
processPacketData(Boolean, model, 'incrementallyLoadTextures', modelData.incrementallyLoadTextures, interval, sourceUri, entityCollection);
processPacketData(Boolean, model, 'runAnimations', modelData.runAnimations, interval, sourceUri, entityCollection);
processPacketData(Boolean, model, 'castShadows', modelData.castShadows, interval, sourceUri, entityCollection);
processPacketData(Boolean, model, 'receiveShadows', modelData.receiveShadows, interval, sourceUri, entityCollection);
processPacketData(ShadowMode, model, 'shadows', modelData.shadows, interval, sourceUri, entityCollection);
processPacketData(HeightReference, model, 'heightReference', modelData.heightReference, interval, sourceUri, entityCollection);

Expand Down
28 changes: 0 additions & 28 deletions Source/DataSources/ModelGraphics.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ define([
* @param {Property} [options.incrementallyLoadTextures=true] Determine if textures may continue to stream in after the model is loaded.
* @param {Property} [options.runAnimations=true] A boolean Property specifying if glTF animations specified in the model should be started.
* @param {Property} [options.nodeTransformations] An object, where keys are names of nodes, and values are {@link TranslationRotationScale} Properties describing the transformation to apply to that node.
* @param {Property} [options.castShadows=true] Deprecated, use options.shadows instead. A boolean Property specifying whether the model casts shadows from each light source.
* @param {Property} [options.receiveShadows=true] Deprecated, use options.shadows instead. A boolean Property specifying whether the model receives shadows from shadow casters in the scene.
* @param {Property} [options.shadows=ShadowMode.ENABLED] An enum Property specifying whether the model casts or receives shadows from each light source.
* @param {Property} [options.heightReference=HeightReference.NONE] A Property specifying what the height is relative to.
*
Expand All @@ -66,10 +64,6 @@ define([
this._maximumScaleSubscription = undefined;
this._incrementallyLoadTextures = undefined;
this._incrementallyLoadTexturesSubscription = undefined;
this._castShadows = undefined;
this._castShadowsSubscription = undefined;
this._receiveShadows = undefined;
this._receiveShadowsSubscription = undefined;
this._shadows = undefined;
this._shadowsSubscription = undefined;
this._uri = undefined;
Expand Down Expand Up @@ -144,24 +138,6 @@ define([
*/
incrementallyLoadTextures : createPropertyDescriptor('incrementallyLoadTextures'),

/**
* Get or sets the boolean Property specifying whether the model
* casts shadows from each light source.
* @memberof ModelGraphics.prototype
* @type {Property}
* @deprecated
*/
castShadows : createPropertyDescriptor('castShadows'),

/**
* Get or sets the boolean Property specifying whether the model
* receives shadows from shadow casters in the scene.
* @memberof ModelGraphics.prototype
* @type {Property}
* @deprecated
*/
receiveShadows : createPropertyDescriptor('receiveShadows'),

/**
* Get or sets the enum Property specifying whether the model
* casts or receives shadows from each light source.
Expand Down Expand Up @@ -218,8 +194,6 @@ define([
result.minimumPixelSize = this.minimumPixelSize;
result.maximumScale = this.maximumScale;
result.incrementallyLoadTextures = this.incrementallyLoadTextures;
result.castShadows = this.castShadows;
result.receiveShadows = this.receiveShadows;
result.shadows = this.shadows;
result.uri = this.uri;
result.runAnimations = this.runAnimations;
Expand Down Expand Up @@ -247,8 +221,6 @@ define([
this.minimumPixelSize = defaultValue(this.minimumPixelSize, source.minimumPixelSize);
this.maximumScale = defaultValue(this.maximumScale, source.maximumScale);
this.incrementallyLoadTextures = defaultValue(this.incrementallyLoadTextures, source.incrementallyLoadTextures);
this.castShadows = defaultValue(this.castShadows, source.castShadows);
this.receiveShadows = defaultValue(this.receiveShadows, source.receiveShadows);
this.shadows = defaultValue(this.shadows, source.shadows);
this.uri = defaultValue(this.uri, source.uri);
this.runAnimations = defaultValue(this.runAnimations, source.runAnimations);
Expand Down
11 changes: 1 addition & 10 deletions Source/DataSources/ModelVisualizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,21 +131,12 @@ define([
modelHash[entity.id] = modelData;
}

var shadows = defaultShadows;
if (defined(modelGraphics._shadows)) {
shadows = Property.getValueOrDefault(modelGraphics._shadows, time, defaultShadows);
} else if (defined(modelGraphics._castShadows) || defined(modelGraphics._receiveShadows)) {
var castShadows = Property.getValueOrDefault(modelGraphics._castShadows, time, true);
var receiveShadows = Property.getValueOrDefault(modelGraphics.receiveShadows, time, true);
shadows = ShadowMode.fromCastReceive(castShadows, receiveShadows);
}

model.show = true;
model.scale = Property.getValueOrDefault(modelGraphics._scale, time, defaultScale);
model.minimumPixelSize = Property.getValueOrDefault(modelGraphics._minimumPixelSize, time, defaultMinimumPixelSize);
model.maximumScale = Property.getValueOrUndefined(modelGraphics._maximumScale, time);
model.modelMatrix = Matrix4.clone(modelMatrix, model.modelMatrix);
model.shadows = shadows;
model.shadows = Property.getValueOrDefault(modelGraphics._shadows, time, defaultShadows);
model.heightReference = Property.getValueOrDefault(modelGraphics._heightReference, time, defaultHeightReference);

if (model.ready) {
Expand Down
12 changes: 10 additions & 2 deletions Source/Scene/DebugAppearance.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ define([
*
* @param {Object} options Object with the following properties:
* @param {String} options.attributeName The name of the attribute to visualize.
* @param {Boolean} options.perInstanceAttribute Boolean that determines whether this attribute is a per-instance geometry attribute.
* @param {String} [options.glslDatatype='vec3'] The GLSL datatype of the attribute. Supported datatypes are <code>float</code>, <code>vec2</code>, <code>vec3</code>, and <code>vec4</code>.
* @param {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader.
* @param {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader.
Expand All @@ -44,11 +45,15 @@ define([
function DebugAppearance(options) {
options = defaultValue(options, defaultValue.EMPTY_OBJECT);
var attributeName = options.attributeName;
var perInstanceAttribute = options.perInstanceAttribute;

//>>includeStart('debug', pragmas.debug);
if (!defined(attributeName)) {
throw new DeveloperError('options.attributeName is required.');
}
if (!defined(perInstanceAttribute)) {
throw new DeveloperError('options.perInstanceAttribute is required.');
}
//>>includeEnd('debug');

var glslDatatype = defaultValue(options.glslDatatype, 'vec3');
Expand Down Expand Up @@ -85,12 +90,15 @@ define([
var vs =
'attribute vec3 position3DHigh;\n' +
'attribute vec3 position3DLow;\n' +
'attribute ' + glslDatatype + ' ' + attributeName + ';\n' +
'attribute float batchId;\n' +
(perInstanceAttribute ? '' : 'attribute ' + glslDatatype + ' ' + attributeName + ';\n') +
'varying ' + glslDatatype + ' ' + varyingName + ';\n' +
'void main()\n' +
'{\n' +
'vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);\n' +
varyingName + ' = ' + attributeName + ';\n' +
(perInstanceAttribute ?
varyingName + ' = czm_batchTable_' + attributeName + '(batchId);\n' :
varyingName + ' = ' + attributeName + ';\n') +
'gl_Position = czm_modelViewProjectionRelativeToEye * p;\n' +
'}';
var fs =
Expand Down
42 changes: 0 additions & 42 deletions Source/Scene/Globe.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ define([
'../Core/defaultValue',
'../Core/defined',
'../Core/defineProperties',
'../Core/deprecationWarning',
'../Core/destroyObject',
'../Core/DeveloperError',
'../Core/Ellipsoid',
Expand Down Expand Up @@ -38,7 +37,6 @@ define([
defaultValue,
defined,
defineProperties,
deprecationWarning,
destroyObject,
DeveloperError,
Ellipsoid,
Expand Down Expand Up @@ -281,46 +279,6 @@ define([
get: function() {
return this._surface.tileLoadProgressEvent;
}
},

/**
* Determines whether the globe casts shadows from each light source.
*
* @memberof Globe.prototype
* @type {Boolean}
* @deprecated
*/
castShadows : {
get : function() {
deprecationWarning('Globe.castShadows', 'Globe.castShadows was deprecated in Cesium 1.25. It will be removed in 1.26. Use Globe.shadows instead.');
return ShadowMode.castShadows(this.shadows);
},
set : function(value) {
deprecationWarning('Globe.castShadows', 'Globe.castShadows was deprecated in Cesium 1.25. It will be removed in 1.26. Use Globe.shadows instead.');
var castShadows = value;
var receiveShadows = ShadowMode.receiveShadows(this.shadows);
this.shadows = ShadowMode.fromCastReceive(castShadows, receiveShadows);
}
},

/**
* Determines whether the globe receives shadows from shadow casters in the scene.
*
* @memberof Globe.prototype
* @type {Boolean}
* @deprecated
*/
receiveShadows : {
get : function() {
deprecationWarning('Globe.receiveShadows', 'Globe.receiveShadows was deprecated in Cesium 1.25. It will be removed in 1.26. Use Globe.shadows instead.');
return ShadowMode.receiveShadows(this.shadows);
},
set : function(value) {
deprecationWarning('Globe.receiveShadows', 'Globe.receiveShadows was deprecated in Cesium 1.25. It will be removed in 1.26. Use Globe.shadows instead.');
var castShadows = ShadowMode.castShadows(this.shadows);
var receiveShadows = value;
this.shadows = ShadowMode.fromCastReceive(castShadows, receiveShadows);
}
}
});

Expand Down
Loading

0 comments on commit 32c4117

Please sign in to comment.