🔧 Tweak portal parameters

This commit is contained in:
Simon Schneegans
2022-12-23 11:05:28 +01:00
parent 06a6570d43
commit f12f88b24d
9 changed files with 30 additions and 30 deletions
+2 -2
View File
@@ -56,7 +56,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
<string> milliseconds</string>
</property>
<property name="minimum">
<number>1000</number>
<number>500</number>
</property>
<property name="maximum">
<number>5000</number>
@@ -76,7 +76,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
<item row="2" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Whirl</string>
<string>Whirling</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+2 -2
View File
@@ -11,7 +11,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
<kcfgfile name="" />
<group name="">
<entry name="Duration" type="UInt">
<default>1500</default>
<default>1250</default>
</entry>
<entry name="Color" type="Color">
<default>#79E918</default>
@@ -22,7 +22,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
<entry name="RotationSpeed" type="Double">
<default>0.3</default>
</entry>
<entry name="Whirl" type="Double">
<entry name="Whirling" type="Double">
<default>1.0</default>
</entry>
</group>
+1 -1
View File
@@ -9,4 +9,4 @@ effect.setUniform(this.shader, 'uDuration', this.duration * 0.001);
effect.setUniform(this.shader, 'uColor', this.readRGBConfig('Color'));
effect.setUniform(this.shader, 'uDetails', effect.readConfig('Details', 1.0));
effect.setUniform(this.shader, 'uRotationSpeed', effect.readConfig('RotationSpeed', 1.0));
effect.setUniform(this.shader, 'uWhirl', effect.readConfig('Whirl', 1.0));
effect.setUniform(this.shader, 'uWhirling', effect.readConfig('Whirling', 1.0));
+6 -6
View File
@@ -17,7 +17,7 @@
uniform vec2 uSeed;
uniform vec3 uColor;
uniform float uRotationSpeed;
uniform float uWhirl;
uniform float uWhirling;
uniform float uDetails;
const float PORTAL_WOBBLE_TIME = 0.8;
@@ -29,9 +29,9 @@ const float WINDOW_TILT = -1.0;
// Make sure that the portal and window open / close animations are quick even if the
// duration is longer.
float PORTAL_OPEN_TIME = 0.45 / uDuration;
float PORTAL_CLOSE_TIME = 0.45 / uDuration;
float WINDOW_OPEN_TIME = 0.45 / uDuration;
float PORTAL_OPEN_TIME = 0.4 / uDuration;
float PORTAL_CLOSE_TIME = 0.4 / uDuration;
float WINDOW_OPEN_TIME = 0.35 / uDuration;
// This will distort the given coordinate to achieve the wobble effect of the portal when
// the window passes through. The wobble happens around the point where the window appears
@@ -74,7 +74,7 @@ vec2 getRandomDisplace(vec2 seed, float scale) {
// rotated more than coordinates farther away).
vec2 getWhirledCoords(vec2 coords, float speedMultiplier, float warpMultiplier) {
float rotation = uRotationSpeed * uProgress * uDuration * speedMultiplier;
float warping = uWhirl * (6.0 + 1.5 * uProgress) * warpMultiplier;
float warping = uWhirling * (6.0 + 1.5 * uProgress) * warpMultiplier;
return whirl(coords, warping, rotation);
}
@@ -95,7 +95,7 @@ vec4 getPortalColor() {
// Add the open-close animation of the portal.
float scale = getPortalScale();
coords /= max(scale, 0.01);
coords /= max(scale * 0.5 + 0.5, 0.01);
// We will use this distortion vector on all layers below in order to add the elastic
// wobbling when the window passes through the portal.
+4 -4
View File
@@ -22,7 +22,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
<property name="adjustment">
<object class="GtkAdjustment" id="portal-animation-time">
<property name="upper">5000</property>
<property name="lower">1000</property>
<property name="lower">500</property>
<property name="step-increment">1</property>
<property name="page-increment">100</property>
</object>
@@ -77,7 +77,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">Whirl</property>
<property name="title" translatable="yes">Whirling</property>
<child>
<object class="GtkScale">
<property name="valign">center</property>
@@ -86,7 +86,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">
<object class="GtkAdjustment" id="portal-whirl">
<object class="GtkAdjustment" id="portal-whirling">
<property name="upper">2</property>
<property name="lower">-2</property>
<property name="step-increment">0.1</property>
@@ -96,7 +96,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
</object>
</child>
<child>
<object class="GtkButton" id="reset-portal-whirl">
<object class="GtkButton" id="reset-portal-whirling">
<property name="icon-name">edit-clear-symbolic</property>
<property name="valign">center</property>
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
+5 -5
View File
@@ -9,7 +9,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
<object class="GtkAdjustment" id="portal-animation-time">
<property name="upper">5000</property>
<property name="lower">1000</property>
<property name="lower">500</property>
<property name="step-increment">1</property>
<property name="page-increment">100</property>
</object>
@@ -21,7 +21,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
<property name="page-increment">1</property>
</object>
<object class="GtkAdjustment" id="portal-whirl">
<object class="GtkAdjustment" id="portal-whirling">
<property name="upper">2</property>
<property name="lower">-2</property>
<property name="step-increment">0.1</property>
@@ -159,7 +159,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
<property name="spacing">8</property>
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Whirl</property>
<property name="label" translatable="yes">Whirling</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
@@ -174,12 +174,12 @@ SPDX-License-Identifier: GPL-3.0-or-later
<property name="digits">2</property>
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">portal-whirl</property>
<property name="adjustment">portal-whirling</property>
</object>
</child>
<child>
<object class="GtkButton"
id="reset-portal-whirl">
id="reset-portal-whirling">
<child>
<object class="GtkImage">
<property name="icon-name">edit-clear-symbolic</property>
+4 -4
View File
@@ -45,7 +45,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
<property name="adjustment">
<object class="GtkAdjustment" id="portal-animation-time">
<property name="upper">5000</property>
<property name="lower">1000</property>
<property name="lower">500</property>
<property name="step-increment">1</property>
<property name="page-increment">100</property>
</object>
@@ -73,7 +73,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
<object class="GtkBox">
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Whirl</property>
<property name="label" translatable="yes">Whirling</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
@@ -89,7 +89,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">
<object class="GtkAdjustment" id="portal-whirl">
<object class="GtkAdjustment" id="portal-whirling">
<property name="upper">2</property>
<property name="lower">-2</property>
<property name="step-increment">0.1</property>
@@ -99,7 +99,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
</object>
</child>
<child>
<object class="GtkButton" id="reset-portal-whirl">
<object class="GtkButton" id="reset-portal-whirling">
<property name="icon-name">edit-clear-symbolic</property>
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
<style>
@@ -732,7 +732,7 @@ SPDX-License-Identifier: CC0-1.0
</key>
<key name="portal-animation-time" type="i">
<default>1500</default>
<default>1250</default>
<summary>Portal Animation Time</summary>
<description>The time the Portal effect takes.</description>
</key>
@@ -749,9 +749,9 @@ SPDX-License-Identifier: CC0-1.0
<description>The angular speed of the portal.</description>
</key>
<key name="portal-whirl" type="d">
<key name="portal-whirling" type="d">
<default>1.0</default>
<summary>Portal Whirl</summary>
<summary>Portal Whirling</summary>
<description>The amount of distortion.</description>
</key>
+3 -3
View File
@@ -47,7 +47,7 @@ var Portal = class {
shader._uColor = shader.get_uniform_location('uColor');
shader._uDetails = shader.get_uniform_location('uDetails');
shader._uRotationSpeed = shader.get_uniform_location('uRotationSpeed');
shader._uWhirl = shader.get_uniform_location('uWhirl');
shader._uWhirling = shader.get_uniform_location('uWhirling');
// Write all uniform values at the start of each animation.
shader.connect('begin-animation', (shader, settings) => {
@@ -61,7 +61,7 @@ var Portal = class {
shader.set_uniform_float(shader._uColor, 3, [c.red / 255, c.green / 255, c.blue / 255]);
shader.set_uniform_float(shader._uDetails, 1, [settings.get_double('portal-details')]);
shader.set_uniform_float(shader._uRotationSpeed, 1, [settings.get_double('portal-rotation-speed')]);
shader.set_uniform_float(shader._uWhirl, 1, [settings.get_double('portal-whirl')]);
shader.set_uniform_float(shader._uWhirling, 1, [settings.get_double('portal-whirling')]);
// clang-format on
});
});
@@ -101,7 +101,7 @@ var Portal = class {
// Bind all properties.
dialog.bindAdjustment('portal-animation-time');
dialog.bindAdjustment('portal-rotation-speed');
dialog.bindAdjustment('portal-whirl');
dialog.bindAdjustment('portal-whirling');
dialog.bindAdjustment('portal-details');
dialog.bindColorButton('portal-color');