Skip to content

Commit

Permalink
Merge branch 'master' into texture-compression
Browse files Browse the repository at this point in the history
  • Loading branch information
bagnell committed Dec 19, 2016
2 parents e415e0c + 9d7348d commit 6020a01
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 18 deletions.
22 changes: 13 additions & 9 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@ Change Log

### 1.29 - 2017-01-02

* Added the ability to blend a `Model` with a color/translucency. Added `color`, `colorBlendMode`, and `colorBlendAmount` properties to `Model`, `ModelGraphics`, and CZML. Added `ColorBlendMode` enum. [#4547](https://github.com/AnalyticalGraphicsInc/cesium/pull/4547)
* Added the ability to render a `Model` with a silhouette. Added `silhouetteColor` and `silhouetteSize` properties to `Model`, `ModelGraphics`, and CZML. [#4314](https://github.com/AnalyticalGraphicsInc/cesium/pull/4314)
* Added new `Label` properties `showBackground`, `backgroundColor`, and `backgroundPadding` to the primitive, Entity, and CZML layers.
* Added new enum `VerticalOrigin.BASELINE`. Previously, `VerticalOrigin.BOTTOM` would sometimes align to the baseline depending on the contents of a label.
* Added support for newlines (`\n`) in Cesium `Label`s and CZML. [#2402](https://github.com/AnalyticalGraphicsInc/cesium/issues/2402)
* Fixed tooltips for gallery thumbnails in Sandcastle [#4702](https://github.com/AnalyticalGraphicsInc/cesium/pull/4702)
* Fixed `Rectangle.union` to correctly account for rectangles that cross the IDL [#4732](https://github.com/AnalyticalGraphicsInc/cesium/pull/4732).
* Improved 3D Models
* Added the ability to blend a `Model` with a color/translucency. Added `color`, `colorBlendMode`, and `colorBlendAmount` properties to `Model`, `ModelGraphics`, and CZML. Also added `ColorBlendMode` enum. [#4547](https://github.com/AnalyticalGraphicsInc/cesium/pull/4547)
* Added the ability to render a `Model` with a silhouette. Added `silhouetteColor` and `silhouetteSize` properties to `Model`, `ModelGraphics`, and CZML. [#4314](https://github.com/AnalyticalGraphicsInc/cesium/pull/4314)
* Improved Labels
* Added new `Label` properties `showBackground`, `backgroundColor`, and `backgroundPadding` to the primitive, Entity, and CZML layers.
* Added new enum `VerticalOrigin.BASELINE`. Previously, `VerticalOrigin.BOTTOM` would sometimes align to the baseline depending on the contents of a label.
* Added support for newlines (`\n`) in Cesium `Label`s and CZML. [#2402](https://github.com/AnalyticalGraphicsInc/cesium/issues/2402)
* Fixed texture rotation for `RectangleGeometry` [#2737](https://github.com/AnalyticalGraphicsInc/cesium/issues/2737)
* Fixed translucency in Firefox 50. https://github.com/AnalyticalGraphicsInc/cesium/pull/4762
* Fixed a bug that caused `GroundPrimitive` to render incorrectly on systems without the `WEBGL_depth_texture` extension. [#4747](https://github.com/AnalyticalGraphicsInc/cesium/pull/4747)
* Fixed default Mapbox token and added a watermark to notify users that they need to sign up for their own token.
* Fixed a bug that could cause a "readyImagery is not actually ready" exception with some configurations of imagery layers.
* Fixed `Rectangle.union` to correctly account for rectangles that cross the IDL [#4732](https://github.com/AnalyticalGraphicsInc/cesium/pull/4732).
* Added `divideComponents` function to `Cartesian2`, `Cartesian3`, and `Cartesian4`. [#4750](https://github.com/AnalyticalGraphicsInc/cesium/pull/4750)
* Added `WebGLConstants` enum. Previously, this was part of the private Renderer API. [#4731](https://github.com/AnalyticalGraphicsInc/cesium/pull/4731)
* Fixed an bug that caused `GroundPrimitive` to render incorrectly on systems without the `WEBGL_depth_texture` extension. [#4747](https://github.com/AnalyticalGraphicsInc/cesium/pull/4747)
* Fixed default Mapbox token and added a watermark to notify users that they need to sign up for their own token.
* Fixed tooltips for gallery thumbnails in Sandcastle [#4702](https://github.com/AnalyticalGraphicsInc/cesium/pull/4702)
* Added compressed texture support. The supported extensions are `WEBGL_compressed_s3tc`, `WEBGL_compressed_texture_pvrtc`, and `WEBGL_compressed_texture_etc1`. [#4758](https://github.com/AnalyticalGraphicsInc/cesium/pull/4758)

### 1.28 - 2016-12-01
Expand Down
2 changes: 1 addition & 1 deletion Source/DataSources/LabelGraphics.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ define([
* @param {Property} [options.outlineColor=Color.BLACK] A Property specifying the outline {@link Color}.
* @param {Property} [options.outlineWidth=1.0] A numeric Property specifying the outline width.
* @param {Property} [options.show=true] A boolean Property specifying the visibility of the label.
* @param {Property} [options.showBackground=true] A boolean Property specifying the visibility of the background behind the label.
* @param {Property} [options.showBackground=false] A boolean Property specifying the visibility of the background behind the label.
* @param {Property} [options.backgroundColor=new Color(0.165, 0.165, 0.165, 0.8)] A Property specifying the background {@link Color}.
* @param {Property} [options.backgroundPadding=new Cartesian2(7, 5)] A {@link Cartesian2} Property specifying the horizontal and vertical background padding in pixels.
* @param {Property} [options.scale=1.0] A numeric Property specifying the scale to apply to the text.
Expand Down
2 changes: 1 addition & 1 deletion Source/Scene/FXAA.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ define([
pixelDatatype : PixelDatatype.UNSIGNED_BYTE
});

if (context.depthStencilTexture) {
if (context.depthTexture) {
this._depthStencilTexture = new Texture({
context : context,
width : width,
Expand Down
2 changes: 1 addition & 1 deletion Source/Scene/Imagery.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ define([
this.texture.destroy();
}

if (defined(this.textureWebMercator)) {
if (defined(this.textureWebMercator) && this.texture !== this.textureWebMercator) {
this.textureWebMercator.destroy();
}

Expand Down
3 changes: 3 additions & 0 deletions Source/Scene/ImageryLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,9 @@ define([
});
this._reprojectComputeCommands.push(computeCommand);
} else {
if (needGeographicProjection) {
imagery.texture = texture;
}
finalizeReprojectTexture(this, context, imagery, texture);
}
};
Expand Down
22 changes: 16 additions & 6 deletions Source/Scene/OIT.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,29 @@ define([
function updateTextures(oit, context, width, height) {
destroyTextures(oit);

// Use zeroed arraybuffer instead of null to initialize texture
// to workaround Firefox 50. https://github.com/AnalyticalGraphicsInc/cesium/pull/4762
var source = new Float32Array(width * height * 4);

oit._accumulationTexture = new Texture({
context : context,
width : width,
height : height,
pixelFormat : PixelFormat.RGBA,
pixelDatatype : PixelDatatype.FLOAT
pixelDatatype : PixelDatatype.FLOAT,
source : {
arrayBufferView : source,
width : width,
height : height
}
});
oit._revealageTexture = new Texture({
context : context,
width : width,
height : height,
pixelFormat : PixelFormat.RGBA,
pixelDatatype : PixelDatatype.FLOAT
pixelDatatype : PixelDatatype.FLOAT,
source : {
arrayBufferView : source,
width : width,
height : height
}
});
}

Expand Down
Binary file added Specs/Data/Images/Red256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions Specs/Scene/ImageryLayerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ defineSuite([
'Scene/NeverTileDiscardPolicy',
'Scene/QuadtreeTile',
'Scene/SingleTileImageryProvider',
'Scene/UrlTemplateImageryProvider',
'Scene/WebMapServiceImageryProvider',
'Specs/createScene',
'Specs/pollToPromise'
Expand All @@ -38,6 +39,7 @@ defineSuite([
NeverTileDiscardPolicy,
QuadtreeTile,
SingleTileImageryProvider,
UrlTemplateImageryProvider,
WebMapServiceImageryProvider,
createScene,
pollToPromise) {
Expand Down Expand Up @@ -271,6 +273,50 @@ defineSuite([
});
});

it('assigns texture property when reprojection is skipped because the tile is very small', function() {
loadImage.createImage = function(url, crossOrigin, deferred) {
loadImage.defaultCreateImage('Data/Images/Red256x256.png', crossOrigin, deferred);
};

var provider = new UrlTemplateImageryProvider({
url : 'http://example.com/{z}/{x}/{y}.png',
minimumLevel : 13,
maximumLevel: 19,
rectangle : Rectangle.fromDegrees(13.39657249732205, 52.49127999816725, 13.42722986993895, 52.50998943590507)
});
var layer = new ImageryLayer(provider);

return pollToPromise(function() {
return provider.ready;
}).then(function() {
var imagery = new Imagery(layer, 4400, 2686, 13);
imagery.addReference();
layer._requestImagery(imagery);

return pollToPromise(function() {
return imagery.state === ImageryState.RECEIVED;
}).then(function() {
layer._createTexture(scene.context, imagery);

return pollToPromise(function() {
return imagery.state === ImageryState.TEXTURE_LOADED;
}).then(function() {
layer._reprojectTexture(scene.frameState, imagery, true);
layer.queueReprojectionCommands(scene.frameState);
expect(scene.frameState.commandList.length).toBe(0);

return pollToPromise(function() {
return imagery.state === ImageryState.READY;
}).then(function() {
expect(imagery.texture).toBeDefined();
expect(imagery.texture).toBe(imagery.textureWebMercator);
imagery.releaseReference();
});
});
});
});
});

it('cancels reprojection', function() {
var provider = createWebMercatorProvider();
var layer = new ImageryLayer(provider);
Expand Down

0 comments on commit 6020a01

Please sign in to comment.