From c94c510fcdfd8ecbb79defc126061ab7319e7fbc Mon Sep 17 00:00:00 2001 From: Kangning Li Date: Fri, 31 Aug 2018 12:06:49 -0400 Subject: [PATCH 1/5] add geographic limit rectangle --- .../gallery/Geographic Limit Rectangle.html | 88 ++++++++++++++++++ .../gallery/Geographic Limit Rectangle.jpg | Bin 0 -> 17738 bytes Source/Scene/Globe.js | 8 ++ Source/Scene/GlobeSurfaceShaderSet.js | 14 ++- Source/Scene/GlobeSurfaceTile.js | 2 + Source/Scene/GlobeSurfaceTileProvider.js | 42 ++++++++- Source/Shaders/GlobeFS.glsl | 13 +++ Specs/Scene/GlobeSurfaceTileProviderSpec.js | 38 +++++++- 8 files changed, 198 insertions(+), 7 deletions(-) create mode 100644 Apps/Sandcastle/gallery/Geographic Limit Rectangle.html create mode 100644 Apps/Sandcastle/gallery/Geographic Limit Rectangle.jpg diff --git a/Apps/Sandcastle/gallery/Geographic Limit Rectangle.html b/Apps/Sandcastle/gallery/Geographic Limit Rectangle.html new file mode 100644 index 000000000000..2ffb9f316a6f --- /dev/null +++ b/Apps/Sandcastle/gallery/Geographic Limit Rectangle.html @@ -0,0 +1,88 @@ + + + + + + + + + Cesium Demo + + + + + + +
+

Loading...

