diff --git a/Apps/Sandcastle/gallery/development/Fog.html b/Apps/Sandcastle/gallery/development/Fog.html
index 7a3212111791..5250251761d4 100644
--- a/Apps/Sandcastle/gallery/development/Fog.html
+++ b/Apps/Sandcastle/gallery/development/Fog.html
@@ -28,22 +28,6 @@
enabled |
|
-
- red |
- |
-
-
- green |
- |
-
-
- blue |
- |
-
-
- type |
- |
-
density |
|
@@ -76,10 +60,6 @@
//The viewModel tracks the state of our mini application.
var viewModel = {
enabled : true,
- red : 0,
- green : 0,
- blue : 0,
- type : 0,
density : 0
};
// Convert the viewModel members into knockout observables.
@@ -95,30 +75,6 @@
}
);
-Cesium.knockout.getObservable(viewModel, 'red').subscribe(
- function(newValue) {
- viewer.scene.fogColor.red = newValue;
- }
-);
-
-Cesium.knockout.getObservable(viewModel, 'green').subscribe(
- function(newValue) {
- viewer.scene.fogColor.green = newValue;
- }
-);
-
-Cesium.knockout.getObservable(viewModel, 'blue').subscribe(
- function(newValue) {
- viewer.scene.fogColor.blue = newValue;
- }
-);
-
-Cesium.knockout.getObservable(viewModel, 'type').subscribe(
- function(newValue) {
- viewer.scene.fogType = newValue;
- }
-);
-
Cesium.knockout.getObservable(viewModel, 'density').subscribe(
function(newValue) {
viewer.scene.fogDensity = newValue;
@@ -126,10 +82,6 @@
);
viewModel.enabled = viewer.scene.fogEnabled;
-viewModel.red = viewer.scene.fogColor.red;
-viewModel.green = viewer.scene.fogColor.green;
-viewModel.blue = viewer.scene.fogColor.blue;
-viewModel.type = viewer.scene.fogType;
viewModel.density = viewer.scene.fogDensity;
/*
diff --git a/Source/Shaders/GlobeFS.glsl b/Source/Shaders/GlobeFS.glsl
index a8b612dc44d6..5657e506fda4 100644
--- a/Source/Shaders/GlobeFS.glsl
+++ b/Source/Shaders/GlobeFS.glsl
@@ -198,7 +198,7 @@ void main()
if (czm_fogEnabled) {
- vec3 fogColor = czm_fogColor;
+ vec3 fogColor = vec3(0.88, 0.92, 0.999);
//vec3 fogColor = getAtmosphereColor();
//vec3 fogColor = v_rayleighColor;
//vec3 fogColor = v_mieColor;
@@ -208,17 +208,11 @@ void main()
float fog = 0.0;
float maxDistance = 10000.0;
- if (czm_fogType == 1 && d > maxDistance) {
+ if (d > maxDistance) {
float scalar = (d - 2.0 * maxDistance) * czm_fogDensity;
fog = 1.0 - exp(-(scalar * scalar));
- } else if (czm_fogType == 2) {
- fog = 1.0 - exp(-d * czm_fogDensity);
- } else {
- float scalar = d * czm_fogDensity;
- fog = 1.0 - exp(-(scalar * scalar));
}
- fog = clamp(fog, 0.0, 1.0);
gl_FragColor = vec4(mix(finalColor.rgb, fogColor, fog), finalColor.a);
} else {
gl_FragColor = finalColor;