From cfadbe145c9804a47fb960bc0aa865b98c6c75f8 Mon Sep 17 00:00:00 2001 From: Rezmason Date: Sun, 5 Sep 2021 15:52:42 -0700 Subject: [PATCH] Bloom pass can now be disabled. --- js/bloomPass.js | 12 ++++++++++++ js/config.js | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/js/bloomPass.js b/js/bloomPass.js index 2698074..10b04ce 100644 --- a/js/bloomPass.js +++ b/js/bloomPass.js @@ -17,6 +17,18 @@ const levelStrengths = Array(pyramidHeight) .reverse(); export default (regl, config, inputs) => { + + const enabled = config.bloomSize > 0 && config.bloomStrength > 0; + + if (!enabled) { + return makePass( + { + primary: inputs.primary, + bloom: makePassFBO(regl) + } + ); + } + const uniforms = extractEntries(config, [ "bloomStrength", "highPassThreshold" diff --git a/js/config.js b/js/config.js index 72b1d53..fcf7f8e 100644 --- a/js/config.js +++ b/js/config.js @@ -19,7 +19,7 @@ const fonts = { const defaults = { animationSpeed: 1, bloomStrength: 1, - bloomSize: 0.6, + bloomSize: 1, highPassThreshold: 0.3, cycleSpeed: 1, cycleStyleName: "cycleFasterWhenDimmed", @@ -148,7 +148,7 @@ const paramMapping = { }, bloomSize: { key: "bloomSize", - parser: s => nullNaN(range(parseFloat(s), 0.01, 1)) + parser: s => nullNaN(range(parseFloat(s), 0, 1)) }, url: { key: "bgURL", parser: s => s }, colors: { key: "stripeColors", parser: s => s }