Skip to content

Commit e49d8c2

Browse files
committed
Merge branch 'request-performance' into traversal-cleanup
2 parents 3f6714b + fc65396 commit e49d8c2

File tree

124 files changed

+8260
-845
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+8260
-845
lines changed

.concierge/templates/pullRequestOpened.hbs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ If this is your first contribution, please send in a [Contributor License Agreem
1010
```
1111
{{else}}
1212
{{#if askForCla}}
13-
[![Please sign the CLA before we review this PR.](https://img.shields.io/badge/CLA-required-red.svg)](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/CONTRIBUTING.md#contributor-license-agreement-cla)
13+
[![Please sign the CLA before we review this PR.](https://img.shields.io/badge/CLA-required-red.png)](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/CONTRIBUTING.md#contributor-license-agreement-cla)
1414

1515
Welcome to the Cesium community @{{ userName }}!
1616

1717
Can you please send in a [Contributor License Agreement](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/CONTRIBUTING.md#contributor-license-agreement-cla) (CLA) so that we can review and merge this pull request?
1818
{{else}}
19-
![Signed CLA is on file.](https://img.shields.io/badge/CLA-signed-brightgreen.svg)
19+
![Signed CLA is on file.](https://img.shields.io/badge/CLA-signed-brightgreen.png)
2020

2121
@{{ userName }}, thanks for the pull request! Maintainers, we have a signed CLA from @{{ userName }}, so you can review this at any time.
2222
{{/if}}

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
"node_modules": true,
1818
"Source/Shaders/**/*.js": true
1919
},
20+
"files.associations": {
21+
"*.czml": "json"
22+
},
2023
"files.trimTrailingWhitespace": true,
2124
"files.insertFinalNewline": true,
2225
"editor.insertSpaces": true,

Apps/Sandcastle/gallery/3D Tiles Feature Picking.html

+11-12
Original file line numberDiff line numberDiff line change
@@ -73,25 +73,24 @@
7373

7474
// If silhouettes are supported, silhouette features in blue on mouse over and silhouette green on mouse click.
7575
// If silhouettes are not supported, change the feature color to yellow on mouse over and green on mouse click.
76-
77-
var silhouetteBlue = Cesium.PostProcessStageLibrary.createEdgeDetectionStage();
78-
if (silhouetteBlue.isSupported(viewer.scene)) {
76+
if (Cesium.PostProcessStageLibrary.isSilhouetteSupported(viewer.scene)) {
7977
// Silhouettes are supported
78+
var silhouetteBlue = Cesium.PostProcessStageLibrary.createEdgeDetectionStage();
8079
silhouetteBlue.uniforms.color = Cesium.Color.BLUE;
8180
silhouetteBlue.uniforms.length = 0.01;
82-
silhouetteBlue.selectedFeatures = [];
81+
silhouetteBlue.selected = [];
8382

8483
var silhouetteGreen = Cesium.PostProcessStageLibrary.createEdgeDetectionStage();
8584
silhouetteGreen.uniforms.color = Cesium.Color.LIME;
8685
silhouetteGreen.uniforms.length = 0.01;
87-
silhouetteGreen.selectedFeatures = [];
86+
silhouetteGreen.selected = [];
8887

8988
viewer.scene.postProcessStages.add(Cesium.PostProcessStageLibrary.createSilhouetteStage([silhouetteBlue, silhouetteGreen]));
9089

9190
// Silhouette a feature blue on hover.
9291
viewer.screenSpaceEventHandler.setInputAction(function onMouseMove(movement) {
9392
// If a feature was previously highlighted, undo the highlight
94-
silhouetteBlue.selectedFeatures = [];
93+
silhouetteBlue.selected = [];
9594

9695
// Pick a new feature
9796
var pickedFeature = viewer.scene.pick(movement.endPosition);
@@ -112,14 +111,14 @@
112111

113112
// Highlight the feature if it's not already selected.
114113
if (pickedFeature !== selected.feature) {
115-
silhouetteBlue.selectedFeatures = [pickedFeature];
114+
silhouetteBlue.selected = [pickedFeature];
116115
}
117116
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
118117

119118
// Silhouette a feature on selection and show metadata in the InfoBox.
120119
viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) {
121120
// If a feature was previously selected, undo the highlight
122-
silhouetteGreen.selectedFeatures = [];
121+
silhouetteGreen.selected = [];
123122

124123
// Pick a new feature
125124
var pickedFeature = viewer.scene.pick(movement.position);
@@ -129,18 +128,18 @@
129128
}
130129

131130
// Select the feature if it's not already selected
132-
if (silhouetteGreen.selectedFeatures[0] === pickedFeature) {
131+
if (silhouetteGreen.selected[0] === pickedFeature) {
133132
return;
134133
}
135134

136135
// Save the selected feature's original color
137-
var highlightedFeature = silhouetteBlue.selectedFeatures[0];
136+
var highlightedFeature = silhouetteBlue.selected[0];
138137
if (pickedFeature === highlightedFeature) {
139-
silhouetteBlue.selectedFeatures = [];
138+
silhouetteBlue.selected = [];
140139
}
141140

142141
// Highlight newly selected feature
143-
silhouetteGreen.selectedFeatures = [pickedFeature];
142+
silhouetteGreen.selected = [pickedFeature];
144143

145144
// Set feature infobox description
146145
var featureName = pickedFeature.getProperty('name');

Apps/Sandcastle/gallery/Ambient Occlusion.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
//Sandcastle_Begin
6161
var viewer = new Cesium.Viewer('cesiumContainer');
6262

63-
if (!viewer.scene.postProcessStages.ambientOcclusion.isSupported(viewer.scene)) {
63+
if (!Cesium.PostProcessStageLibrary.isAmbientOcclusionSupported(viewer.scene)) {
6464
console.log('This browser does not support the ambient occlusion post process.');
6565
}
6666

Apps/Sandcastle/gallery/CZML Polyline.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"version" : "1.0"
3535
}, {
3636
"id" : "redLine",
37-
"name" : "Red line on the surface",
37+
"name" : "Red line clamped to terain",
3838
"polyline" : {
3939
"positions" : {
4040
"cartographicDegrees" : [
@@ -49,7 +49,8 @@
4949
}
5050
}
5151
},
52-
"width" : 5
52+
"width" : 5,
53+
"clampToGround" : true
5354
}
5455
}, {
5556
"id" : "blueLine",
+133
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
7+
<meta name="description" content="CZML Z-indexing">
8+
<meta name="cesium-sandcastle-labels" content="CZML">
9+
<title>Cesium Demo</title>
10+
<script type="text/javascript" src="../Sandcastle-header.js"></script>
11+
<script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.20/require.js"></script>
12+
<script type="text/javascript">
13+
if(typeof require === "function") {
14+
require.config({
15+
baseUrl : '../../../Source',
16+
waitSeconds : 120
17+
});
18+
}
19+
</script>
20+
</head>
21+
<body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html">
22+
<style>
23+
@import url(../templates/bucket.css);
24+
</style>
25+
<div id="cesiumContainer" class="fullSize"></div>
26+
<div id="loadingOverlay"><h1>Loading...</h1></div>
27+
<div id="toolbar"></div>
28+
29+
<script id="cesium_sandcastle_script">
30+
function startup(Cesium) {
31+
'use strict';
32+
//Sandcastle_Begin
33+
var czml = [{
34+
"id" : "document",
35+
"name" : "CZML zIndex",
36+
"version" : "1.0"
37+
}, {
38+
"id" : "shape1",
39+
"name" : "Blue circle",
40+
"position" : {
41+
"cartographicDegrees" : [-105.0, 40.0, 0.0]
42+
},
43+
"ellipse" : {
44+
"semiMinorAxis" : 300000.0,
45+
"semiMajorAxis" : 300000.0,
46+
"zIndex" : 3,
47+
"material" : {
48+
"solidColor" : {
49+
"color" : {
50+
"rgba" : [0, 0, 255, 255]
51+
}
52+
}
53+
}
54+
}
55+
}, {
56+
"id" : "shape2",
57+
"name" : "Green corridor",
58+
"corridor" : {
59+
"positions" : {
60+
"cartographicDegrees" : [
61+
-90.0, 43.0, 0,
62+
-95.0, 43.0, 0,
63+
-95.0, 38.0, 0
64+
]
65+
},
66+
"width" : 200000.0,
67+
"zIndex" : 3,
68+
"material" : {
69+
"solidColor" : {
70+
"color" : {
71+
"rgba" : [0, 255, 0, 255]
72+
}
73+
}
74+
}
75+
}
76+
}, {
77+
"id" : "shape3",
78+
"name" : "Red polygon",
79+
"polygon" : {
80+
"positions" : {
81+
"cartographicDegrees" : [
82+
-115.0, 47.0, 0,
83+
-115.0, 42.0, 0,
84+
-107.0, 43.0, 0,
85+
-102.0, 41.0, 0,
86+
-102.0, 45.0, 0
87+
]
88+
},
89+
"zIndex" : 1,
90+
"material" : {
91+
"solidColor" : {
92+
"color" : {
93+
"rgba" : [255, 0, 0, 255]
94+
}
95+
}
96+
}
97+
}
98+
}, {
99+
"id" : "shape4",
100+
"name" : "Striped rectangle",
101+
"rectangle" : {
102+
"coordinates" : {
103+
"wsenDegrees" : [-105, 40, -95, 50]
104+
},
105+
"zIndex" : 2,
106+
"fill" : true,
107+
"material" : {
108+
"stripe" : {
109+
"orientation" : "VERTICAL",
110+
"evenColor" : { "rgba" : [255, 255, 0, 255] },
111+
"oddColor" : { "rgba" : [255, 0, 255, 255] },
112+
"repeat" : 5
113+
}
114+
}
115+
}
116+
}];
117+
118+
var viewer = new Cesium.Viewer('cesiumContainer');
119+
var dataSourcePromise = Cesium.CzmlDataSource.load(czml);
120+
viewer.dataSources.add(dataSourcePromise);
121+
viewer.zoomTo(dataSourcePromise);
122+
123+
//Sandcastle_End
124+
Sandcastle.finishedLoading();
125+
}
126+
if (typeof Cesium !== "undefined") {
127+
startup(Cesium);
128+
} else if (typeof require === "function") {
129+
require(["Cesium"], startup);
130+
}
131+
</script>
132+
</body>
133+
</html>
22 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
7+
<meta name="description" content="Custom per-feature post processing effect.">
8+
<meta name="cesium-sandcastle-labels" content="Showcases, Post Processing">
9+
<title>Cesium Demo</title>
10+
<script type="text/javascript" src="../Sandcastle-header.js"></script>
11+
<script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.20/require.js"></script>
12+
<script type="text/javascript">
13+
require.config({
14+
baseUrl : '../../../Source',
15+
waitSeconds : 60
16+
});
17+
</script>
18+
</head>
19+
<body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html">
20+
<style>
21+
@import url(../templates/bucket.css);
22+
</style>
23+
<div id="cesiumContainer" class="fullSize"></div>
24+
<div id="loadingOverlay"><h1>Loading...</h1></div>
25+
<div id="toolbar"></div>
26+
<script id="cesium_sandcastle_script">
27+
function startup(Cesium) {
28+
'use strict';
29+
//Sandcastle_Begin
30+
var viewer = new Cesium.Viewer('cesiumContainer', {
31+
shouldAnimate : true
32+
});
33+
var scene = viewer.scene;
34+
35+
var position = Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706);
36+
var url = '../../SampleData/models/CesiumMan/Cesium_Man.glb';
37+
var entity = viewer.trackedEntity = viewer.entities.add({
38+
name : url,
39+
position : position,
40+
model : {
41+
uri : url
42+
}
43+
});
44+
45+
// Shade selected model with highlight.
46+
var fragmentShaderSource =
47+
'uniform sampler2D colorTexture;\n' +
48+
'varying vec2 v_textureCoordinates;\n' +
49+
'uniform vec4 highlight;\n' +
50+
'void main() {\n' +
51+
' vec4 color = texture2D(colorTexture, v_textureCoordinates);\n' +
52+
' if (czm_selected()) {\n' +
53+
' vec3 highlighted = highlight.a * highlight.rgb + (1.0 - highlight.a) * color.rgb;\n' +
54+
' gl_FragColor = vec4(highlighted, 1.0);\n' +
55+
' } else { \n' +
56+
' gl_FragColor = color;\n' +
57+
' }\n' +
58+
'}\n';
59+
var stage = scene.postProcessStages.add(new Cesium.PostProcessStage({
60+
fragmentShader : fragmentShaderSource,
61+
uniforms : {
62+
highlight : function() {
63+
return new Cesium.Color(1.0, 0.0, 0.0, 0.5);
64+
}
65+
}
66+
}));
67+
stage.selected = [];
68+
69+
var handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
70+
handler.setInputAction(function(movement) {
71+
var pickedObject = viewer.scene.pick(movement.endPosition);
72+
if (Cesium.defined(pickedObject)) {
73+
stage.selected = [pickedObject.primitive];
74+
} else {
75+
stage.selected = [];
76+
}
77+
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
78+
79+
//Sandcastle_End
80+
Sandcastle.finishedLoading();
81+
}
82+
if (typeof Cesium !== "undefined") {
83+
startup(Cesium);
84+
} else if (typeof require === "function") {
85+
require(["Cesium"], startup);
86+
}
87+
</script>
88+
</body>
89+
</html>
Loading

Apps/Sandcastle/gallery/Depth of Field.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,12 @@
9393
}
9494
}
9595

96-
var depthOfField = viewer.scene.postProcessStages.add(Cesium.PostProcessStageLibrary.createDepthOfFieldStage());
97-
if (!depthOfField.isSupported(viewer.scene)) {
96+
if (!Cesium.PostProcessStageLibrary.isDepthOfFieldSupported(viewer.scene)) {
9897
console.log('This browser does not support the depth of field post process.');
9998
}
10099

100+
var depthOfField = viewer.scene.postProcessStages.add(Cesium.PostProcessStageLibrary.createDepthOfFieldStage());
101+
101102
function updatePostProcess() {
102103
depthOfField.enabled = Boolean(viewModel.show);
103104
depthOfField.uniforms.focalDistance = Number(viewModel.focalDistance);

0 commit comments

Comments
 (0)