+
+ + + diff --git a/Apps/Sandcastle/gallery/Geographic Limit Rectangle.jpg b/Apps/Sandcastle/gallery/Geographic Limit Rectangle.jpg new file mode 100644 index 0000000000000000000000000000000000000000..db87f75e3b4c91f1a2da4c871842a8bdab32a9ee GIT binary patch literal 17738 zcmeHtbyytBwr>v%F!-Rs8Qk4{aMu7K0TSF@g1fs12p&8kc#z-{T!RG&4gn%)La>lG zWM}7`d++()ci-P{*GzX;)skNItLo}itNQ1=pX&frML}5s0D(Y&65;Mc<1xx`az#4Jb z{<;DH#Ycn`4T0KnY5Jlx61zq}Aa06@n| z2LH*!Qd55Ak@IEy!F1Tx#RRjpkYKtepw6xCB5P@5tK{ou zdDmA%*WB0MT*QJ&N)kidTh!ap#nIBk6z1*d;N&jqEy46lx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1eKhx5FiXLeEf$n|CnIAns+4X$>-R z9?Jml$Ow2SF=#OqR}*7y3P;yz49`gQiY!NI(#$jA4AT1kwCyL*EpQMqAF@|`;F0y- z6EY3nGQznqu#*F^XFO*M@2efC+Zr92;&L0SN|`q7=v2GhC=mcy;nCtzdG^*BWqq|R z3s6ZtHtxGajj}z9ofA%_Krr@miOKbAflw$ba(9}$3T7v6y%NSiI7k^l4&K5k;j2j5 zQB0D`GPyhtPB-3px&aDn&I)5#0HXQtW@xIymiKnp)=$fx6Q_13857zLKNETN#6JBe z5H-4G5x9qzTbmgUMn>a?%A*R=h@C@PzLZ)Zx1^?o>SoKn?Y)9kKBf9%&ax0p9-i#Y z_7bDFImO50hMFrO-Xuj^Fc}~KR7{kaV5w;#u+>H W&H4qAS(MhyGg`a*j}C% CesiumMath.EPSILON3; @@ -1357,7 +1395,7 @@ define([ uniformMap = combine(uniformMap, tileProvider.uniformMap); } - command.shaderProgram = tileProvider._surfaceShaderSet.getShaderProgram(frameState, surfaceTile, numberOfDayTextures, applyBrightness, applyContrast, applyHue, applySaturation, applyGamma, applyAlpha, applySplit, showReflectiveOcean, showOceanWaves, tileProvider.enableLighting, hasVertexNormals, useWebMercatorProjection, applyFog, clippingPlanesEnabled, clippingPlanes); + command.shaderProgram = tileProvider._surfaceShaderSet.getShaderProgram(frameState, surfaceTile, numberOfDayTextures, applyBrightness, applyContrast, applyHue, applySaturation, applyGamma, applyAlpha, applySplit, showReflectiveOcean, showOceanWaves, tileProvider.enableLighting, hasVertexNormals, useWebMercatorProjection, applyFog, clippingPlanesEnabled, clippingPlanes, surfaceTile.clippedByBoundaries); command.castShadows = castShadows; command.receiveShadows = receiveShadows; command.renderState = renderState; diff --git a/Source/Shaders/GlobeFS.glsl b/Source/Shaders/GlobeFS.glsl index cb7eb85310c4..e41323d2182b 100644 --- a/Source/Shaders/GlobeFS.glsl +++ b/Source/Shaders/GlobeFS.glsl @@ -51,6 +51,10 @@ uniform sampler2D u_oceanNormalMap; uniform vec2 u_lightingFadeDistance; #endif +#ifdef TILE_LIMIT_RECTANGLE +uniform vec4 u_geographicLimitRectangle; +#endif + #ifdef ENABLE_CLIPPING_PLANES uniform sampler2D u_clippingPlanes; uniform mat4 u_clippingPlanesMatrix; @@ -155,6 +159,15 @@ vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat void main() { + +#ifdef TILE_LIMIT_RECTANGLE + if (v_textureCoordinates.x < u_geographicLimitRectangle.x || u_geographicLimitRectangle.z < v_textureCoordinates.x || + v_textureCoordinates.y < u_geographicLimitRectangle.y || u_geographicLimitRectangle.w < v_textureCoordinates.y) + { + discard; + } +#endif + #ifdef ENABLE_CLIPPING_PLANES float clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix); #endif diff --git a/Specs/Scene/GlobeSurfaceTileProviderSpec.js b/Specs/Scene/GlobeSurfaceTileProviderSpec.js index 00919c6f7c80..3a4f77648f9d 100644 --- a/Specs/Scene/GlobeSurfaceTileProviderSpec.js +++ b/Specs/Scene/GlobeSurfaceTileProviderSpec.js @@ -8,7 +8,6 @@ defineSuite([ 'Core/Ellipsoid', 'Core/EllipsoidTerrainProvider', 'Core/GeographicProjection', - 'Core/Intersect', 'Core/Rectangle', 'Core/WebMercatorProjection', 'Renderer/ContextLimits', @@ -39,7 +38,6 @@ defineSuite([ Ellipsoid, EllipsoidTerrainProvider, GeographicProjection, - Intersect, Rectangle, WebMercatorProjection, ContextLimits, @@ -116,6 +114,7 @@ defineSuite([ afterEach(function() { scene.imageryLayers.removeAll(); + scene.primitives.removeAll(); }); it('conforms to QuadtreeTileProvider interface', function() { @@ -939,4 +938,39 @@ defineSuite([ }).toThrowDeveloperError(); }); + it('geographicLimitRectangle selectively enables rendering globe surface', function() { + expect(scene).toRender([0, 0, 0, 255]); + switchViewMode(SceneMode.COLUMBUS_VIEW, new GeographicProjection(Ellipsoid.WGS84)); + var result; + return updateUntilDone(scene.globe).then(function() { + expect(scene).notToRender([0, 0, 0, 255]); + expect(scene).toRenderAndCall(function(rgba) { + result = rgba; + expect(rgba).not.toEqual([0, 0, 0, 255]); + }); + scene.globe.geographicLimitRectangle = Rectangle.fromDegrees(-2, -2, -1, -1); + expect(scene).notToRender(result); + scene.camera.setView({ + destination : scene.globe.geographicLimitRectangle + }); + return updateUntilDone(scene.globe); + }) + .then(function() { + expect(scene).toRender(result); + }); + }); + + it('geographicLimitRectangle culls tiles outside the region', function() { + switchViewMode(SceneMode.COLUMBUS_VIEW, new GeographicProjection(Ellipsoid.WGS84)); + var unculledCommandCount; + return updateUntilDone(scene.globe).then(function() { + unculledCommandCount = scene.frameState.commandList.length; + scene.globe.geographicLimitRectangle = Rectangle.fromDegrees(-2, -2, -1, -1); + return updateUntilDone(scene.globe); + }) + .then(function() { + expect(unculledCommandCount).toBeGreaterThan(scene.frameState.commandList.length); + }); + }); + }, 'WebGL'); From 569094f410e85dd75fcf0f9a85a4a3f0ca9956cb Mon Sep 17 00:00:00 2001 From: Kangning Li Date: Thu, 6 Sep 2018 11:34:58 -0400 Subject: [PATCH 2/5] let geographic limit rectangle cross the IDL --- Source/Scene/GlobeSurfaceTileProvider.js | 24 +++++++++++++++++++-- Specs/Scene/GlobeSurfaceTileProviderSpec.js | 13 +++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/Source/Scene/GlobeSurfaceTileProvider.js b/Source/Scene/GlobeSurfaceTileProvider.js index 46cc91a5485b..2492c9c5ff54 100644 --- a/Source/Scene/GlobeSurfaceTileProvider.js +++ b/Source/Scene/GlobeSurfaceTileProvider.js @@ -4,6 +4,7 @@ define([ '../Core/Cartesian2', '../Core/Cartesian3', '../Core/Cartesian4', + '../Core/Cartographic', '../Core/Color', '../Core/ColorGeometryInstanceAttribute', '../Core/combine', @@ -50,6 +51,7 @@ define([ Cartesian2, Cartesian3, Cartesian4, + Cartographic, Color, ColorGeometryInstanceAttribute, combine, @@ -517,6 +519,23 @@ define([ var boundingSphereScratch = new BoundingSphere(); var rectangleIntersectionScratch = new Rectangle(); + var splitGeographicLimitRectangleScratch = new Rectangle(); + var rectangleCenterScratch = new Cartographic(); + + // geographicLimitRectangle may span the IDL, but tiles never will. + function clipRectangleAntimeridian(tileRectangle, geographicLimitRectangle) { + if (geographicLimitRectangle.west < geographicLimitRectangle.east) { + return geographicLimitRectangle; + } + var splitRectangle = Rectangle.clone(geographicLimitRectangle, splitGeographicLimitRectangleScratch); + var tileCenter = Rectangle.center(tileRectangle, rectangleCenterScratch); + if (tileCenter.longitude > 0.0) { + splitRectangle.east = CesiumMath.PI; + } else { + splitRectangle.west = -CesiumMath.PI; + } + return splitRectangle; + } /** * Determines the visibility of a given tile. The tile may be fully visible, partially visible, or not @@ -546,7 +565,8 @@ define([ // Check if the tile is outside the limit area in cartographic space surfaceTile.clippedByBoundaries = false; - var areaLimitIntersection = Rectangle.simpleIntersection(this.geographicLimitRectangle, tile.rectangle, rectangleIntersectionScratch); + var clippedGeographicLimitRectangle = clipRectangleAntimeridian(tile.rectangle, this.geographicLimitRectangle); + var areaLimitIntersection = Rectangle.simpleIntersection(clippedGeographicLimitRectangle, tile.rectangle, rectangleIntersectionScratch); if (!defined(areaLimitIntersection)) { return Visibility.NONE; } @@ -1281,7 +1301,7 @@ define([ // Convert tile limiter rectangle from cartographic to texture space using the tileRectangle. var localizedGeographicLimitRectangle = localizedGeographicLimitRectangleScratch; - var geographicLimitRectangle = tileProvider.geographicLimitRectangle; + var geographicLimitRectangle = clipRectangleAntimeridian(tile.rectangle, tileProvider.geographicLimitRectangle); var cartographicTileRectangle = tile.rectangle; var inverseTileWidth = 1.0 / cartographicTileRectangle.width; diff --git a/Specs/Scene/GlobeSurfaceTileProviderSpec.js b/Specs/Scene/GlobeSurfaceTileProviderSpec.js index 3a4f77648f9d..9040a085bb84 100644 --- a/Specs/Scene/GlobeSurfaceTileProviderSpec.js +++ b/Specs/Scene/GlobeSurfaceTileProviderSpec.js @@ -973,4 +973,17 @@ defineSuite([ }); }); + it('geographicLimitRectangle may cross the antimeridian', function() { + switchViewMode(SceneMode.SCENE2D, new GeographicProjection(Ellipsoid.WGS84)); + var unculledCommandCount; + return updateUntilDone(scene.globe).then(function() { + unculledCommandCount = scene.frameState.commandList.length; + scene.globe.geographicLimitRectangle = Rectangle.fromDegrees(179, -2, -179, -1); + return updateUntilDone(scene.globe); + }) + .then(function() { + expect(unculledCommandCount).toBeGreaterThan(scene.frameState.commandList.length); + }); + }); + }, 'WebGL'); From 6cb37535f0b67349fd2bbf17ef28bf054e869786 Mon Sep 17 00:00:00 2001 From: Kangning Li Date: Thu, 6 Sep 2018 11:40:32 -0400 Subject: [PATCH 3/5] update CHANGES.md --- CHANGES.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index d1fb853b1431..b88931bba301 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,11 @@ Change Log ========== +### 1.50 - 2018-10-01 + +##### Additions :tada: +* Added `geographicLimitRectangle` to `Globe`. Use this to limit terrain and imagery to a specific `Rectangle` area. [#6987](https://github.com/AnalyticalGraphicsInc/cesium/pull/6987) + ### 1.49 - 2018-09-04 ##### Breaking Changes :mega: From 5bae8b3da948b2f1a50715d1f5cef4b9d2c3d599 Mon Sep 17 00:00:00 2001 From: Kangning Li Date: Fri, 7 Sep 2018 11:40:17 -0400 Subject: [PATCH 4/5] update doc --- Apps/Sandcastle/gallery/Geographic Limit Rectangle.html | 3 +-- Source/Scene/GlobeSurfaceShaderSet.js | 2 +- Source/Scene/GlobeSurfaceTileProvider.js | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Apps/Sandcastle/gallery/Geographic Limit Rectangle.html b/Apps/Sandcastle/gallery/Geographic Limit Rectangle.html index 2ffb9f316a6f..9e924b35ea7d 100644 --- a/Apps/Sandcastle/gallery/Geographic Limit Rectangle.html +++ b/Apps/Sandcastle/gallery/Geographic Limit Rectangle.html @@ -44,7 +44,6 @@ for (var i = 0; i < 10; i++) { rectangles.push(viewer.entities.add({ - name : 'EPSG 2093 bounds', rectangle : { coordinates : coffeeBeltRectangle, material : Cesium.Color.WHITE.withAlpha(0.0), @@ -65,7 +64,7 @@ }); var limited = true; -Sandcastle.addToolbarButton('enable/disable limiter', function() { +Sandcastle.addToolbarButton('Enable/Disable Limiter', function() { if (limited) { viewer.scene.globe.geographicLimitRectangle = Cesium.Rectangle.MAX_VALUE; limited = false; diff --git a/Source/Scene/GlobeSurfaceShaderSet.js b/Source/Scene/GlobeSurfaceShaderSet.js index e348ac39652b..c87e362fb671 100644 --- a/Source/Scene/GlobeSurfaceShaderSet.js +++ b/Source/Scene/GlobeSurfaceShaderSet.js @@ -86,7 +86,7 @@ define([ var geographicLimitRectangleFlag = 0; var geographicLimitRectangleDefine = ''; - if (clippedByBoundaries) {//} && frameState.mode !== SceneMode.SCENE3D) { + if (clippedByBoundaries) { geographicLimitRectangleFlag = 1; geographicLimitRectangleDefine = 'TILE_LIMIT_RECTANGLE'; } diff --git a/Source/Scene/GlobeSurfaceTileProvider.js b/Source/Scene/GlobeSurfaceTileProvider.js index 2492c9c5ff54..8062d1ea2cb8 100644 --- a/Source/Scene/GlobeSurfaceTileProvider.js +++ b/Source/Scene/GlobeSurfaceTileProvider.js @@ -172,8 +172,7 @@ define([ this._clippingPlanes = undefined; /** - * A property specifying a {@link Rectangle} used to selectively prevent tiles outside a region from loading. - * For limiting terrain in scenes that use custom projections or Proj4JS projections that cause overlapping tiles. + * A property specifying a {@link Rectangle} used to selectively limit terrain and imagery rendering. * @type {Rectangle} */ this.geographicLimitRectangle = Rectangle.clone(Rectangle.MAX_VALUE); From 6e84ef5ae88553d12dbe9f9ded9285e3daa306a6 Mon Sep 17 00:00:00 2001 From: Kangning Li Date: Mon, 10 Sep 2018 11:18:36 -0400 Subject: [PATCH 5/5] PR comments --- ...html => Cartographic Limit Rectangle.html} | 10 ++--- ...e.jpg => Cartographic Limit Rectangle.jpg} | Bin CHANGES.md | 2 +- Source/Scene/Globe.js | 6 +-- Source/Scene/GlobeSurfaceShaderSet.js | 12 +++--- Source/Scene/GlobeSurfaceTileProvider.js | 40 +++++++++--------- Source/Shaders/GlobeFS.glsl | 6 +-- Specs/Scene/GlobeSurfaceTileProviderSpec.js | 14 +++--- 8 files changed, 45 insertions(+), 45 deletions(-) rename Apps/Sandcastle/gallery/{Geographic Limit Rectangle.html => Cartographic Limit Rectangle.html} (84%) rename Apps/Sandcastle/gallery/{Geographic Limit Rectangle.jpg => Cartographic Limit Rectangle.jpg} (100%) diff --git a/Apps/Sandcastle/gallery/Geographic Limit Rectangle.html b/Apps/Sandcastle/gallery/Cartographic Limit Rectangle.html similarity index 84% rename from Apps/Sandcastle/gallery/Geographic Limit Rectangle.html rename to Apps/Sandcastle/gallery/Cartographic Limit Rectangle.html index 9e924b35ea7d..d2a18ce874a7 100644 --- a/Apps/Sandcastle/gallery/Geographic Limit Rectangle.html +++ b/Apps/Sandcastle/gallery/Cartographic Limit Rectangle.html @@ -4,7 +4,7 @@ - + Cesium Demo @@ -34,9 +34,9 @@ }); // Tropics of Cancer and Capricorn -var coffeeBeltRectangle = Cesium.Rectangle.fromDegrees(-180, -23.43687, 180, 23.43687); +var coffeeBeltRectangle = Cesium.Rectangle.fromDegrees(-180.0, -23.43687, 180.0, 23.43687); -viewer.scene.globe.geographicLimitRectangle = coffeeBeltRectangle; +viewer.scene.globe.cartographicLimitRectangle = coffeeBeltRectangle; viewer.scene.skyAtmosphere.show = false; // Add rectangles to show bounds @@ -66,10 +66,10 @@ var limited = true; Sandcastle.addToolbarButton('Enable/Disable Limiter', function() { if (limited) { - viewer.scene.globe.geographicLimitRectangle = Cesium.Rectangle.MAX_VALUE; + viewer.scene.globe.cartographicLimitRectangle = Cesium.Rectangle.MAX_VALUE; limited = false; } else { - viewer.scene.globe.geographicLimitRectangle = coffeeBeltRectangle; + viewer.scene.globe.cartographicLimitRectangle = coffeeBeltRectangle; limited = true; } }); diff --git a/Apps/Sandcastle/gallery/Geographic Limit Rectangle.jpg b/Apps/Sandcastle/gallery/Cartographic Limit Rectangle.jpg similarity index 100% rename from Apps/Sandcastle/gallery/Geographic Limit Rectangle.jpg rename to Apps/Sandcastle/gallery/Cartographic Limit Rectangle.jpg diff --git a/CHANGES.md b/CHANGES.md index b88931bba301..3865aa72db61 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,7 +4,7 @@ Change Log ### 1.50 - 2018-10-01 ##### Additions :tada: -* Added `geographicLimitRectangle` to `Globe`. Use this to limit terrain and imagery to a specific `Rectangle` area. [#6987](https://github.com/AnalyticalGraphicsInc/cesium/pull/6987) +* Added `cartographicLimitRectangle` to `Globe`. Use this to limit terrain and imagery to a specific `Rectangle` area. [#6987](https://github.com/AnalyticalGraphicsInc/cesium/pull/6987) ### 1.49 - 2018-09-04 diff --git a/Source/Scene/Globe.js b/Source/Scene/Globe.js index ac8fe7a191f6..cfc30e5adbf6 100644 --- a/Source/Scene/Globe.js +++ b/Source/Scene/Globe.js @@ -277,12 +277,12 @@ define([ this._surface.tileProvider.clippingPlanes = value; } }, - geographicLimitRectangle : { + cartographicLimitRectangle : { get : function() { - return this._surface.tileProvider.geographicLimitRectangle; + return this._surface.tileProvider.cartographicLimitRectangle; }, set : function(value) { - this._surface.tileProvider.geographicLimitRectangle = value; + this._surface.tileProvider.cartographicLimitRectangle = value; } }, /** diff --git a/Source/Scene/GlobeSurfaceShaderSet.js b/Source/Scene/GlobeSurfaceShaderSet.js index c87e362fb671..2a8b5b24df08 100644 --- a/Source/Scene/GlobeSurfaceShaderSet.js +++ b/Source/Scene/GlobeSurfaceShaderSet.js @@ -84,11 +84,11 @@ define([ vertexLogDepthDefine = 'DISABLE_GL_POSITION_LOG_DEPTH'; } - var geographicLimitRectangleFlag = 0; - var geographicLimitRectangleDefine = ''; + var cartographicLimitRectangleFlag = 0; + var cartographicLimitRectangleDefine = ''; if (clippedByBoundaries) { - geographicLimitRectangleFlag = 1; - geographicLimitRectangleDefine = 'TILE_LIMIT_RECTANGLE'; + cartographicLimitRectangleFlag = 1; + cartographicLimitRectangleDefine = 'TILE_LIMIT_RECTANGLE'; } var sceneMode = frameState.mode; @@ -109,7 +109,7 @@ define([ (applySplit << 15) | (enableClippingPlanes << 16) | (vertexLogDepth << 17) | - (geographicLimitRectangleFlag << 18); + (cartographicLimitRectangleFlag << 18); var currentClippingShaderState = 0; if (defined(clippingPlanes)) { @@ -142,7 +142,7 @@ define([ } vs.defines.push(quantizationDefine, vertexLogDepthDefine); - fs.defines.push('TEXTURE_UNITS ' + numberOfDayTextures, geographicLimitRectangleDefine); + fs.defines.push('TEXTURE_UNITS ' + numberOfDayTextures, cartographicLimitRectangleDefine); if (applyBrightness) { fs.defines.push('APPLY_BRIGHTNESS'); diff --git a/Source/Scene/GlobeSurfaceTileProvider.js b/Source/Scene/GlobeSurfaceTileProvider.js index 8062d1ea2cb8..6823dd8bd2e6 100644 --- a/Source/Scene/GlobeSurfaceTileProvider.js +++ b/Source/Scene/GlobeSurfaceTileProvider.js @@ -175,7 +175,7 @@ define([ * A property specifying a {@link Rectangle} used to selectively limit terrain and imagery rendering. * @type {Rectangle} */ - this.geographicLimitRectangle = Rectangle.clone(Rectangle.MAX_VALUE); + this.cartographicLimitRectangle = Rectangle.clone(Rectangle.MAX_VALUE); } defineProperties(GlobeSurfaceTileProvider.prototype, { @@ -518,15 +518,15 @@ define([ var boundingSphereScratch = new BoundingSphere(); var rectangleIntersectionScratch = new Rectangle(); - var splitGeographicLimitRectangleScratch = new Rectangle(); + var splitCartographicLimitRectangleScratch = new Rectangle(); var rectangleCenterScratch = new Cartographic(); - // geographicLimitRectangle may span the IDL, but tiles never will. - function clipRectangleAntimeridian(tileRectangle, geographicLimitRectangle) { - if (geographicLimitRectangle.west < geographicLimitRectangle.east) { - return geographicLimitRectangle; + // cartographicLimitRectangle may span the IDL, but tiles never will. + function clipRectangleAntimeridian(tileRectangle, cartographicLimitRectangle) { + if (cartographicLimitRectangle.west < cartographicLimitRectangle.east) { + return cartographicLimitRectangle; } - var splitRectangle = Rectangle.clone(geographicLimitRectangle, splitGeographicLimitRectangleScratch); + var splitRectangle = Rectangle.clone(cartographicLimitRectangle, splitCartographicLimitRectangleScratch); var tileCenter = Rectangle.center(tileRectangle, rectangleCenterScratch); if (tileCenter.longitude > 0.0) { splitRectangle.east = CesiumMath.PI; @@ -564,8 +564,8 @@ define([ // Check if the tile is outside the limit area in cartographic space surfaceTile.clippedByBoundaries = false; - var clippedGeographicLimitRectangle = clipRectangleAntimeridian(tile.rectangle, this.geographicLimitRectangle); - var areaLimitIntersection = Rectangle.simpleIntersection(clippedGeographicLimitRectangle, tile.rectangle, rectangleIntersectionScratch); + var clippedCartographicLimitRectangle = clipRectangleAntimeridian(tile.rectangle, this.cartographicLimitRectangle); + var areaLimitIntersection = Rectangle.simpleIntersection(clippedCartographicLimitRectangle, tile.rectangle, rectangleIntersectionScratch); if (!defined(areaLimitIntersection)) { return Visibility.NONE; } @@ -617,7 +617,7 @@ define([ var modifiedModelViewScratch = new Matrix4(); var modifiedModelViewProjectionScratch = new Matrix4(); var tileRectangleScratch = new Cartesian4(); - var localizedGeographicLimitRectangleScratch = new Cartesian4(); + var localizedCartographicLimitRectangleScratch = new Cartesian4(); var rtcScratch = new Cartesian3(); var centerEyeScratch = new Cartesian3(); var southwestScratch = new Cartesian3(); @@ -959,8 +959,8 @@ define([ } return frameState.context.defaultTexture; }, - u_geographicLimitRectangle : function() { - return this.properties.localizedGeographicLimitRectangle; + u_cartographicLimitRectangle : function() { + return this.properties.localizedCartographicLimitRectangle; }, u_clippingPlanesMatrix : function() { var clippingPlanes = globeSurfaceTileProvider._clippingPlanes; @@ -1012,7 +1012,7 @@ define([ clippingPlanesEdgeColor : Color.clone(Color.WHITE), clippingPlanesEdgeWidth : 0.0, - localizedGeographicLimitRectangle : new Cartesian4() + localizedCartographicLimitRectangle : new Cartesian4() } }; @@ -1299,18 +1299,18 @@ define([ uniformMapProperties.southMercatorYAndOneOverHeight.y = oneOverMercatorHeight; // Convert tile limiter rectangle from cartographic to texture space using the tileRectangle. - var localizedGeographicLimitRectangle = localizedGeographicLimitRectangleScratch; - var geographicLimitRectangle = clipRectangleAntimeridian(tile.rectangle, tileProvider.geographicLimitRectangle); + var localizedCartographicLimitRectangle = localizedCartographicLimitRectangleScratch; + var cartographicLimitRectangle = clipRectangleAntimeridian(tile.rectangle, tileProvider.cartographicLimitRectangle); var cartographicTileRectangle = tile.rectangle; var inverseTileWidth = 1.0 / cartographicTileRectangle.width; var inverseTileHeight = 1.0 / cartographicTileRectangle.height; - localizedGeographicLimitRectangle.x = (geographicLimitRectangle.west - cartographicTileRectangle.west) * inverseTileWidth; - localizedGeographicLimitRectangle.y = (geographicLimitRectangle.south - cartographicTileRectangle.south) * inverseTileHeight; - localizedGeographicLimitRectangle.z = (geographicLimitRectangle.east - cartographicTileRectangle.west) * inverseTileWidth; - localizedGeographicLimitRectangle.w = (geographicLimitRectangle.north - cartographicTileRectangle.south) * inverseTileHeight; + localizedCartographicLimitRectangle.x = (cartographicLimitRectangle.west - cartographicTileRectangle.west) * inverseTileWidth; + localizedCartographicLimitRectangle.y = (cartographicLimitRectangle.south - cartographicTileRectangle.south) * inverseTileHeight; + localizedCartographicLimitRectangle.z = (cartographicLimitRectangle.east - cartographicTileRectangle.west) * inverseTileWidth; + localizedCartographicLimitRectangle.w = (cartographicLimitRectangle.north - cartographicTileRectangle.south) * inverseTileHeight; - Cartesian4.clone(localizedGeographicLimitRectangle, uniformMapProperties.localizedGeographicLimitRectangle); + Cartesian4.clone(localizedCartographicLimitRectangle, uniformMapProperties.localizedCartographicLimitRectangle); // For performance, use fog in the shader only when the tile is in fog. var applyFog = enableFog && CesiumMath.fog(tile._distance, frameState.fog.density) > CesiumMath.EPSILON3; diff --git a/Source/Shaders/GlobeFS.glsl b/Source/Shaders/GlobeFS.glsl index e41323d2182b..fcae7dcb54c5 100644 --- a/Source/Shaders/GlobeFS.glsl +++ b/Source/Shaders/GlobeFS.glsl @@ -52,7 +52,7 @@ uniform vec2 u_lightingFadeDistance; #endif #ifdef TILE_LIMIT_RECTANGLE -uniform vec4 u_geographicLimitRectangle; +uniform vec4 u_cartographicLimitRectangle; #endif #ifdef ENABLE_CLIPPING_PLANES @@ -161,8 +161,8 @@ void main() { #ifdef TILE_LIMIT_RECTANGLE - if (v_textureCoordinates.x < u_geographicLimitRectangle.x || u_geographicLimitRectangle.z < v_textureCoordinates.x || - v_textureCoordinates.y < u_geographicLimitRectangle.y || u_geographicLimitRectangle.w < v_textureCoordinates.y) + if (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x || + v_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y) { discard; } diff --git a/Specs/Scene/GlobeSurfaceTileProviderSpec.js b/Specs/Scene/GlobeSurfaceTileProviderSpec.js index 9040a085bb84..4a1b25930027 100644 --- a/Specs/Scene/GlobeSurfaceTileProviderSpec.js +++ b/Specs/Scene/GlobeSurfaceTileProviderSpec.js @@ -938,7 +938,7 @@ defineSuite([ }).toThrowDeveloperError(); }); - it('geographicLimitRectangle selectively enables rendering globe surface', function() { + it('cartographicLimitRectangle selectively enables rendering globe surface', function() { expect(scene).toRender([0, 0, 0, 255]); switchViewMode(SceneMode.COLUMBUS_VIEW, new GeographicProjection(Ellipsoid.WGS84)); var result; @@ -948,10 +948,10 @@ defineSuite([ result = rgba; expect(rgba).not.toEqual([0, 0, 0, 255]); }); - scene.globe.geographicLimitRectangle = Rectangle.fromDegrees(-2, -2, -1, -1); + scene.globe.cartographicLimitRectangle = Rectangle.fromDegrees(-2, -2, -1, -1); expect(scene).notToRender(result); scene.camera.setView({ - destination : scene.globe.geographicLimitRectangle + destination : scene.globe.cartographicLimitRectangle }); return updateUntilDone(scene.globe); }) @@ -960,12 +960,12 @@ defineSuite([ }); }); - it('geographicLimitRectangle culls tiles outside the region', function() { + it('cartographicLimitRectangle culls tiles outside the region', function() { switchViewMode(SceneMode.COLUMBUS_VIEW, new GeographicProjection(Ellipsoid.WGS84)); var unculledCommandCount; return updateUntilDone(scene.globe).then(function() { unculledCommandCount = scene.frameState.commandList.length; - scene.globe.geographicLimitRectangle = Rectangle.fromDegrees(-2, -2, -1, -1); + scene.globe.cartographicLimitRectangle = Rectangle.fromDegrees(-2, -2, -1, -1); return updateUntilDone(scene.globe); }) .then(function() { @@ -973,12 +973,12 @@ defineSuite([ }); }); - it('geographicLimitRectangle may cross the antimeridian', function() { + it('cartographicLimitRectangle may cross the antimeridian', function() { switchViewMode(SceneMode.SCENE2D, new GeographicProjection(Ellipsoid.WGS84)); var unculledCommandCount; return updateUntilDone(scene.globe).then(function() { unculledCommandCount = scene.frameState.commandList.length; - scene.globe.geographicLimitRectangle = Rectangle.fromDegrees(179, -2, -179, -1); + scene.globe.cartographicLimitRectangle = Rectangle.fromDegrees(179, -2, -179, -1); return updateUntilDone(scene.globe); }) .then(function() {