From 9fd4154a2eb3696f1c4c053ccf3a9b8354d683d4 Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Fri, 16 Dec 2016 23:13:16 -0500 Subject: [PATCH 01/11] OIT workaround --- Source/Scene/OIT.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Source/Scene/OIT.js b/Source/Scene/OIT.js index 56634581365f..7d9cebd117e7 100644 --- a/Source/Scene/OIT.js +++ b/Source/Scene/OIT.js @@ -113,19 +113,27 @@ define([ function updateTextures(oit, context, width, height) { destroyTextures(oit); + 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 + } }); } From b3009f31bf8d0ea7b6bb525fee1ddd72aa1ab10b Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Fri, 16 Dec 2016 23:30:11 -0500 Subject: [PATCH 02/11] Unrelated fix --- Source/Scene/FXAA.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Scene/FXAA.js b/Source/Scene/FXAA.js index 42c1c4b4a7da..783bb7485c49 100644 --- a/Source/Scene/FXAA.js +++ b/Source/Scene/FXAA.js @@ -88,7 +88,7 @@ define([ pixelDatatype : PixelDatatype.UNSIGNED_BYTE }); - if (context.depthStencilTexture) { + if (context.depthTexture) { this._depthStencilTexture = new Texture({ context : context, width : width, From ce00c03bcbe7f3437b0494a71181a668f9d7115d Mon Sep 17 00:00:00 2001 From: Patrick Cozzi Date: Sun, 18 Dec 2016 09:02:22 -0500 Subject: [PATCH 03/11] Update comment --- Source/Scene/OIT.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/Scene/OIT.js b/Source/Scene/OIT.js index 7d9cebd117e7..eba923512306 100644 --- a/Source/Scene/OIT.js +++ b/Source/Scene/OIT.js @@ -113,6 +113,8 @@ 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({ From 51cc82b3ab40f8a618ab35e5aa2fd730d14bb9b4 Mon Sep 17 00:00:00 2001 From: Patrick Cozzi Date: Sun, 18 Dec 2016 09:10:25 -0500 Subject: [PATCH 04/11] Updated CHANGES.md --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 215bf28c7bf7..45de317d4270 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -15,6 +15,7 @@ Change Log * 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 translucency in Firefox 50. https://github.com/AnalyticalGraphicsInc/cesium/pull/4762 ### 1.28 - 2016-12-01 From 8318417aa1740e787b323c549683dc1b111251dd Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Mon, 19 Dec 2016 11:44:34 +1100 Subject: [PATCH 05/11] Fix "readyImagery is not actually ready" exception. --- Source/Scene/Imagery.js | 2 +- Source/Scene/ImageryLayer.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Scene/Imagery.js b/Source/Scene/Imagery.js index 497248f0eb81..607fb1319cc9 100644 --- a/Source/Scene/Imagery.js +++ b/Source/Scene/Imagery.js @@ -72,7 +72,7 @@ define([ this.texture.destroy(); } - if (defined(this.textureWebMercator)) { + if (defined(this.textureWebMercator) && this.texture !== this.textureWebMercator) { this.textureWebMercator.destroy(); } diff --git a/Source/Scene/ImageryLayer.js b/Source/Scene/ImageryLayer.js index 3a0a04d7f99e..745240be4d0e 100644 --- a/Source/Scene/ImageryLayer.js +++ b/Source/Scene/ImageryLayer.js @@ -811,6 +811,7 @@ define([ }); this._reprojectComputeCommands.push(computeCommand); } else { + imagery.texture = texture; finalizeReprojectTexture(this, context, imagery, texture); } }; From b4cd684a4e1e75863ccf081990506972b3c4f388 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Mon, 19 Dec 2016 12:04:46 +1100 Subject: [PATCH 06/11] Fix test failure, add a new (currently failing) test. --- Source/Scene/ImageryLayer.js | 4 ++- Specs/Scene/ImageryLayerSpec.js | 43 +++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/Source/Scene/ImageryLayer.js b/Source/Scene/ImageryLayer.js index 745240be4d0e..3123f580ec78 100644 --- a/Source/Scene/ImageryLayer.js +++ b/Source/Scene/ImageryLayer.js @@ -811,7 +811,9 @@ define([ }); this._reprojectComputeCommands.push(computeCommand); } else { - imagery.texture = texture; + if (needGeographicProjection) { + imagery.texture = texture; + } finalizeReprojectTexture(this, context, imagery, texture); } }; diff --git a/Specs/Scene/ImageryLayerSpec.js b/Specs/Scene/ImageryLayerSpec.js index 88a8804b12fd..e789bf269011 100644 --- a/Specs/Scene/ImageryLayerSpec.js +++ b/Specs/Scene/ImageryLayerSpec.js @@ -17,6 +17,7 @@ defineSuite([ 'Scene/NeverTileDiscardPolicy', 'Scene/QuadtreeTile', 'Scene/SingleTileImageryProvider', + 'Scene/UrlTemplateImageryProvider', 'Scene/WebMapServiceImageryProvider', 'Specs/createScene', 'Specs/pollToPromise' @@ -38,6 +39,7 @@ defineSuite([ NeverTileDiscardPolicy, QuadtreeTile, SingleTileImageryProvider, + UrlTemplateImageryProvider, WebMapServiceImageryProvider, createScene, pollToPromise) { @@ -271,6 +273,47 @@ defineSuite([ }); }); + it('assigns texture property when reprojection is skipped because the tile is very small', function() { + 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, x, y, 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() { + var textureBeforeReprojection = imagery.textureWebMercator; + layer._reprojectTexture(scene.frameState, imagery, true); + layer.queueReprojectionCommands(scene.frameState); + scene.frameState.commandList[0].execute(computeEngine); + + 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); From af231deb3915c183855e5a266f13fd2205a76c49 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Mon, 19 Dec 2016 13:09:30 +1100 Subject: [PATCH 07/11] Fix test. --- Specs/Data/Images/Red256x256.png | Bin 0 -> 742 bytes Specs/Scene/ImageryLayerSpec.js | 8 ++++++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 Specs/Data/Images/Red256x256.png diff --git a/Specs/Data/Images/Red256x256.png b/Specs/Data/Images/Red256x256.png new file mode 100644 index 0000000000000000000000000000000000000000..693565bf26b36c5b5d5004d243bb5400ffada37e GIT binary patch literal 742 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K58911L)MWvCLlCbx$lZxy-8q?;Kn_c~qpu?a z!^VE@KZ&eBK4*bPWHAE+-(e7DJf6QIg@J*o+SA1`q$2L^aYJ4P0|DlZ&;57Zb$+N* z`EhUaI@=|06jS*%t37TypOOpuHeplylu@D4kf2JM5GeZ280o|JiBU_w2$(h*JYD@< J);T3K0RSBOL6rai literal 0 HcmV?d00001 diff --git a/Specs/Scene/ImageryLayerSpec.js b/Specs/Scene/ImageryLayerSpec.js index e789bf269011..07e3c7187836 100644 --- a/Specs/Scene/ImageryLayerSpec.js +++ b/Specs/Scene/ImageryLayerSpec.js @@ -274,6 +274,10 @@ 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, @@ -285,7 +289,7 @@ defineSuite([ return pollToPromise(function() { return provider.ready; }).then(function() { - var imagery = new Imagery(layer, x, y, 13); + var imagery = new Imagery(layer, 4400, 2686, 13); imagery.addReference(); layer._requestImagery(imagery); @@ -300,7 +304,7 @@ defineSuite([ var textureBeforeReprojection = imagery.textureWebMercator; layer._reprojectTexture(scene.frameState, imagery, true); layer.queueReprojectionCommands(scene.frameState); - scene.frameState.commandList[0].execute(computeEngine); + expect(scene.frameState.commandList.length).toBe(0); return pollToPromise(function() { return imagery.state === ImageryState.READY; From e4243c7fc1b1491fc607bf5c52e9f14009215817 Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Mon, 19 Dec 2016 15:45:58 +1100 Subject: [PATCH 08/11] Fix jshint warning. --- Specs/Scene/ImageryLayerSpec.js | 1 - 1 file changed, 1 deletion(-) diff --git a/Specs/Scene/ImageryLayerSpec.js b/Specs/Scene/ImageryLayerSpec.js index 07e3c7187836..4c9ec1fcbcbb 100644 --- a/Specs/Scene/ImageryLayerSpec.js +++ b/Specs/Scene/ImageryLayerSpec.js @@ -301,7 +301,6 @@ defineSuite([ return pollToPromise(function() { return imagery.state === ImageryState.TEXTURE_LOADED; }).then(function() { - var textureBeforeReprojection = imagery.textureWebMercator; layer._reprojectTexture(scene.frameState, imagery, true); layer.queueReprojectionCommands(scene.frameState); expect(scene.frameState.commandList.length).toBe(0); From cea586032482db9915b55cc0f1cb3431dcc5647c Mon Sep 17 00:00:00 2001 From: Kevin Ring Date: Mon, 19 Dec 2016 16:03:26 +1100 Subject: [PATCH 09/11] Update CHANGES.md. --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index 45de317d4270..f10f79d03af7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -16,6 +16,7 @@ Change Log * 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 translucency in Firefox 50. https://github.com/AnalyticalGraphicsInc/cesium/pull/4762 +* Fixed a bug that could cause a "readyImagery is not actually ready" exception with some configurations of imagery layers. ### 1.28 - 2016-12-01 From 1b1d5a7791537dfea3ef05f2961d677d16e9654a Mon Sep 17 00:00:00 2001 From: Patrick Cozzi Date: Mon, 19 Dec 2016 13:47:07 -0500 Subject: [PATCH 10/11] Reorder CHANGES.md for 1.29 --- CHANGES.md | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index f10f79d03af7..896831df2990 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,20 +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) -* 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 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 tooltips for gallery thumbnails in Sandcastle [#4702](https://github.com/AnalyticalGraphicsInc/cesium/pull/4702) ### 1.28 - 2016-12-01 From 4b41ee242cb601d98a5bb4dc9eaace11ba746676 Mon Sep 17 00:00:00 2001 From: Ed Mackey Date: Mon, 19 Dec 2016 16:13:19 -0500 Subject: [PATCH 11/11] Fix incorrect doc default. --- Source/DataSources/LabelGraphics.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/DataSources/LabelGraphics.js b/Source/DataSources/LabelGraphics.js index 3f5396ccd463..3377176256cf 100644 --- a/Source/DataSources/LabelGraphics.js +++ b/Source/DataSources/LabelGraphics.js @@ -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.