flights: render aircraft and contrails after clouds
This commit is contained in:
1 parent
4748adc0a1
commit
b7764ad03f
1 file changed
+46
-46
Vendored
+46
-46
@@ -6580,6 +6580,52 @@ window.clouds3dRender = function(target) {
|
|||||||
// trails themselves.
|
// trails themselves.
|
||||||
// Density is uniform over the whole day (flights follow neither the
|
// Density is uniform over the whole day (flights follow neither the
|
||||||
// car rush curve nor a night cut-off).
|
// car rush curve nor a night cut-off).
|
||||||
|
if (ATMO_MODEL_ON) {
|
||||||
|
gl.useProgram(s.prog);
|
||||||
|
gl.bindBuffer(gl.ARRAY_BUFFER, s.buf);
|
||||||
|
gl.enableVertexAttribArray(s.aPos);
|
||||||
|
gl.vertexAttribPointer(s.aPos, 2, gl.FLOAT, false, 0, 0);
|
||||||
|
gl.disable(gl.DEPTH_TEST);
|
||||||
|
gl.depthMask(false);
|
||||||
|
gl.enable(gl.BLEND);
|
||||||
|
gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
|
||||||
|
gl.uniform1i(s.uMode, 2);
|
||||||
|
gl.drawArrays(gl.TRIANGLES, 0, 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (FRONT_HAZE_ON && terrainDistOk && terrainDistTex) {
|
||||||
|
gl.useProgram(s.prog);
|
||||||
|
gl.bindBuffer(gl.ARRAY_BUFFER, s.buf);
|
||||||
|
gl.enableVertexAttribArray(s.aPos);
|
||||||
|
gl.vertexAttribPointer(s.aPos, 2, gl.FLOAT, false, 0, 0);
|
||||||
|
gl.activeTexture(gl.TEXTURE7);
|
||||||
|
gl.bindTexture(gl.TEXTURE_2D, terrainDistTex);
|
||||||
|
gl.uniform1i(s.uTerrainDistTex, 7);
|
||||||
|
gl.disable(gl.DEPTH_TEST);
|
||||||
|
gl.depthMask(false);
|
||||||
|
gl.enable(gl.BLEND);
|
||||||
|
gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
|
||||||
|
gl.uniform1i(s.uMode, 3);
|
||||||
|
gl.drawArrays(gl.TRIANGLES, 0, 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CLOUDS_ON) {
|
||||||
|
gl.useProgram(s.prog);
|
||||||
|
gl.bindBuffer(gl.ARRAY_BUFFER, s.buf);
|
||||||
|
gl.enableVertexAttribArray(s.aPos);
|
||||||
|
gl.vertexAttribPointer(s.aPos, 2, gl.FLOAT, false, 0, 0);
|
||||||
|
gl.activeTexture(gl.TEXTURE7);
|
||||||
|
gl.bindTexture(gl.TEXTURE_2D, terrainDistTex || null);
|
||||||
|
gl.uniform1i(s.uTerrainDistTex, 7);
|
||||||
|
gl.uniform1f(s.uTerrainDistOk, (terrainDistOk && terrainDistTex) ? 1.0 : 0.0);
|
||||||
|
gl.disable(gl.DEPTH_TEST);
|
||||||
|
gl.depthMask(false);
|
||||||
|
gl.enable(gl.BLEND);
|
||||||
|
gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
|
||||||
|
gl.uniform1i(s.uMode, 1);
|
||||||
|
gl.drawArrays(gl.TRIANGLES, 0, 3);
|
||||||
|
}
|
||||||
|
|
||||||
if (FLT_ON && fltCount && fltAirs) {
|
if (FLT_ON && fltCount && fltAirs) {
|
||||||
stepFlights(now);
|
stepFlights(now);
|
||||||
var fl = { x: 0, z: 0, alt: 0, s: 0, tx: 1, tz: 0, gnd: false, leg: null };
|
var fl = { x: 0, z: 0, alt: 0, s: 0, tx: 1, tz: 0, gnd: false, leg: null };
|
||||||
@@ -6893,52 +6939,6 @@ window.clouds3dRender = function(target) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ATMO_MODEL_ON) {
|
|
||||||
gl.useProgram(s.prog);
|
|
||||||
gl.bindBuffer(gl.ARRAY_BUFFER, s.buf);
|
|
||||||
gl.enableVertexAttribArray(s.aPos);
|
|
||||||
gl.vertexAttribPointer(s.aPos, 2, gl.FLOAT, false, 0, 0);
|
|
||||||
gl.disable(gl.DEPTH_TEST);
|
|
||||||
gl.depthMask(false);
|
|
||||||
gl.enable(gl.BLEND);
|
|
||||||
gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
|
|
||||||
gl.uniform1i(s.uMode, 2);
|
|
||||||
gl.drawArrays(gl.TRIANGLES, 0, 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (FRONT_HAZE_ON && terrainDistOk && terrainDistTex) {
|
|
||||||
gl.useProgram(s.prog);
|
|
||||||
gl.bindBuffer(gl.ARRAY_BUFFER, s.buf);
|
|
||||||
gl.enableVertexAttribArray(s.aPos);
|
|
||||||
gl.vertexAttribPointer(s.aPos, 2, gl.FLOAT, false, 0, 0);
|
|
||||||
gl.activeTexture(gl.TEXTURE7);
|
|
||||||
gl.bindTexture(gl.TEXTURE_2D, terrainDistTex);
|
|
||||||
gl.uniform1i(s.uTerrainDistTex, 7);
|
|
||||||
gl.disable(gl.DEPTH_TEST);
|
|
||||||
gl.depthMask(false);
|
|
||||||
gl.enable(gl.BLEND);
|
|
||||||
gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
|
|
||||||
gl.uniform1i(s.uMode, 3);
|
|
||||||
gl.drawArrays(gl.TRIANGLES, 0, 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CLOUDS_ON) {
|
|
||||||
gl.useProgram(s.prog);
|
|
||||||
gl.bindBuffer(gl.ARRAY_BUFFER, s.buf);
|
|
||||||
gl.enableVertexAttribArray(s.aPos);
|
|
||||||
gl.vertexAttribPointer(s.aPos, 2, gl.FLOAT, false, 0, 0);
|
|
||||||
gl.activeTexture(gl.TEXTURE7);
|
|
||||||
gl.bindTexture(gl.TEXTURE_2D, terrainDistTex || null);
|
|
||||||
gl.uniform1i(s.uTerrainDistTex, 7);
|
|
||||||
gl.uniform1f(s.uTerrainDistOk, (terrainDistOk && terrainDistTex) ? 1.0 : 0.0);
|
|
||||||
gl.disable(gl.DEPTH_TEST);
|
|
||||||
gl.depthMask(false);
|
|
||||||
gl.enable(gl.BLEND);
|
|
||||||
gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
|
|
||||||
gl.uniform1i(s.uMode, 1);
|
|
||||||
gl.drawArrays(gl.TRIANGLES, 0, 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Restore default state for the next frame.
|
// Restore default state for the next frame.
|
||||||
gl.disable(gl.BLEND);
|
gl.disable(gl.BLEND);
|
||||||
gl.enable(gl.DEPTH_TEST);
|
gl.enable(gl.DEPTH_TEST);
|
||||||
|
|||||||
Reference in new issue
Block a user