contrails: add jagged edges and restore 5 minute lifetime

This commit is contained in:
Richard Zink committed 2026-10-12 19:52:23 +02:00
1 parent 1da34c913b
commit 50c96ceae4
2 files changed
+16 -4

No files matched your search

+1 -1
View File
@@ -206,7 +206,7 @@ window.CONFIG = {
// above contrailStartKm, visible for contrailLifeS seconds. // above contrailStartKm, visible for contrailLifeS seconds.
contrailChance: 1.00, contrailChance: 1.00,
contrailStartKm: 4, contrailStartKm: 4,
contrailLifeS: 600, contrailLifeS: 300,
contrailWidthM: 1400, // full trail width contrailWidthM: 1400, // full trail width
contrailFadeKm: 300, // fully faded at this distance (ramp starts at 35 %) contrailFadeKm: 300, // fully faded at this distance (ramp starts at 35 %)
// Night contrast: a physically scaled contrail is a faint grey thread // Night contrast: a physically scaled contrail is a faint grey thread
+15 -3
View File
@@ -5435,11 +5435,23 @@ var CT2_FRAG_SRC = [
'varying float vV;', 'varying float vV;',
'varying float vS;', 'varying float vS;',
'varying vec3 vWorld;', 'varying vec3 vWorld;',
'float hash1(float x) {',
'return fract(sin(x * 127.1) * 43758.5453);',
'}',
'float noise1(float x) {',
'float i = floor(x);',
'float f = fract(x);',
'return mix(hash1(i), hash1(i + 1.0), f);',
'}',
'void main() {', 'void main() {',
'float side = abs(vV);', 'float side = abs(vV);',
'float edge = 1.0 - smoothstep(0.25, 1.0, side);', 'float wob = 0.48 + 0.42 * noise1(vU * 24.0);',
'float head = 0.35 + 0.65 * vU;', 'float jag = noise1(vU * 61.0 + vV * 17.0) - 0.5;',
'float a = clamp(vS * edge * head, 0.0, 0.85);', 'float edge = 1.0 - smoothstep(wob * 0.16, wob, side + jag * 0.18);',
'edge *= 0.42 + 0.58 * pow(vU, 0.65);',
'float dens = 0.58 + 0.42 * noise1(vU * 31.0);',
'float head = 0.32 + 0.68 * vU;',
'float a = clamp(vS * edge * head * dens, 0.0, 0.88);',
'if (a <= 0.004) discard;', 'if (a <= 0.004) discard;',
'vec3 dayCol = vec3(1.0, 1.0, 1.0);', 'vec3 dayCol = vec3(1.0, 1.0, 1.0);',
'vec3 nightCol = vec3(0.45, 0.55, 0.75);', 'vec3 nightCol = vec3(0.45, 0.55, 0.75);',