Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable clip plane shader code in IE, update docs #6079

Merged
merged 1 commit into from
Jan 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Apps/Sandcastle/gallery/3D Tiles Clipping Planes.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@

// Add a clipping plane, a plane geometry to show the representation of the
// plane, and control the magnitude of the plane distance with the mouse.
// Clipping planes are not currently supported in Internet Explorer.

var viewer = new Cesium.Viewer('cesiumContainer', {
infoBox: false,
Expand Down
3 changes: 3 additions & 0 deletions Apps/Sandcastle/gallery/Terrain Clipping Planes.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
function startup(Cesium) {
'use strict';
//Sandcastle_Begin
// Use clipping planes to selectively hide parts of the globe surface.
// Clipping planes are not currently supported in Internet Explorer.

var viewer = new Cesium.Viewer('cesiumContainer', {
skyAtmosphere: false
});
Expand Down
4 changes: 2 additions & 2 deletions Source/Scene/Cesium3DTileset.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ define([
* @param {Number} [options.skipLevels=1] When <code>skipLevelOfDetail</code> is <code>true</code>, a constant defining the minimum number of levels to skip when loading tiles. When it is 0, no levels are skipped. Used in conjunction with <code>skipScreenSpaceErrorFactor</code> to determine which tiles to load.
* @param {Boolean} [options.immediatelyLoadDesiredLevelOfDetail=false] When <code>skipLevelOfDetail</code> is <code>true</code>, only tiles that meet the maximum screen space error will ever be downloaded. Skipping factors are ignored and just the desired tiles are loaded.
* @param {Boolean} [options.loadSiblings=false] When <code>skipLevelOfDetail</code> is <code>true</code>, determines whether siblings of visible tiles are always downloaded during traversal.
* @param {ClippingPlaneCollection} [options.clippingPlanes] The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset.
* @param {ClippingPlaneCollection} [options.clippingPlanes] The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset. Clipping planes are not currently supported in Internet Explorer.
* @param {Boolean} [options.debugFreezeFrame=false] For debugging only. Determines if only the tiles from last frame should be used for rendering.
* @param {Boolean} [options.debugColorizeTiles=false] For debugging only. When true, assigns a random color to each tile.
* @param {Boolean} [options.debugWireframe=false] For debugging only. When true, render's each tile's content as a wireframe.
Expand Down Expand Up @@ -520,7 +520,7 @@ define([
this.loadSiblings = defaultValue(options.loadSiblings, false);

/**
* The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset.
* The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset. Clipping planes are not currently supported in Internet Explorer.
*
* @type {ClippingPlaneCollection}
*/
Expand Down
2 changes: 1 addition & 1 deletion Source/Scene/Globe.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ define([
}
},
/**
* A property specifying a {@link ClippingPlaneCollection} used to selectively disable rendering on the outside of each plane.
* A property specifying a {@link ClippingPlaneCollection} used to selectively disable rendering on the outside of each plane. Clipping planes are not currently supported in Internet Explorer.
*
* @memberof Globe.prototype
* @type {ClippingPlaneCollection}
Expand Down
4 changes: 3 additions & 1 deletion Source/Scene/GlobeSurfaceTileProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ define([
'../Core/destroyObject',
'../Core/DeveloperError',
'../Core/Event',
'../Core/FeatureDetection',
'../Core/GeometryInstance',
'../Core/GeometryPipeline',
'../Core/IndexDatatype',
Expand Down Expand Up @@ -59,6 +60,7 @@ define([
destroyObject,
DeveloperError,
Event,
FeatureDetection,
GeometryInstance,
GeometryPipeline,
IndexDatatype,
Expand Down Expand Up @@ -1320,7 +1322,7 @@ define([
uniformMapProperties.clippingPlanesEdgeWidth = clippingPlanes.edgeWidth;
}

var clippingPlanesEnabled = defined(clippingPlanes) && clippingPlanes.enabled && (uniformMapProperties.clippingPlanes.length > 0);
var clippingPlanesEnabled = defined(clippingPlanes) && clippingPlanes.enabled && (uniformMapProperties.clippingPlanes.length > 0) && !FeatureDetection.isInternetExplorer();
var unionClippingRegions = clippingPlanesEnabled ? clippingPlanes.unionClippingRegions : false;

if (defined(tileProvider.uniformMap)) {
Expand Down
8 changes: 5 additions & 3 deletions Source/Scene/Model.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ define([
* @param {Number} [options.colorBlendAmount=0.5] Value used to determine the color strength when the <code>colorBlendMode</code> is <code>MIX</code>. 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.
* @param {ClippingPlaneCollection} [options.clippingPlanes] The {@link ClippingPlaneCollection} used to selectively disable rendering the model. Clipping planes are not currently supported in Internet Explorer.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sort of a side note, but can you list this option in Model.fromGltf as well?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add warning to ModelGraphics.

*
* @exception {DeveloperError} bgltf is not a valid Binary glTF file.
* @exception {DeveloperError} Only glTF Binary version 1 is supported.
Expand Down Expand Up @@ -586,7 +586,7 @@ define([
this.colorBlendAmount = defaultValue(options.colorBlendAmount, 0.5);

/**
* The {@link ClippingPlaneCollection} used to selectively disable rendering the model.
* The {@link ClippingPlaneCollection} used to selectively disable rendering the model. Clipping planes are not currently supported in Internet Explorer.
*
* @type {ClippingPlaneCollection}
*/
Expand Down Expand Up @@ -2116,7 +2116,9 @@ define([

var premultipliedAlpha = hasPremultipliedAlpha(model);
var finalFS = modifyShaderForColor(fs, premultipliedAlpha);
finalFS = modifyShaderForClippingPlanes(finalFS);
if (!FeatureDetection.isInternetExplorer()) {
finalFS = modifyShaderForClippingPlanes(finalFS);
}

var drawVS = modifyShader(vs, id, model._vertexShaderLoaded);
var drawFS = modifyShader(finalFS, id, model._fragmentShaderLoaded);
Expand Down
2 changes: 1 addition & 1 deletion Source/Scene/PointCloud3DTileContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ define([
var hasColorStyle = defined(colorStyleFunction);
var hasShowStyle = defined(showStyleFunction);
var hasPointSizeStyle = defined(pointSizeStyleFunction);
var hasClippedContent = defined(clippingPlanes) && clippingPlanes.enabled && content._tile._isClipped;
var hasClippedContent = defined(clippingPlanes) && clippingPlanes.enabled && content._tile._isClipped && !FeatureDetection.isInternetExplorer();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this check could be centralized somewhere? ClippingPlaneCollection.isSupported?

For reference: https:/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/ClassificationPrimitive.js#L340-L348


// Get the properties in use by the style
var styleableProperties = [];
Expand Down