diff --git a/CHANGES.md b/CHANGES.md index 5f977351338f..67e40e0b2423 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,10 @@ Change Log ========== +### 1.42 - 2018-02-01 + +* Added `ClippingPlaneCollection.isSupported` function for checking if rendering with clipping planes is supported. + ### 1.41 - 2018-01-02 * Breaking changes diff --git a/Source/Core/ClippingPlaneCollection.js b/Source/Core/ClippingPlaneCollection.js index e2d9e44f5837..17df18873fcd 100644 --- a/Source/Core/ClippingPlaneCollection.js +++ b/Source/Core/ClippingPlaneCollection.js @@ -7,6 +7,7 @@ define([ './defined', './defineProperties', './DeveloperError', + './FeatureDetection', './Intersect', './Matrix4', './Plane' @@ -19,6 +20,7 @@ define([ defined, defineProperties, DeveloperError, + FeatureDetection, Intersect, Matrix4, Plane) { @@ -362,6 +364,15 @@ define([ return intersection; }; + /** + * Determines if rendering with clipping planes is supported. + * + * @returns {Boolean} true if ClippingPlaneCollections are supported; otherwise, returns false + */ + ClippingPlaneCollection.isSupported = function() { + return !FeatureDetection.isInternetExplorer(); + }; + /** * The maximum number of supported clipping planes. * diff --git a/Source/DataSources/ModelGraphics.js b/Source/DataSources/ModelGraphics.js index 5d583551cff3..4c4676a5cea8 100644 --- a/Source/DataSources/ModelGraphics.js +++ b/Source/DataSources/ModelGraphics.js @@ -55,7 +55,7 @@ define([ * @param {Property} [options.color=Color.WHITE] A Property specifying the {@link Color} that blends with the model's rendered color. * @param {Property} [options.colorBlendMode=ColorBlendMode.HIGHLIGHT] An enum Property specifying how the color blends with the model. * @param {Property} [options.colorBlendAmount=0.5] A numeric Property specifying the color strength when the colorBlendMode is MIX. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two. - * @param {Property} [options.clippingPlanes] A property specifying the {@link ClippingPlaneCollection} used to selectively disable rendering the model. + * @param {Property} [options.clippingPlanes] A property specifying the {@link ClippingPlaneCollection} used to selectively disable rendering the model. Clipping planes are not currently supported in Internet Explorer. * * @see {@link http://cesiumjs.org/2014/03/03/Cesium-3D-Models-Tutorial/|3D Models Tutorial} * @demo {@link http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=3D%20Models.html|Cesium Sandcastle 3D Models Demo} diff --git a/Source/Scene/GlobeSurfaceTileProvider.js b/Source/Scene/GlobeSurfaceTileProvider.js index 918ecd1ee83a..f1a092cc86ab 100644 --- a/Source/Scene/GlobeSurfaceTileProvider.js +++ b/Source/Scene/GlobeSurfaceTileProvider.js @@ -4,6 +4,7 @@ define([ '../Core/Cartesian2', '../Core/Cartesian3', '../Core/Cartesian4', + '../Core/ClippingPlaneCollection', '../Core/Color', '../Core/ColorGeometryInstanceAttribute', '../Core/combine', @@ -13,7 +14,6 @@ define([ '../Core/destroyObject', '../Core/DeveloperError', '../Core/Event', - '../Core/FeatureDetection', '../Core/GeometryInstance', '../Core/GeometryPipeline', '../Core/IndexDatatype', @@ -51,6 +51,7 @@ define([ Cartesian2, Cartesian3, Cartesian4, + ClippingPlaneCollection, Color, ColorGeometryInstanceAttribute, combine, @@ -60,7 +61,6 @@ define([ destroyObject, DeveloperError, Event, - FeatureDetection, GeometryInstance, GeometryPipeline, IndexDatatype, @@ -1322,7 +1322,7 @@ define([ uniformMapProperties.clippingPlanesEdgeWidth = clippingPlanes.edgeWidth; } - var clippingPlanesEnabled = defined(clippingPlanes) && clippingPlanes.enabled && (uniformMapProperties.clippingPlanes.length > 0) && !FeatureDetection.isInternetExplorer(); + var clippingPlanesEnabled = defined(clippingPlanes) && clippingPlanes.enabled && (uniformMapProperties.clippingPlanes.length > 0) && ClippingPlaneCollection.isSupported(); var unionClippingRegions = clippingPlanesEnabled ? clippingPlanes.unionClippingRegions : false; if (defined(tileProvider.uniformMap)) { diff --git a/Source/Scene/Model.js b/Source/Scene/Model.js index 59678a227458..49ddb8acf0d5 100644 --- a/Source/Scene/Model.js +++ b/Source/Scene/Model.js @@ -4,6 +4,7 @@ define([ '../Core/Cartesian3', '../Core/Cartesian4', '../Core/Cartographic', + '../Core/ClippingPlaneCollection', '../Core/clone', '../Core/Color', '../Core/combine', @@ -81,6 +82,7 @@ define([ Cartesian3, Cartesian4, Cartographic, + ClippingPlaneCollection, clone, Color, combine, @@ -1135,6 +1137,15 @@ define([ * @param {ShadowMode} [options.shadows=ShadowMode.ENABLED] Determines whether the model casts or receives shadows from each light source. * @param {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Draws the bounding sphere for each {@link DrawCommand} in the model. * @param {Boolean} [options.debugWireframe=false] For debugging only. Draws the model in wireframe. + * @param {HeightReference} [options.heightReference] Determines how the model is drawn relative to terrain. + * @param {Scene} [options.scene] Must be passed in for models that use the height reference property. + * @param {DistanceDisplayCondition} [options.distanceDisplayCondition] The condition specifying at what distance from the camera that this model will be displayed. + * @param {Color} [options.color=Color.WHITE] A color that blends with the model's rendered color. + * @param {ColorBlendMode} [options.colorBlendMode=ColorBlendMode.HIGHLIGHT] Defines how the color blends with the model. + * @param {Number} [options.colorBlendAmount=0.5] Value used to determine the color strength when the colorBlendMode is MIX. A value of 0.0 results in the model's rendered color while a value of 1.0 results in a solid color, with any value in-between resulting in a mix of the two. + * @param {Color} [options.silhouetteColor=Color.RED] The silhouette color. If more than 256 models have silhouettes enabled, there is a small chance that overlapping models will have minor artifacts. + * @param {Number} [options.silhouetteSize=0.0] The size of the silhouette in pixels. + * @param {ClippingPlaneCollection} [options.clippingPlanes] The {@link ClippingPlaneCollection} used to selectively disable rendering the model. Clipping planes are not currently supported in Internet Explorer. * * @returns {Model} The newly created model. * @@ -2116,7 +2127,7 @@ define([ var premultipliedAlpha = hasPremultipliedAlpha(model); var finalFS = modifyShaderForColor(fs, premultipliedAlpha); - if (!FeatureDetection.isInternetExplorer()) { + if (ClippingPlaneCollection.isSupported()) { finalFS = modifyShaderForClippingPlanes(finalFS); } diff --git a/Source/Scene/PointCloud3DTileContent.js b/Source/Scene/PointCloud3DTileContent.js index 0fbfc826578f..ad6d18208e6a 100644 --- a/Source/Scene/PointCloud3DTileContent.js +++ b/Source/Scene/PointCloud3DTileContent.js @@ -2,6 +2,7 @@ define([ '../Core/Cartesian2', '../Core/Cartesian3', '../Core/Cartesian4', + '../Core/ClippingPlaneCollection', '../Core/Color', '../Core/combine', '../Core/ComponentDatatype', @@ -38,6 +39,7 @@ define([ Cartesian2, Cartesian3, Cartesian4, + ClippingPlaneCollection, Color, combine, ComponentDatatype, @@ -844,7 +846,7 @@ define([ var hasColorStyle = defined(colorStyleFunction); var hasShowStyle = defined(showStyleFunction); var hasPointSizeStyle = defined(pointSizeStyleFunction); - var hasClippedContent = defined(clippingPlanes) && clippingPlanes.enabled && content._tile._isClipped && !FeatureDetection.isInternetExplorer(); + var hasClippedContent = defined(clippingPlanes) && clippingPlanes.enabled && content._tile._isClipped && ClippingPlaneCollection.isSupported(); // Get the properties in use by the style var styleableProperties = [];