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

Terrain / imagery rendering overhaul #7061

Merged
merged 150 commits into from
Feb 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
834aea0
Start of BVH work.
kring Jun 6, 2018
509799f
Merge pull request #31 from AnalyticalGraphicsInc/master
kring Jun 6, 2018
6106795
Merge remote-tracking branch 'upstream/master' into bvh
kring Jun 12, 2018
34bbcc6
Start removing unnecessary upsampling.
kring Jun 14, 2018
88d0fdc
Compute the bounding volume (for culling) as needed.
kring Jun 16, 2018
d51bc73
Make terrain rendering mostly work again.
kring Jun 18, 2018
763976d
Get to upsampling more quickly.
kring Jun 19, 2018
8d47f39
Correctly account for Cesium's tile numbering (from the North).
kring Jun 19, 2018
902052a
Remove TileTerrain.
kring Jun 20, 2018
4d5c53e
Remove more unused tile properties.
kring Jun 20, 2018
c3f4931
More efficient way to finding closest renderable tile.
kring Jun 21, 2018
37e352f
Fix problems with heightmap terrain / no availability data.
kring Jun 22, 2018
4ea1a5d
Fix flipped bounding region estimation.
kring Jun 24, 2018
ee388ff
Load tiles near viewport center first.
kring Jun 25, 2018
827c8bc
Improve tile load prioritization.
kring Jun 26, 2018
7e93c95
Tiny optimization.
kring Jun 26, 2018
a4de6d4
Don't render a million subsets of the same tile for now reason.
kring Jun 26, 2018
72e548e
Optimize out heaps of unnecessary loading.
kring Jun 28, 2018
c5aa64d
Fix distance sorting, cleanup and commenting.
kring Jun 29, 2018
a11e43f
Fix some test failures, add some comments.
kring Jun 29, 2018
93105ce
Tweak root tile selection.
kring Jun 29, 2018
78bc480
Fix test failures in QuadtreePrimitiveSpec.
kring Jun 29, 2018
8fc7a0d
Don't render children until all visible ones are renderable.
kring Jul 2, 2018
1ce367d
Add some tweakable options to QuadtreePrimitive and
kring Jul 5, 2018
e614d6e
Fix test failure, improve camera terrain adjustment.
kring Jul 5, 2018
a462ddc
Fix exaggeration, other cleanup.
kring Jul 6, 2018
2858d6b
Fix eslint warnings.
kring Jul 6, 2018
5d79e11
Fix broken water mask.
kring Jul 6, 2018
61432c1
Fix 2D/CV.
kring Jul 6, 2018
9cf032b
Merge remote-tracking branch 'origin/master' into bvh
kring Jul 6, 2018
14f56ff
Merge remote-tracking branch 'upstream/master' into bvh
kring Jul 6, 2018
3b77787
Super hacky fill tile generation.
kring Jul 26, 2018
4711ac8
Don't load ancestors.
kring Jul 27, 2018
db5f87d
Fix implementing new traversal.
kring Jul 31, 2018
f9546e0
Fix a bug, add some options.
kring Jul 31, 2018
aa4b806
Much better (but still imperfect) fill tiling.
kring Aug 7, 2018
237f8de
Fix a bug that made fill tiles flicker out after partial load.
kring Aug 8, 2018
0328cc9
Don't regenerate fill tiles every frame.
kring Sep 5, 2018
955c996
New fill tile code kinda working.
kring Sep 11, 2018
3a93a10
Add edge vertices, fix bugs.
kring Sep 12, 2018
34160b7
Use correct index for interpolation.
kring Sep 12, 2018
98d414a
Handle totally disconnected fill tiles.
kring Sep 12, 2018
f58b7f8
Prefer a corner derived from an adjacent edge
kring Sep 13, 2018
8eacbf5
Less crashy.
kring Sep 13, 2018
33faa19
Remove unnecessary code and fill tile shading.
kring Sep 13, 2018
db79a4f
Fix eslint warnings and heightmap terrain.
kring Sep 21, 2018
1945b68
Merge remote-tracking branch 'upstream/master' into fill-tiles
kring Sep 21, 2018
2402997
Remmove ability to render partial tiles.
kring Sep 23, 2018
7b1ba22
Remove bad assertion.
kring Sep 23, 2018
94067ff
Optional fill tile highlighting.
kring Sep 23, 2018
042abb2
Merge remote-tracking branch 'upstream/master' into fill-tiles
kring Oct 5, 2018
2df6dcc
Add Terrain Tweaks Sandcastle example.
kring Oct 5, 2018
4eebbbb
Add fill tile highlight option to Terrain Tweaks.html.
kring Oct 5, 2018
955c6ab
Move comparison funcs to CesiumMath, other cleanup.
kring Oct 5, 2018
f21a0b0
Fixed a bug propating edges across the antimeridian.
kring Oct 5, 2018
b68efbd
Fix another antimeridian problem.
kring Oct 6, 2018
16268a1
Address some TODOs.
kring Oct 6, 2018
6a53390
Cleanup.
kring Oct 6, 2018
a0cd910
Removing missing tile strategy.
kring Oct 6, 2018
d808d2f
Merge remote-tracking branch 'upstream/master' into fill-tiles
kring Oct 18, 2018
395529d
Eliminate a copy while creating fill meshes.
kring Nov 6, 2018
90e67ef
Fix incorrect default.
kring Nov 6, 2018
bb92ea4
Eliminate another copy.
kring Nov 6, 2018
1a419c8
Remove unnecessary check and allocation.
kring Nov 6, 2018
c4d5a1c
Merge remote-tracking branch 'upstream/master' into fill-tiles
kring Nov 6, 2018
738b60a
Merge remote-tracking branch 'upstream/master' into fill-tiles
kring Nov 9, 2018
b253b66
Cleanup.
kring Nov 9, 2018
685dee3
More cleanup.
kring Nov 9, 2018
0d33623
Remove TerrainTileEdgeDetails.js.
kring Nov 12, 2018
11eb02c
The cleanup fun never ends.
kring Nov 12, 2018
8222a0a
Remove unneeded field.
kring Nov 27, 2018
8157ea5
Merge remote-tracking branch 'upstream/master' into fill-tiles
kring Nov 27, 2018
8e1d45c
Eliminate frameRendered and frameVisited from QuadtreeTile.
kring Nov 27, 2018
a756cb0
Remove unused and expensive tileLoadedEvent.
kring Nov 28, 2018
599e238
Merge remote-tracking branch 'origin/master' into fill-tiles
kring Dec 10, 2018
edc6059
Remove nonsensical tests, clean up some things.
kring Dec 11, 2018
b54e9f2
Tests and cleanup.
kring Dec 12, 2018
d0e63aa
Much better GlobeSurfaceTileSpecs, minor refactoring for testing.
kring Dec 15, 2018
ac2c792
Water mask testing.
kring Dec 16, 2018
024dd6f
Start moving getBoundingVolumeHierarchy specs to new system.
kring Dec 17, 2018
9e07b73
Update the rest of the BVH tests.
kring Dec 17, 2018
57cb725
Last of the GlobeSurfaceTile specs.
kring Dec 18, 2018
03da694
Remove unused requires.
kring Dec 18, 2018
a816f65
Break out processTiles.
kring Dec 18, 2018
686a9f5
selectTilesForRendering tests, etc.
kring Jan 3, 2019
4e3fc5f
Fix continue processing logic.
kring Jan 3, 2019
d6d65a8
Simplify test.
kring Jan 3, 2019
72514d2
New spec, fix failures, etc.
kring Jan 3, 2019
8cfda70
Fix test failure.
kring Jan 3, 2019
6456e37
Start adding specs for TerrainFillMesh.
kring Jan 4, 2019
0a0426c
More TerrainFillMesh tests.
kring Jan 4, 2019
b5ba318
Improve fill specs.
kring Jan 4, 2019
c0bf974
Work around missing slice function in IE11.
kring Jan 5, 2019
2506261
Merge remote-tracking branch 'upstream/master' into fill-tiles
kring Jan 6, 2019
f4c2f35
Add missing semicolon.
kring Jan 6, 2019
34d14d7
More fill specs.
kring Jan 7, 2019
eec8363
More specs, remove unused code, fix a bug.
kring Jan 8, 2019
09ca3c6
updateFillTiles specs.
kring Jan 8, 2019
7fa75da
More fill specs.
kring Jan 8, 2019
497024a
Tests.
kring Jan 8, 2019
85bd4b8
Write some tests, fix some bugs.
kring Jan 11, 2019
3bd110b
Fix some fill tile generation issues.
kring Jan 13, 2019
06ea854
Less blocky fills for low-detail tiles.
kring Jan 14, 2019
0290e3f
Better math for selecting a heightmap over a normal fill.
kring Jan 14, 2019
b58ccc9
Small optimization.
kring Jan 14, 2019
a3b98e8
Fix test failures.
kring Jan 14, 2019
2e1b026
Allow rendering of not-fully-loaded tiles.
kring Jan 15, 2019
193639a
Eliminate duplicate imagery loading code.
kring Jan 16, 2019
a40657b
Tweak math for using heightmap fills, again.
kring Jan 16, 2019
792610d
Don't let the globe vanish when adding a layer.
kring Jan 16, 2019
02a2209
Adjust root tile loading to reduce flickering when adding new layers.
kring Jan 17, 2019
f76ee90
Fix test failures.
kring Jan 17, 2019
4b9b62d
Better debug stats.
kring Jan 17, 2019
cffcbb0
Push parent tiles to be completely upsamplable.
kring Jan 17, 2019
64d17a2
Nice little memory optimization.
kring Jan 17, 2019
43490c8
Remove all the BVH code because it's providing no benefit.
kring Jan 22, 2019
9534f19
Fix some problems in Sandcastle examples.
kring Jan 23, 2019
ebb8760
Don't add undefined vertex arrays to free list.
kring Jan 23, 2019
4adf7d3
Fix Clamp to Terrain Sandcastle example.
kring Jan 24, 2019
a676e66
Fix test failure.
kring Jan 24, 2019
328a03a
Merge remote-tracking branch 'upstream/master' into fill-tiles
kring Jan 24, 2019
e250a39
Possibly dodgy fix for Clamp to Terrain example.
kring Jan 25, 2019
992d018
Less per-tile work.
kring Jan 25, 2019
1e60c7d
Remove unused requires.
kring Jan 25, 2019
72d4d39
Remove unused require.
kring Jan 27, 2019
c03dc05
Merge remote-tracking branch 'upstream/master' into fill-tiles
kring Jan 27, 2019
354423d
Fix a typo making Firefox explode.
kring Jan 29, 2019
17547a0
A few small cleanup things.
kring Jan 30, 2019
ee65aa4
Merge remote-tracking branch 'upstream/master' into fill-tiles
kring Jan 30, 2019
5b6d200
Move Terrain Performance Sandcastle to development folder.
kring Jan 30, 2019
c6d651a
Address TODOs.
kring Jan 30, 2019
ee7744d
Remove unnecessary renderable tile tracking.
kring Jan 31, 2019
a89fc60
Remove unnecessary height updating.
kring Jan 31, 2019
bbe9f82
Merge remote-tracking branch 'upstream/master' into fill-tiles
kring Jan 31, 2019
f56791f
Handle possibility that camera is right at tile OBB center.
kring Feb 1, 2019
712325c
Address TODOs.
kring Feb 1, 2019
21394f0
Remove terrainnotes.md.
kring Feb 1, 2019
99e76c7
Merge remote-tracking branch 'upstream/master' into fill-tiles
kring Feb 1, 2019
cf657be
Fix water mask in fill tiles.
kring Feb 2, 2019
380e849
Merge remote-tracking branch 'upstream/master' into fill-tiles
kring Feb 3, 2019
09760c9
Changes from Omar's review.
kring Feb 4, 2019
211e596
Put terrain tweakables on Globe, doc updates.
kring Feb 4, 2019
a88c200
TraversalDetails doc.
kring Feb 4, 2019
15e628e
Add missing @default and @type docs.
kring Feb 6, 2019
3a9b9ca
Don't use an array to track needed positions.
kring Feb 6, 2019
9ac2e0b
Remove height range clamping.
kring Feb 6, 2019
b774bd5
Possibly fix water mask destroyed crash.
kring Feb 7, 2019
2f907d4
Make Google terrain include edge indices.
kring Feb 8, 2019
2bc0095
Don't keep adding CULLED_BUT_NEEDED tiles to the load queue.
kring Feb 9, 2019
96b3f26
Merge remote-tracking branch 'origin/master' into fill-tiles
mramato Feb 12, 2019
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
189 changes: 189 additions & 0 deletions Apps/Sandcastle/gallery/development/Terrain Performance.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta name="description" content="Measure terrain loading and rendering performance.">
<meta name="cesium-sandcastle-labels" content="Development">
<title>Cesium Demo</title>
<script type="text/javascript" src="../Sandcastle-header.js"></script>
<script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.20/require.js"></script>
<script type="text/javascript">
if(typeof require === "function") {
require.config({
baseUrl : '../../../Source',
waitSeconds : 120
});
}
</script>
</head>
<body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html">
<style>
@import url(../templates/bucket.css);
</style>
<div id="cesiumContainer" class="fullSize"></div>
<div id="loadingOverlay"><h1>Loading...</h1></div>
<div id="toolbar"></div>
<script id="cesium_sandcastle_script">
function startup(Cesium) {
'use strict';
//Sandcastle_Begin
var viewer = new Cesium.Viewer('cesiumContainer');
var scene = viewer.scene;
var camera = scene.camera;
var globe = scene.globe;
var statistics = Cesium.RequestScheduler.statistics;

viewer.terrainProvider = Cesium.createWorldTerrain();

var startTime;
var flightComplete;
var monitor;
var minFrameRate = 1000;
var maxFrameRate = 0;
var sumFrameRate = 0.0;
var frameRateSamples = 0;

function startTest() {
flightComplete = false;
statistics.numberOfActiveRequestsEver = 0;
monitor = new Cesium.FrameRateMonitor({
scene: scene,
samplingWindow: 1.0,
quietPeriod: 0.0,
warmupPeriod: 0.0,
minimumFrameRateDuringWarmup: 0,
minimumFrameRateAfterWarmup: 0
});
scene.preUpdate.addEventListener(measureFrameRate);
startTime = window.performance.now();
window.setTimeout(function() {
scene.postRender.addEventListener(viewReady);
}, 500);
}

function measureFrameRate() {
var frameRate = monitor.lastFramesPerSecond;
if (frameRate === undefined || frameRate !== frameRate) {
return;
}

++frameRateSamples;
sumFrameRate += frameRate;
minFrameRate = Math.min(minFrameRate, frameRate);
maxFrameRate = Math.max(maxFrameRate, frameRate);
}

function viewReady(scene, time) {
var ready = globe._surface.tileProvider.ready && globe._surface._tileLoadQueueHigh.length === 0 && globe._surface._tileLoadQueueMedium.length === 0 && globe._surface._tileLoadQueueLow.length === 0 && globe._surface._debug.tilesWaitingForChildren === 0;
if (flightComplete && ready) {
var endTime = window.performance.now();
var duration = endTime - startTime;
alert((duration / 1000).toFixed(2) + ' seconds ' + statistics.numberOfActiveRequestsEver + ' requests, min/max/avg frame FPS ' + minFrameRate + '/' + maxFrameRate + '/' + (sumFrameRate / frameRateSamples));
scene.postRender.removeEventListener(viewReady);
}
}

function goToEverestHorizontal() {
camera.position = new Cesium.Cartesian3(302950.1757410969, 5637093.359233209, 2976894.491577989);
camera.direction = new Cesium.Cartesian3(-0.9648960658153797, -0.24110066659365145, -0.10414437451009724);
camera.right = new Cesium.Cartesian3(-0.02152846103178338, 0.46781654381873394, -0.8835633574877908);
camera.up = new Cesium.Cartesian3(-0.26174817580950865, 0.8503047394302772, 0.456584868959543);
flightComplete = true;
}

function goToEverestTopDown() {
camera.position = new Cesium.Cartesian3(301989.1870802739, 5637745.915399717, 2977153.0443453398);
camera.direction = new Cesium.Cartesian3(0.021398841015326783, -0.8909524564021135, -0.45359211857597476);
camera.right = new Cesium.Cartesian3(0.21237352569072232, 0.4473925820246778, -0.8687562161705573);
camera.up = new Cesium.Cartesian3(-0.9769542339275126, 0.07774058129659328, -0.19878839712310903);
flightComplete = true;
}

function goToEverest45Degrees() {
camera.position = new Cesium.Cartesian3(302760.41072832496, 5637092.977453635, 2977284.6758398763);
camera.direction = new Cesium.Cartesian3(-0.7254568510163212, -0.3330925403210976, -0.6022970337764594);
camera.right = new Cesium.Cartesian3(0.4750641658993092, 0.39087207931336604, -0.7883736778277414);
camera.up = new Cesium.Cartesian3(-0.49802248502640617, 0.8580608237157107, 0.12532049797395203);
flightComplete = true;
}

function zoomToEverest() {
var position = new Cesium.Cartesian3(302955.90876054496, 5639614.4908250235, 2981096.1048591887);
camera.flyTo({
destination : position,
easingFunction : Cesium.EasingFunction.QUADRATIC_OUT,
complete : function() {
flightComplete = true;
}
});
}

function panAroundEverest() {
camera.position = new Cesium.Cartesian3(302950.1757410969, 5637093.359233209, 2976894.491577989);
camera.direction = new Cesium.Cartesian3(-0.9648960658153797, -0.24110066659365145, -0.10414437451009724);
camera.right = new Cesium.Cartesian3(-0.02152846103178338, 0.46781654381873394, -0.8835633574877908);
camera.up = new Cesium.Cartesian3(-0.26174817580950865, 0.8503047394302772, 0.456584868959543);

var startCartographic = Cesium.Cartographic.fromCartesian(camera.position);
var longitude = startCartographic.longitude;
var endLongitude = longitude + 0.01;
var latitude = startCartographic.latitude;
var height = startCartographic.height;
var startTime = window.performance.now();
var removeCallback = scene.preRender.addEventListener(function(scene, time) {
var endTime = window.performance.now();
var delta = endTime - startTime;
startTime = endTime;
longitude += delta * 0.000001;
if (longitude >= endLongitude) {
flightComplete = true;
removeCallback();
}
camera.position = Cesium.Cartesian3.fromRadians(longitude, latitude, height);
});
}

Sandcastle.addToolbarButton('Timer Static Horizontal', function() {
startTest();
goToEverestHorizontal();
});

Sandcastle.addToolbarButton('Timer Static Top Down', function() {
startTest();
goToEverestTopDown();
});

Sandcastle.addToolbarButton('Timer Static 45 degrees', function() {
startTest();
goToEverest45Degrees();
});

Sandcastle.addToolbarButton('Timer Zoom', function() {
startTest();
zoomToEverest();
});

Sandcastle.addToolbarButton('Timer Pan', function() {
startTest();
panAroundEverest();
});

Sandcastle.addToolbarButton('Save camera', function() {
var cameraString = 'camera.position = new Cesium.Cartesian3(' + camera.positionWC.x + ', ' + camera.positionWC.y + ', ' + camera.positionWC.z + ');\n'+
'camera.direction = new Cesium.Cartesian3(' + camera.directionWC.x + ', ' + camera.directionWC.y + ', ' + camera.directionWC.z + ');\n'+
'camera.right = new Cesium.Cartesian3(' + camera.rightWC.x + ', ' + camera.rightWC.y + ', ' + camera.rightWC.z + ');\n'+
'camera.up = new Cesium.Cartesian3(' + camera.upWC.x + ', ' + camera.upWC.y + ', ' + camera.upWC.z + ');\n';
console.log(cameraString);
});//Sandcastle_End
Sandcastle.finishedLoading();
}
if (typeof Cesium !== "undefined") {
startup(Cesium);
} else if (typeof require === "function") {
require(["Cesium"], startup);
}
</script>
</body>
</html>
122 changes: 122 additions & 0 deletions Apps/Sandcastle/gallery/development/Terrain Tweaks.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta name="description" content="Tweak various terrain tweakables.">
<meta name="cesium-sandcastle-labels" content="Development">
<title>Cesium Demo</title>
<script type="text/javascript" src="../Sandcastle-header.js"></script>
<script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.20/require.js"></script>
<script type="text/javascript">
if(typeof require === 'function') {
require.config({
baseUrl : '../../../Source',
waitSeconds : 120
});
}
</script>
</head>
<body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html">
<style>
@import url(../templates/bucket.css);
#toolbar {
background: rgba(42, 42, 42, 0.8);
padding: 4px;
border-radius: 4px;
}
#toolbar input {
vertical-align: middle;
padding-top: 2px;
padding-bottom: 2px;
}
</style>
<div id="cesiumContainer" class="fullSize"></div>
<div id="loadingOverlay"><h1>Loading...</h1></div>
<div id="toolbar">
<table>
<tbody>
<tr>
<td>Loading Descendant Limit</td>
<td>
<input type="text" size="5" data-bind="value: loadingDescendantLimit" title="The number of loading descendant tiles that is considered 'too many'. If a tile has too many loading descendants, that tile will be loaded and rendered before any of its descendants are loaded and rendered. This means more feedback for the user that something is happening at the cost of a longer overall load time. Setting this to 0 will cause each tile level to be loaded successively, significantly increasing load time. Setting it to a large number (e.g. 100000) will minimize the number of tiles that are loaded but tend to make detail appear all at once after a long wait." />
</td>
</tr>
<tr>
<td>Preload Ancestors</td>
<td>
<input type="checkbox" data-bind="checked: preloadAncestors" title="Indicating whether the ancestors of rendered tiles should be preloaded. Setting this to true optimizes the zoom-out experience and provides more detail in newly-exposed areas when panning. The down side is that it requires loading more tiles." />
</td>
</tr>
<tr>
<td>Preload Siblings</td>
<td>
<input type="checkbox" data-bind="checked: preloadSiblings" title="Gets or sets a value indicating whether the siblings of rendered tiles should be preloaded. Setting this to true causes tiles with the same parent as a rendered tile to be loaded, even if they are culled. Setting this to true may provide a better panning experience at the cost of loading more tiles." />
</td>
</tr>
<tr>
<td>Fill Tile Highlight</td>
<td>
<input type="checkbox" data-bind="checked: fillHighlightEnabled" title="Highlights generated fill tiles." />
<input type="text" size="25" data-bind="value: fillHighlightColor" title="The color to use to highlight fill tiles. If undefined, fill tiles are not highlighted at all. The alpha value is used to alpha blend with the tile's actual color." />
</td>
</tr>
</tbody>
</table>
</div>
<script id="cesium_sandcastle_script">
function startup(Cesium) {
'use strict';
//Sandcastle_Begin
var viewer = new Cesium.Viewer('cesiumContainer');

var viewModel = {
loadingDescendantLimit: viewer.scene.globe.loadingDescendantLimit,
preloadAncestors: viewer.scene.globe.preloadAncestors,
preloadSiblings: viewer.scene.globe.preloadSiblings,
fillHighlightColor: Cesium.defined(viewer.scene.globe.fillHighlightColor) ? viewer.scene.globe.fillHighlightColor.toCssColorString() : 'rgba(255, 255, 0, 0.5)',
fillHighlightEnabled: Cesium.defined(viewer.scene.globe.fillHighlightColor)
};

Cesium.knockout.track(viewModel);

var toolbar = document.getElementById('toolbar');
Cesium.knockout.applyBindings(viewModel, toolbar);

Cesium.knockout.getObservable(viewModel, 'loadingDescendantLimit').subscribe(function(newValue) {
viewer.scene.globe.loadingDescendantLimit = parseInt(newValue, 10);
});
Cesium.knockout.getObservable(viewModel, 'preloadAncestors').subscribe(function(newValue) {
viewer.scene.globe.preloadAncestors = newValue;
});
Cesium.knockout.getObservable(viewModel, 'preloadSiblings').subscribe(function(newValue) {
viewer.scene.globe.preloadSiblings = newValue;
});

function updateFillHighlight() {
if (viewModel.fillHighlightEnabled) {
viewer.scene.globe.fillHighlightColor = Cesium.Color.fromCssColorString(viewModel.fillHighlightColor);
} else {
viewer.scene.globe.fillHighlightColor = undefined;
}
}

Cesium.knockout.getObservable(viewModel, 'fillHighlightEnabled').subscribe(function(newValue) {
updateFillHighlight();
});
Cesium.knockout.getObservable(viewModel, 'fillHighlightColor').subscribe(function(newValue) {
updateFillHighlight();
});

//Sandcastle_End
Sandcastle.finishedLoading();
}
if (typeof Cesium !== 'undefined') {
startup(Cesium);
} else if (typeof require === 'function') {
require(['Cesium'], startup);
}
</script>
</body>
</html>
7 changes: 5 additions & 2 deletions Source/Core/CesiumTerrainProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,10 @@ define([
* Gets an object that can be used to determine availability of terrain from this provider, such as
* at points and in rectangles. This function should not be called before
* {@link CesiumTerrainProvider#ready} returns true. This property may be undefined if availability
* information is not available.
* information is not available. Note that this reflects tiles that are known to be available currently.
* Additional tiles may be discovered to be available in the future, e.g. if availability information
* exists deeper in the tree rather than it all being discoverable at the root. However, a tile that
* is available now will not become unavailable in the future.
* @memberof CesiumTerrainProvider.prototype
* @type {TileAvailability}
*/
Expand Down Expand Up @@ -936,7 +939,7 @@ define([
* @param {Number} x The X coordinate of the tile for which to request geometry.
* @param {Number} y The Y coordinate of the tile for which to request geometry.
* @param {Number} level The level of the tile for which to request geometry.
* @returns {Boolean} Undefined if not supported, otherwise true or false.
* @returns {Boolean} Undefined if not supported or availability is unknown, otherwise true or false.
*/
CesiumTerrainProvider.prototype.getTileDataAvailable = function(x, y, level) {
if (!defined(this._availability)) {
Expand Down
6 changes: 5 additions & 1 deletion Source/Core/GoogleEarthEnterpriseTerrainData.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,11 @@ define([
result.numberOfAttributes,
result.orientedBoundingBox,
TerrainEncoding.clone(result.encoding),
exaggeration);
exaggeration,
result.westIndicesSouthToNorth,
result.southIndicesEastToWest,
result.eastIndicesNorthToSouth,
result.northIndicesWestToEast);

that._vertexCountWithoutSkirts = result.vertexCountWithoutSkirts;
that._skirtIndex = result.skirtIndex;
Expand Down
Loading