🔧 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
+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>