diff --git a/js/config.js b/js/config.js index 18c5b60..9e0b8ac 100644 --- a/js/config.js +++ b/js/config.js @@ -62,7 +62,7 @@ const defaults = { bloomStrength: 0.7, // The intensity of the bloom bloomSize: 0.4, // The amount the bloom calculation is scaled highPassThreshold: 0.1, // The minimum brightness that is still blurred - cycleSpeed: 0.2, // The speed glyphs change + cycleSpeed: 0.4, // The speed glyphs change cycleFrameSkip: 1, // The global minimum number of frames between glyphs cycling cycleStyleName: "cycleFasterWhenDimmed", // The way glyphs cycle, either proportional to their brightness or randomly baseBrightness: -0.5, // The brightness of the glyphs, before any effects are applied diff --git a/shaders/glsl/rainPass.frag.glsl b/shaders/glsl/rainPass.frag.glsl index 4a11c46..695b61b 100644 --- a/shaders/glsl/rainPass.frag.glsl +++ b/shaders/glsl/rainPass.frag.glsl @@ -93,13 +93,12 @@ void main() { float alpha = clamp(sigDist/fwidth(sigDist) + 0.5, 0., 1.); if (showDebugView) { - brightness *= 2.; gl_FragColor = vec4( vec3( shine.b, vec2( - brightness, - clamp(0., 1., pow(brightness * 0.9, 6.0)) + 1.0 - (shine.g * 3.0), + 1.0 - (shine.g * 10.0) ) * (1.0 - shine.b) ) * alpha, 1. diff --git a/shaders/glsl/rainPass.shine.frag.glsl b/shaders/glsl/rainPass.shine.frag.glsl index d32521e..55e9d66 100644 --- a/shaders/glsl/rainPass.shine.frag.glsl +++ b/shaders/glsl/rainPass.shine.frag.glsl @@ -63,11 +63,7 @@ float getRainTime(float simTime, vec2 glyphPos) { } float getBrightness(float rainTime) { - float value = 1. - fract(rainTime); - if (loops) { - value = 1. - fract(rainTime); - } - return value * baseContrast + baseBrightness; + return (1. - fract(rainTime)) * baseContrast + baseBrightness; } // Additional effects @@ -151,7 +147,7 @@ vec4 computeResult(float simTime, bool isFirstFrame, vec2 glyphPos, vec2 screenP brightness = mix(previousBrightness, brightness, brightnessDecay); } - vec4 result = vec4(brightness, 0., cursor, effect); + vec4 result = vec4(brightness, fract(rainTime), cursor, effect); return result; } diff --git a/shaders/wgsl/rainPass.wgsl b/shaders/wgsl/rainPass.wgsl index b16f922..12c27a4 100644 --- a/shaders/wgsl/rainPass.wgsl +++ b/shaders/wgsl/rainPass.wgsl @@ -146,8 +146,7 @@ fn getRainTime(simTime : f32, glyphPos : vec2) -> f32 { } fn getBrightness(rainTime : f32) -> f32 { - var value = 1.0 - fract(rainTime); - return value * config.baseContrast + config.baseBrightness; + return (1.0 - fract(rainTime)) * config.baseContrast + config.baseBrightness; } fn getCycleSpeed(brightness : f32) -> f32 { @@ -244,7 +243,7 @@ fn computeShine (simTime : f32, isFirstFrame : bool, glyphPos : vec2, scree brightness = mix(previousBrightness, brightness, config.brightnessDecay); } - var result = vec4(brightness, 0.0, cursor, effect); + var result = vec4(brightness, fract(rainTime), cursor, effect); return result; } @@ -443,16 +442,15 @@ fn getSymbolUV(symbol : i32) -> vec2 { var output : FragOutput; if (bool(config.showDebugView)) { - brightness *= 2.0; output.color = vec4( vec3( cell.shine.b, vec2( - brightness, - clamp(0.0, 1.0, pow(brightness * 0.9, 6.0)) + 1.0 - (cell.shine.g * 3.0), + 1.0 - (cell.shine.g * 10.0) ) * (1.0 - cell.shine.b) ) * alpha, - 1.0 + 1. ); } else { output.color = vec4(input.channel * brightness * alpha, 1.0);