🔧 Only set duration if required

This commit is contained in:
Simon Schneegans
2022-06-10 14:13:29 +02:00
parent cc86b16817
commit b4455d5f48
4 changed files with 3 additions and 1 deletions
@@ -2,5 +2,6 @@
// The code below is called whenever the user changes something in the configuration of // The code below is called whenever the user changes something in the configuration of
// the effect. // the effect.
effect.setUniform(this.shader, 'uDuration', this.duration * 0.001);
effect.setUniform(this.shader, 'uColor', effect.readConfig('Color', 'white')); effect.setUniform(this.shader, 'uColor', effect.readConfig('Color', 'white'));
effect.setUniform(this.shader, 'uScale', effect.readConfig('Scale', 1.0)); effect.setUniform(this.shader, 'uScale', effect.readConfig('Scale', 1.0));
@@ -2,5 +2,6 @@
// The code below is called whenever the user changes something in the configuration of // The code below is called whenever the user changes something in the configuration of
// the effect. // the effect.
effect.setUniform(this.shader, 'uDuration', this.duration * 0.001);
effect.setUniform(this.shader, 'uColor', effect.readConfig('Color', 'white')); effect.setUniform(this.shader, 'uColor', effect.readConfig('Color', 'white'));
effect.setUniform(this.shader, 'uScale', effect.readConfig('Scale', 1.0)); effect.setUniform(this.shader, 'uScale', effect.readConfig('Scale', 1.0));
@@ -2,6 +2,7 @@
// The code below is called whenever the user changes something in the configuration of // The code below is called whenever the user changes something in the configuration of
// the effect. // the effect.
effect.setUniform(this.shader, 'uDuration', this.duration * 0.001);
effect.setUniform(this.shader, 'uAdditiveBlending', effect.setUniform(this.shader, 'uAdditiveBlending',
effect.readConfig('AdditiveBlending', true)); effect.readConfig('AdditiveBlending', true));
effect.setUniform(this.shader, 'uScale', effect.readConfig('Scale', 1.0)); effect.setUniform(this.shader, 'uScale', effect.readConfig('Scale', 1.0));
-1
View File
@@ -32,7 +32,6 @@ class %EFFECT_CLASS% {
loadConfig() { loadConfig() {
this.duration = animationTime(effect.readConfig('Duration', 1000)); this.duration = animationTime(effect.readConfig('Duration', 1000));
effect.setUniform(this.shader, 'uDuration', this.duration * 0.001);
%ON_SETTINGS_CHANGE% %ON_SETTINGS_CHANGE%
} }