config: allow clouds in front of terrain
This commit is contained in:
1 parent
0ddaa80643
commit
1e582c1f7f
2 files changed
+7
-1
No files matched your search
@@ -339,6 +339,11 @@ window.CONFIG = {
|
|||||||
// ready. This avoids clouds appearing over an unfinished ground model.
|
// ready. This avoids clouds appearing over an unfinished ground model.
|
||||||
waitForTerrain: true, // false = draw clouds immediately
|
waitForTerrain: true, // false = draw clouds immediately
|
||||||
// waitForTerrain: false
|
// waitForTerrain: false
|
||||||
|
// Terrain occlusion for clouds. false draws clouds in front of the
|
||||||
|
// terrain mesh even when terrain is closer; true clips cloud rays
|
||||||
|
// against the terrain distance buffer.
|
||||||
|
terrainOcclusion: false, // inverted occlusion: clouds stay in front
|
||||||
|
// terrainOcclusion: true
|
||||||
// Coverage per weather level, 0 = clear, 1 = overcast. Only the
|
// Coverage per weather level, 0 = clear, 1 = overcast. Only the
|
||||||
// levels listed here override the built-in defaults
|
// levels listed here override the built-in defaults
|
||||||
// (sunny 0.20, cloudy 0.70, stormy 0.80, night 0.45). Live weather
|
// (sunny 0.20, cloudy 0.70, stormy 0.80, night 0.45). Live weather
|
||||||
|
|||||||
Vendored
+2
-1
@@ -1506,6 +1506,7 @@ var CLOUD_NEAR_FADE_START = (typeof CLOUD_NEAR_FADE_CFG.start === 'number') ? Ma
|
|||||||
var CLOUD_NEAR_FADE_END = Math.max(CLOUD_NEAR_FADE_START + 0.1, (typeof CLOUD_NEAR_FADE_CFG.end === 'number') ? CLOUD_NEAR_FADE_CFG.end : 2.5);
|
var CLOUD_NEAR_FADE_END = Math.max(CLOUD_NEAR_FADE_START + 0.1, (typeof CLOUD_NEAR_FADE_CFG.end === 'number') ? CLOUD_NEAR_FADE_CFG.end : 2.5);
|
||||||
var CLOUDS_ON = !(window.CONFIG && window.CONFIG.clouds && window.CONFIG.clouds.enabled === false);
|
var CLOUDS_ON = !(window.CONFIG && window.CONFIG.clouds && window.CONFIG.clouds.enabled === false);
|
||||||
var CLOUDS_WAIT_FOR_TERRAIN = !(window.CONFIG && window.CONFIG.clouds && window.CONFIG.clouds.waitForTerrain === false);
|
var CLOUDS_WAIT_FOR_TERRAIN = !(window.CONFIG && window.CONFIG.clouds && window.CONFIG.clouds.waitForTerrain === false);
|
||||||
|
var CLOUD_TERRAIN_OCCLUSION = !(window.CONFIG && window.CONFIG.clouds && window.CONFIG.clouds.terrainOcclusion === false);
|
||||||
function cloudsActive() {
|
function cloudsActive() {
|
||||||
return CLOUDS_ON && (!CLOUDS_WAIT_FOR_TERRAIN || (elevTexture && terrainVbo));
|
return CLOUDS_ON && (!CLOUDS_WAIT_FOR_TERRAIN || (elevTexture && terrainVbo));
|
||||||
}
|
}
|
||||||
@@ -8030,7 +8031,7 @@ window.clouds3dRender = function(target) {
|
|||||||
gl.activeTexture(gl.TEXTURE7);
|
gl.activeTexture(gl.TEXTURE7);
|
||||||
gl.bindTexture(gl.TEXTURE_2D, terrainDistTex || null);
|
gl.bindTexture(gl.TEXTURE_2D, terrainDistTex || null);
|
||||||
gl.uniform1i(s.uTerrainDistTex, 7);
|
gl.uniform1i(s.uTerrainDistTex, 7);
|
||||||
gl.uniform1f(s.uTerrainDistOk, (terrainDistOk && terrainDistTex) ? 1.0 : 0.0);
|
gl.uniform1f(s.uTerrainDistOk, (terrainDistOk && terrainDistTex && CLOUD_TERRAIN_OCCLUSION) ? 1.0 : 0.0);
|
||||||
gl.disable(gl.DEPTH_TEST);
|
gl.disable(gl.DEPTH_TEST);
|
||||||
gl.depthMask(false);
|
gl.depthMask(false);
|
||||||
gl.enable(gl.BLEND);
|
gl.enable(gl.BLEND);
|
||||||
|
|||||||
Reference in new issue
Block a user