🔧 Add wisps scale

This commit is contained in:
Simon Schneegans
2022-01-17 15:35:21 +01:00
parent 85629bb55e
commit 06e0d5340d
3 changed files with 54 additions and 0 deletions
+46
View File
@@ -64,6 +64,52 @@
</object> </object>
</child> </child>
<child>
<object class="GtkListBoxRow">
<property name="activatable">0</property>
<child>
<object class="GtkBox">
<child>
<object class="GtkLabel">
<property name="label" translatable="yes">Scale</property>
<property name="xalign">0</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkScale">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="draw-value">1</property>
<property name="digits">2</property>
<property name="value-pos">left</property>
<property name="width-request">300</property>
<property name="adjustment">
<object class="GtkAdjustment" id="wisps-scale">
<property name="upper">10</property>
<property name="lower">0.1</property>
<property name="step-increment">0.01</property>
<property name="page-increment">0.1</property>
</object>
</property>
</object>
</child>
<child>
<object class="GtkButton" id="reset-wisps-scale">
<property name="icon-name">edit-clear-symbolic</property>
<property name="tooltip-text">Reset to Default Value</property>
<style>
<class name="flat" />
</style>
</object>
</child>
</object>
</child>
</object>
</child>
<child> <child>
<object class="GtkListBoxRow"> <object class="GtkListBoxRow">
<property name="activatable">0</property> <property name="activatable">0</property>
@@ -239,6 +239,12 @@
<description>The time the wisps effect takes.</description> <description>The time the wisps effect takes.</description>
</key> </key>
<key name="wisps-scale" type="d">
<default>1.0</default>
<summary>Wisps Scale</summary>
<description>The size of the wisps.</description>
</key>
<key name="wisps-color" type="s"> <key name="wisps-color" type="s">
<default>"rgb(255, 100, 200)"</default> <default>"rgb(255, 100, 200)"</default>
<summary>Wisps Effect Color</summary> <summary>Wisps Effect Color</summary>
+2
View File
@@ -64,6 +64,7 @@ var Wisps = class Wisps {
// Bind all properties. // Bind all properties.
dialog.bindAdjustment('wisps-animation-time'); dialog.bindAdjustment('wisps-animation-time');
dialog.bindAdjustment('wisps-scale');
dialog.bindColorButton('wisps-color'); dialog.bindColorButton('wisps-color');
// Finally, append the settings page to the main stack. // Finally, append the settings page to the main stack.
@@ -182,6 +183,7 @@ if (utils.isInShellProcess()) {
// Compute several layers of moving wisps. // Compute several layers of moving wisps.
vec2 uv = (cogl_tex_coord_in[0].st-0.5) / mix(1.0, 0.5, uProgress) + 0.5; vec2 uv = (cogl_tex_coord_in[0].st-0.5) / mix(1.0, 0.5, uProgress) + 0.5;
uv /= ${settings.get_double('wisps-scale')};
float wisps = 0; float wisps = 0;
for (int i=0; i<WISPS_LAYERS; ++i) { for (int i=0; i<WISPS_LAYERS; ++i) {
wisps += getWisps(uv*0.3, WISPS_SPACING, SEED * (i+1)); wisps += getWisps(uv*0.3, WISPS_SPACING, SEED * (i+1));