diff --git a/kwin/aura-glow/onSettingsChanged.js b/kwin/aura-glow/onSettingsChanged.js index a4b509c..d7ee1e3 100644 --- a/kwin/aura-glow/onSettingsChanged.js +++ b/kwin/aura-glow/onSettingsChanged.js @@ -5,10 +5,11 @@ // The code below is called whenever the user changes something in the configuration of // the effect. -effect.setUniform(this.shader, 'uColorSpeed', effect.readConfig('Speed', 1.0)); -effect.setUniform(this.shader, 'uRandomColorOffset', effect.readConfig('RandomColor', true) ? 1.0 : 0.0); -effect.setUniform(this.shader, 'uColorOffset', effect.readConfig('StartHue', 1.0)); -effect.setUniform(this.shader, 'uColorSaturation', effect.readConfig('Saturation', 1.0)); +effect.setUniform(this.shader, 'uSpeed', effect.readConfig('Speed', 1.0)); +effect.setUniform(this.shader, 'uRandomColor', + effect.readConfig('RandomColor', true) ? 1.0 : 0.0); +effect.setUniform(this.shader, 'uStartHue', effect.readConfig('StartHue', 1.0)); +effect.setUniform(this.shader, 'uSaturation', effect.readConfig('Saturation', 1.0)); effect.setUniform(this.shader, 'uBlur', effect.readConfig('BlurAmount', 1.0)); effect.setUniform(this.shader, 'uEdgeSize', effect.readConfig('EdgeSize', 1.0)); effect.setUniform(this.shader, 'uEdgeHardness', effect.readConfig('EdgeHardness', 1.0)); diff --git a/kwin/team-rocket/onSettingsChanged.js b/kwin/team-rocket/onSettingsChanged.js index b5334dc..70d84d5 100644 --- a/kwin/team-rocket/onSettingsChanged.js +++ b/kwin/team-rocket/onSettingsChanged.js @@ -5,9 +5,13 @@ // The code below is called whenever the user changes something in the configuration of // the effect. -effect.setUniform(this.shader, 'uWT', effect.readConfig('AnimationSplit', 1.0)); -effect.setUniform(this.shader, 'uWinRot', effect.readConfig('RotateWindow', true) ? 1.0 : 0.0); -effect.setUniform(this.shader, 'uXpos', effect.readConfig('HorizontalSparklePosition', 1.0)); -effect.setUniform(this.shader, 'uYpos', effect.readConfig('VerticalSparklePosition', 1.0)); +effect.setUniform(this.shader, 'uAnimationSplit', + effect.readConfig('AnimationSplit', 1.0)); +effect.setUniform(this.shader, 'uWindowRotation', + effect.readConfig('RotateWindow', true) ? 1.0 : 0.0); +effect.setUniform(this.shader, 'uHorizontalSparklePosition', + effect.readConfig('HorizontalSparklePosition', 1.0)); +effect.setUniform(this.shader, 'uVerticalSparklePosition', + effect.readConfig('VerticalSparklePosition', 1.0)); effect.setUniform(this.shader, 'uSparkleRot', effect.readConfig('SparkleRotation', 1.0)); effect.setUniform(this.shader, 'uSparkleSize', effect.readConfig('SparkleSize', 1.0)); diff --git a/resources/shaders/aura-glow.frag b/resources/shaders/aura-glow.frag index 6c9d4bb..6a8cd88 100644 --- a/resources/shaders/aura-glow.frag +++ b/resources/shaders/aura-glow.frag @@ -31,10 +31,10 @@ // vec4 getInputColor(vec2 coords) // void setOutputColor(vec4 outColor) -uniform float uColorSpeed; -uniform bool uRandomColorOffset; -uniform float uColorOffset; -uniform float uColorSaturation; +uniform float uSpeed; +uniform bool uRandomColor; +uniform float uStartHue; +uniform float uSaturation; uniform float uBlur; uniform vec2 uSeed; uniform float uEdgeSize; @@ -72,8 +72,8 @@ void main() { gradient += simplex2D((iTexCoord + uSeed)) * 0.5; // This mask is used for the color overlay. - float glowMask = (progress - gradient) / mix(uEdgeSize, 0.5, progress); - glowMask = 1.0 - clamp(glowMask - progress, 0.0, 1.0); + float glowMask = (progress - gradient) / (uEdgeSize + 0.1); + glowMask = 1.0 - clamp(glowMask, 0.0, 1.0); // Quickly fade out the glow mask at the end of the animation. glowMask *= easeOutSine(min(1.0, (1.0 - progress) * 4.0)); @@ -90,10 +90,10 @@ void main() { } glowMask *= windowColor.a; - vec3 glowColor = cos(progress * uColorSpeed + uv.xyx + vec3(0, 2, 4)).xyz; - float colorOffset = (uRandomColorOffset) ? hash12(uSeed) : uColorOffset; + vec3 glowColor = cos(progress * uSpeed + uv.xyx + vec3(0, 2, 4)).xyz; + float colorOffset = (uRandomColor) ? hash12(uSeed) : uStartHue; glowColor = offsetHue(glowColor, colorOffset + 0.1); - glowColor = clamp(glowColor * uColorSaturation, vec3(0.0), vec3(1.0)); + glowColor = clamp(glowColor * uSaturation, vec3(0.0), vec3(1.0)); windowColor.rgb += glowColor * glowMask; diff --git a/resources/shaders/team-rocket.frag b/resources/shaders/team-rocket.frag index 82bc4ff..eac93f4 100644 --- a/resources/shaders/team-rocket.frag +++ b/resources/shaders/team-rocket.frag @@ -31,13 +31,13 @@ // void setOutputColor(vec4 outColor) // window time ... how we split the time between the window and the sparkle/star -uniform float uWT; -uniform float uXpos; // the Xposition of the star -uniform float uYpos; // the Yposition of the star -uniform float uSparkleRot; // the rotation of the star -uniform float uSparkleSize; // the size of the star -uniform bool uWinRot; // window rotation... but it's more of a warp -uniform vec2 uSeed; // and random numbers +uniform float uAnimationSplit; +uniform float uHorizontalSparklePosition; // the Xposition of the star +uniform float uVerticalSparklePosition; // the Yposition of the star +uniform float uSparkleRot; // the rotation of the star +uniform float uSparkleSize; // the size of the star +uniform bool uWindowRotation; // window rotation... but it's more of a warp +uniform vec2 uSeed; // and random numbers // Used to scale the window. vec2 scaleUV(vec2 uv, vec2 scale, vec2 centerOffset) { @@ -106,16 +106,18 @@ void main() { float progress = uForOpening ? 1.0 - uProgress : uProgress; // Scale progress ... the first half of the animation. - float scalep = remap(progress, 0.0, uWT + 0.1, 0.0, 1.0); + float scalep = remap(progress, 0.0, uAnimationSplit + 0.1, 0.0, 1.0); scalep = easeOutQuad(scalep); // Sparkle progress ... the second half of the animation. - float sparkp = remap(progress, uWT - 0.1, 1.0, 0.0, 1.0); + float sparkp = remap(progress, uAnimationSplit - 0.1, 1.0, 0.0, 1.0); sparkp = easeInOutSine(sparkp); // This is the offset of the window... don't let them go too far each way. - vec2 offset = vec2(uXpos, uYpos * -1.0) * 0.20; - vec2 scaleOffset = mix(vec2(0.0), vec2(uXpos, uYpos * -1.0) * 0.50, scalep); + vec2 offset = vec2(uHorizontalSparklePosition, uVerticalSparklePosition * -1.0) * 0.20; + vec2 scaleOffset = + mix(vec2(0.0), + vec2(uHorizontalSparklePosition, uVerticalSparklePosition * -1.0) * 0.50, scalep); // the UV for this function float aspect = uSize.x / uSize.y; @@ -129,7 +131,7 @@ void main() { // Rotation and if we are gonna rotate or not. vec3 rot = vec3(0.0); - if (uWinRot) { + if (uWindowRotation) { rot = hash32(uSeed); rot *= 2.0; rot -= 1.0; diff --git a/resources/ui/adw/aura-glow.ui b/resources/ui/adw/aura-glow.ui index e96a5b2..aec39ab 100644 --- a/resources/ui/adw/aura-glow.ui +++ b/resources/ui/adw/aura-glow.ui @@ -66,17 +66,17 @@ SPDX-License-Identifier: GPL-3.0-or-later - Start Color Hue + Start Hue - + center 1 2 left 300 - + 1.0 0.0 0.1 @@ -86,7 +86,7 @@ SPDX-License-Identifier: GPL-3.0-or-later - + edit-clear-symbolic center Reset to Default Value @@ -100,7 +100,7 @@ SPDX-License-Identifier: GPL-3.0-or-later - Color Speed + Speed center @@ -109,7 +109,7 @@ SPDX-License-Identifier: GPL-3.0-or-later left 300 - + 5.0 -5.0 0.25 @@ -119,7 +119,7 @@ SPDX-License-Identifier: GPL-3.0-or-later - + edit-clear-symbolic center Reset to Default Value @@ -133,7 +133,7 @@ SPDX-License-Identifier: GPL-3.0-or-later - Color Saturation + Saturation center @@ -142,7 +142,7 @@ SPDX-License-Identifier: GPL-3.0-or-later left 300 - + 1.0 0.0 0.10 @@ -152,7 +152,7 @@ SPDX-License-Identifier: GPL-3.0-or-later - + edit-clear-symbolic center Reset to Default Value diff --git a/resources/ui/adw/team-rocket.ui b/resources/ui/adw/team-rocket.ui index 94e2641..e4144fc 100644 --- a/resources/ui/adw/team-rocket.ui +++ b/resources/ui/adw/team-rocket.ui @@ -63,7 +63,7 @@ SPDX-License-Identifier: GPL-3.0-or-later 300 - + 0.8 0.2 0.01 @@ -74,7 +74,7 @@ SPDX-License-Identifier: GPL-3.0-or-later - + edit-clear-symbolic center Reset to Default Value @@ -89,14 +89,14 @@ SPDX-License-Identifier: GPL-3.0-or-later Rotate Window - team-rocket-win-rot + team-rocket-window-rotation - + center - + edit-clear-symbolic center Reset to Default Value @@ -122,7 +122,7 @@ SPDX-License-Identifier: GPL-3.0-or-later 300 - + 1.0 -1.0 0.01 @@ -133,7 +133,7 @@ SPDX-License-Identifier: GPL-3.0-or-later - + edit-clear-symbolic center Reset to Default Value @@ -159,7 +159,7 @@ SPDX-License-Identifier: GPL-3.0-or-later 300 - + 1.0 -1.0 0.01 @@ -170,7 +170,7 @@ SPDX-License-Identifier: GPL-3.0-or-later - + edit-clear-symbolic center Reset to Default Value @@ -187,7 +187,6 @@ SPDX-License-Identifier: GPL-3.0-or-later Sparkle Size - @@ -225,7 +224,6 @@ SPDX-License-Identifier: GPL-3.0-or-later Sparkle Rotation - diff --git a/schemas/org.gnome.shell.extensions.burn-my-windows-profile.gschema.xml b/schemas/org.gnome.shell.extensions.burn-my-windows-profile.gschema.xml index 90dfe75..47cebb9 100644 --- a/schemas/org.gnome.shell.extensions.burn-my-windows-profile.gschema.xml +++ b/schemas/org.gnome.shell.extensions.burn-my-windows-profile.gschema.xml @@ -979,19 +979,19 @@ SPDX-License-Identifier: CC0-1.0 Ramdomize the color offset - + 0.0 Aura Glow Color Offset Changes the inital color of the glow - + 2.5 Aura Glow Color Speed The Speed at which the color changes - + 0.75 Aura Glow Color Saturation Amount of color in the effect @@ -1071,25 +1071,25 @@ SPDX-License-Identifier: CC0-1.0 The time the Team Rocket effect takes. - + 0.5 Window vs Sparkle split Window vs Sparkle split - + 0.0 Team Rocket X X position - + 0.5 Team Rocket Y Y position - + true Rotate the Window Rotate the Window diff --git a/src/effects/AuraGlow.js b/src/effects/AuraGlow.js index b3e772b..3ebf3b4 100644 --- a/src/effects/AuraGlow.js +++ b/src/effects/AuraGlow.js @@ -40,22 +40,22 @@ export default class Effect { constructor() { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => { // Store uniform locations of newly created shaders. - shader._uColorSpeed = shader.get_uniform_location('uColorSpeed'); - shader._uRandomColorOffset = shader.get_uniform_location('uRandomColorOffset'); - shader._uColorOffset = shader.get_uniform_location('uColorOffset'); - shader._uColorSaturation = shader.get_uniform_location('uColorSaturation'); - shader._uEdgeSize = shader.get_uniform_location('uEdgeSize'); - shader._uEdgeHardness = shader.get_uniform_location('uEdgeHardness'); - shader._uBlur = shader.get_uniform_location('uBlur'); - shader._uSeed = shader.get_uniform_location('uSeed'); + shader._uSpeed = shader.get_uniform_location('uSpeed'); + shader._uRandomColor = shader.get_uniform_location('uRandomColor'); + shader._uStartHue = shader.get_uniform_location('uStartHue'); + shader._uSaturation = shader.get_uniform_location('uSaturation'); + shader._uEdgeSize = shader.get_uniform_location('uEdgeSize'); + shader._uEdgeHardness = shader.get_uniform_location('uEdgeHardness'); + shader._uBlur = shader.get_uniform_location('uBlur'); + shader._uSeed = shader.get_uniform_location('uSeed'); // Write all uniform values at the start of each animation. shader.connect('begin-animation', (shader, settings) => { // clang-format off - shader.set_uniform_float(shader._uColorSpeed, 1, [settings.get_double('aura-glow-color-speed')]); - shader.set_uniform_float(shader._uRandomColorOffset, 1, [settings.get_boolean('aura-glow-random-color')]); - shader.set_uniform_float(shader._uColorOffset, 1, [settings.get_double('aura-glow-color-offset')]); - shader.set_uniform_float(shader._uColorSaturation, 1, [settings.get_double('aura-glow-color-saturation')]); + shader.set_uniform_float(shader._uSpeed, 1, [settings.get_double('aura-glow-speed')]); + shader.set_uniform_float(shader._uRandomColor, 1, [settings.get_boolean('aura-glow-random-color')]); + shader.set_uniform_float(shader._uStartHue, 1, [settings.get_double('aura-glow-start-hue')]); + shader.set_uniform_float(shader._uSaturation, 1, [settings.get_double('aura-glow-saturation')]); shader.set_uniform_float(shader._uEdgeSize, 1, [settings.get_double('aura-glow-edge-size')]); shader.set_uniform_float(shader._uEdgeHardness, 1, [settings.get_double('aura-glow-edge-hardness')]); shader.set_uniform_float(shader._uBlur, 1, [settings.get_double('aura-glow-blur')]); @@ -95,19 +95,17 @@ export default class Effect { // binds all user interface elements to the respective settings keys of the profile. static bindPreferences(dialog) { dialog.bindAdjustment('aura-glow-animation-time'); - dialog.bindAdjustment('aura-glow-color-speed'); + dialog.bindAdjustment('aura-glow-speed'); dialog.bindSwitch('aura-glow-random-color'); - dialog.bindAdjustment('aura-glow-color-offset'); - dialog.bindAdjustment('aura-glow-color-saturation'); + dialog.bindAdjustment('aura-glow-start-hue'); + dialog.bindAdjustment('aura-glow-saturation'); dialog.bindAdjustment('aura-glow-edge-size'); dialog.bindAdjustment('aura-glow-edge-hardness'); dialog.bindAdjustment('aura-glow-blur'); // enable and disable the one slider function enableDisablePref(dialog, state) { - dialog.getBuilder() - .get_object('aura-glow-color-offset-scale') - .set_sensitive(!state); + dialog.getBuilder().get_object('aura-glow-start-hue-slider').set_sensitive(!state); } const switchWidget = dialog.getBuilder().get_object('aura-glow-random-color'); diff --git a/src/effects/TeamRocket.js b/src/effects/TeamRocket.js index 632b8b3..c1d54d8 100644 --- a/src/effects/TeamRocket.js +++ b/src/effects/TeamRocket.js @@ -39,22 +39,24 @@ export default class Effect { constructor() { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => { // Store uniform locations of newly created shaders. - shader._uWT = shader.get_uniform_location('uWT'); - shader._uXpos = shader.get_uniform_location('uXpos'); - shader._uYpos = shader.get_uniform_location('uYpos'); - shader._uWinRot = shader.get_uniform_location('uWinRot'); - shader._uSparkleRot = shader.get_uniform_location('uSparkleRot'); - shader._uSparkleSize = shader.get_uniform_location('uSparkleSize'); + shader._uAnimationSplit = shader.get_uniform_location('uAnimationSplit'); + shader._uHorizontalSparklePosition = + shader.get_uniform_location('uHorizontalSparklePosition'); + shader._uVerticalSparklePosition = + shader.get_uniform_location('uVerticalSparklePosition'); + shader._uWindowRotation = shader.get_uniform_location('uWindowRotation'); + shader._uSparkleRot = shader.get_uniform_location('uSparkleRot'); + shader._uSparkleSize = shader.get_uniform_location('uSparkleSize'); shader._uSeed = shader.get_uniform_location('uSeed'); // Write all uniform values at the start of each animation. shader.connect('begin-animation', (shader, settings) => { // clang-format off - shader.set_uniform_float(shader._uWT, 1, [settings.get_double('team-rocket-window-time')]); - shader.set_uniform_float(shader._uXpos, 1, [settings.get_double('team-rocket-x')]); - shader.set_uniform_float(shader._uYpos, 1, [settings.get_double('team-rocket-y')]); - shader.set_uniform_float(shader._uWinRot, 1, [settings.get_boolean('team-rocket-win-rot')]); + shader.set_uniform_float(shader._uAnimationSplit, 1, [settings.get_double('team-rocket-animation-split')]); + shader.set_uniform_float(shader._uHorizontalSparklePosition, 1, [settings.get_double('team-rocket-horizontal-sparkle-position')]); + shader.set_uniform_float(shader._uVerticalSparklePosition, 1, [settings.get_double('team-rocket-vertical-sparkle-position')]); + shader.set_uniform_float(shader._uWindowRotation, 1, [settings.get_boolean('team-rocket-window-rotation')]); shader.set_uniform_float(shader._uSparkleRot, 1, [settings.get_double('team-rocket-sparkle-rot')]); shader.set_uniform_float(shader._uSparkleSize, 1, [settings.get_double('team-rocket-sparkle-size')]); // clang-format on @@ -93,12 +95,10 @@ export default class Effect { // binds all user interface elements to the respective settings keys of the profile. static bindPreferences(dialog) { dialog.bindAdjustment('team-rocket-animation-time'); - dialog.bindAdjustment('team-rocket-window-time'); - dialog.bindAdjustment('team-rocket-x'); - dialog.bindAdjustment('team-rocket-y'); - - dialog.bindSwitch('team-rocket-win-rot'); - + dialog.bindAdjustment('team-rocket-animation-split'); + dialog.bindAdjustment('team-rocket-horizontal-sparkle-position'); + dialog.bindAdjustment('team-rocket-vertical-sparkle-position'); + dialog.bindSwitch('team-rocket-window-rotation'); dialog.bindAdjustment('team-rocket-sparkle-rot'); dialog.bindAdjustment('team-rocket-sparkle-size'); }