diff --git a/README.md b/README.md index aa57b2c..08b2e4b 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Below is a table which summarizes the current availability for all effects.
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+// This part is automatically included in the effect's source during the build process.
+// The code below is called whenever a window is closed or opened.
+
+let seed = [Math.random(), Math.random()];
+effect.setUniform(this.shader, 'uSeed', seed);
diff --git a/kwin/aura-glow/onSettingsChanged.js b/kwin/aura-glow/onSettingsChanged.js
new file mode 100644
index 0000000..d7ee1e3
--- /dev/null
+++ b/kwin/aura-glow/onSettingsChanged.js
@@ -0,0 +1,15 @@
+// SPDX-FileCopyrightText: Simon Schneegans
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+// This part is automatically included in the effect's source during the build process.
+// The code below is called whenever the user changes something in the configuration of
+// the effect.
+
+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/build.sh b/kwin/build.sh
index 8680a0a..2fb4648 100755
--- a/kwin/build.sh
+++ b/kwin/build.sh
@@ -154,6 +154,7 @@ generate_impl() {
}
# Now run the above method for all supported effects.
+generate "aura-glow" "Aura Glow [Burn-My-Windows]" "A radiant edge-lit animation"
generate "doom" "Doom [Burn-My-Windows]" "Melt your windows"
generate "energize-a" "Energize A [Burn-My-Windows]" "Beam your windows away"
generate "energize-b" "Energize B [Burn-My-Windows]" "Using different transporter technology results in an alternative visual effect"
@@ -167,6 +168,8 @@ generate "pixelate" "Pixelate [Burn-My-Windows]" "Pixelate the window and
generate "pixel-wheel" "Pixel Wheel [Burn-My-Windows]" "Pixelate the window and hide the pixels in a wheel-like fashion"
generate "pixel-wipe" "Pixel Wipe [Burn-My-Windows]" "Pixelate the window and hide the pixels radially, starting from the pointer position"
generate "portal" "Portal [Burn-My-Windows]" "Transfer your windows to other locations in space and time"
+generate "rgbwarp" "RGB Warp [Burn-My-Windows]" "Red Blue and Green go bye bye"
+generate "team-rocket" "Team Rocket [Burn-My-Windows]" "... is blasting off again!"
generate "tv" "TV Effect [Burn-My-Windows]" "Make windows close like turning off a TV"
generate "tv-glitch" "TV Glitch [Burn-My-Windows]" "Make your windows close like a very glitchy old-school TV"
generate "wisps" "Wisps [Burn-My-Windows]" "Let your windows be carried away to the realm of dreams by these little fairies"
diff --git a/kwin/rgbwarp/config.ui b/kwin/rgbwarp/config.ui
new file mode 100755
index 0000000..9f5ecda
--- /dev/null
+++ b/kwin/rgbwarp/config.ui
@@ -0,0 +1,148 @@
+
+
+
+
+
+ BMWConfigForm
+
+
+
+ 0
+ 0
+ 562
+ 365
+
+
+
+ -
+
+
+ Speed Red
+
+
+ Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter
+
+
+
+ -
+
+
+ 100
+
+
+ 9999
+
+
+ 100
+
+
+
+ -
+
+
+ Brightness
+
+
+ Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter
+
+
+
+ -
+
+
+ Animation Time [ms]
+
+
+ Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter
+
+
+
+ -
+
+
+ 0.000000000000000
+
+
+ 1.000000000000000
+
+
+ 0.100000000000000
+
+
+ 1.000000000000000
+
+
+
+ -
+
+
+ Speed Green
+
+
+ Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter
+
+
+
+ -
+
+
+ Speed Blue
+
+
+ Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter
+
+
+
+ -
+
+
+ 1.000000000000000
+
+
+ 0.100000000000000
+
+
+ 1.000000000000000
+
+
+
+ -
+
+
+ 0.000000000000000
+
+
+ 1.000000000000000
+
+
+ 0.100000000000000
+
+
+ 1.000000000000000
+
+
+
+ -
+
+
+ 0.000000000000000
+
+
+ 1.000000000000000
+
+
+ 0.100000000000000
+
+
+ 1.000000000000000
+
+
+
+
+
+
+
+
diff --git a/kwin/rgbwarp/main.xml b/kwin/rgbwarp/main.xml
new file mode 100755
index 0000000..fcaae22
--- /dev/null
+++ b/kwin/rgbwarp/main.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+ 750
+
+
+ 1.0
+
+
+ 1.0
+
+
+ 0.9
+
+
+ 0.8
+
+
+
\ No newline at end of file
diff --git a/kwin/rgbwarp/onSettingsChanged.js b/kwin/rgbwarp/onSettingsChanged.js
new file mode 100644
index 0000000..1395f06
--- /dev/null
+++ b/kwin/rgbwarp/onSettingsChanged.js
@@ -0,0 +1,11 @@
+// SPDX-FileCopyrightText: Simon Schneegans
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+// This part is automatically included in the effect's source during the build process.
+// The code below is called whenever the user changes something in the configuration of
+// the effect.
+
+effect.setUniform(this.shader, 'uBrightness', effect.readConfig('Brightness', 1.0));
+effect.setUniform(this.shader, 'uSpeedR', effect.readConfig('SpeedR', 1.0));
+effect.setUniform(this.shader, 'uSpeedG', effect.readConfig('SpeedG', 1.0));
+effect.setUniform(this.shader, 'uSpeedB', effect.readConfig('SpeedB', 1.0));
diff --git a/kwin/team-rocket/config.ui b/kwin/team-rocket/config.ui
new file mode 100755
index 0000000..5751e37
--- /dev/null
+++ b/kwin/team-rocket/config.ui
@@ -0,0 +1,185 @@
+
+
+
+
+
+
+ BMWConfigForm
+
+
+
+ 0
+ 0
+ 562
+ 365
+
+
+
+ -
+
+
+ Animation Time [ms]
+
+
+ Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter
+
+
+
+ -
+
+
+ 100
+
+
+ 9999
+
+
+ 100
+
+
+
+ -
+
+
+ Animation Split
+
+
+ Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter
+
+
+
+ -
+
+
+ 0.200000000000000
+
+
+ 8.000000000000000
+
+
+ 0.100000000000000
+
+
+ 0.500000000000000
+
+
+
+ -
+
+
+ Rotate Window
+
+
+
+ -
+
+
+ Horizontal Sparkle Position
+
+
+ Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter
+
+
+
+ -
+
+
+ -1.000000000000000
+
+
+ 1.000000000000000
+
+
+ 0.100000000000000
+
+
+ 1.000000000000000
+
+
+
+ -
+
+
+ Vertical Sparkle Position
+
+
+ Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter
+
+
+
+ -
+
+
+ -1.000000000000000
+
+
+ 1.000000000000000
+
+
+ 0.100000000000000
+
+
+ 1.000000000000000
+
+
+
+ -
+
+
+ Sparkle Size
+
+
+ Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter
+
+
+
+ -
+
+
+ 0.500000000000000
+
+
+ 1.000000000000000
+
+
+ 0.100000000000000
+
+
+ 1.000000000000000
+
+
+
+ -
+
+
+ Sparkle Rotation
+
+
+ Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter
+
+
+
+ -
+
+
+ -1.000000000000000
+
+
+ 1.000000000000000
+
+
+ 0.100000000000000
+
+
+ 1.000000000000000
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/kwin/team-rocket/main.xml b/kwin/team-rocket/main.xml
new file mode 100755
index 0000000..3ac1fac
--- /dev/null
+++ b/kwin/team-rocket/main.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+ 1500
+
+
+ 0.5
+
+
+ true
+
+
+ 0.0
+
+
+ 0.5
+
+
+ 0.75
+
+
+ 0.33
+
+
+
\ No newline at end of file
diff --git a/kwin/team-rocket/onAnimationBegin.js b/kwin/team-rocket/onAnimationBegin.js
new file mode 100644
index 0000000..0c85b91
--- /dev/null
+++ b/kwin/team-rocket/onAnimationBegin.js
@@ -0,0 +1,8 @@
+// SPDX-FileCopyrightText: Simon Schneegans
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+// This part is automatically included in the effect's source during the build process.
+// The code below is called whenever a window is closed or opened.
+
+let seed = [Math.random(), Math.random()];
+effect.setUniform(this.shader, 'uSeed', seed);
diff --git a/kwin/team-rocket/onSettingsChanged.js b/kwin/team-rocket/onSettingsChanged.js
new file mode 100644
index 0000000..70d84d5
--- /dev/null
+++ b/kwin/team-rocket/onSettingsChanged.js
@@ -0,0 +1,17 @@
+// SPDX-FileCopyrightText: Simon Schneegans
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+// This part is automatically included in the effect's source during the build process.
+// The code below is called whenever the user changes something in the configuration of
+// the effect.
+
+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