🎉 Add 3D noise option
This commit is contained in:
@@ -48,6 +48,7 @@ var PreferencesDialog = class PreferencesDialog {
|
||||
this._bindSwitch('destroy-dialogs');
|
||||
this._bindAdjustment('flame-movement-speed');
|
||||
this._bindAdjustment('flame-scale');
|
||||
this._bindSwitch('flame-3d-noise');
|
||||
this._bindColorButton('fire-color-1');
|
||||
this._bindColorButton('fire-color-2');
|
||||
this._bindColorButton('fire-color-3');
|
||||
|
||||
@@ -426,6 +426,70 @@
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="activatable">0</property>
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">3</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Use a 3D Noise</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="GtkLabel">
|
||||
<property name="label" translatable="yes">Makes the fire look more interesting at the cost of performance.</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">1</property>
|
||||
<style>
|
||||
<class name="dim-label" />
|
||||
<class name="caption" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="flame-3d-noise">
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="reset-flame-3d-noise">
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="icon-name">edit-clear-symbolic</property>
|
||||
<property name="icon-size">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<property name="tooltip-text">Reset to Default Value</property>
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="margin-start">10</property>
|
||||
|
||||
@@ -355,6 +355,59 @@
|
||||
</object>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">3</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Use a 3D Noise</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="GtkLabel">
|
||||
<property name="label" translatable="yes">Makes the fire look more interesting at the cost of performance.</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">1</property>
|
||||
<style>
|
||||
<class name="dim-label" />
|
||||
<class name="caption" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="flame-3d-noise">
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="reset-flame-3d-noise">
|
||||
<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>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
|
||||
@@ -41,6 +41,12 @@
|
||||
<description>The size of the flames.</description>
|
||||
</key>
|
||||
|
||||
<key name="flame-3d-noise" type="b">
|
||||
<default>false</default>
|
||||
<summary>Flame 3D Noise</summary>
|
||||
<description>Use a 3D noise for the flames.</description>
|
||||
</key>
|
||||
|
||||
<key name="fire-color-1" type="s">
|
||||
<default>"rgba(76, 51, 25, 0.0)"</default>
|
||||
<summary>Fire Color 1</summary>
|
||||
|
||||
@@ -124,8 +124,12 @@ var FireShader = GObject.registerClass({Properties: {}, Signals: {}},
|
||||
// Get a noise value which moves vertically in time.
|
||||
vec2 uv = cogl_tex_coord_in[0].st * vec2(uSizeX, uSizeY) / FIRE_SCALE;
|
||||
uv.y += uTime * FIRE_SPEED;
|
||||
|
||||
#if ${settings.get_boolean('flame-3d-noise') ? 1 : 0}
|
||||
float noise = noise3D(vec3(uv*7.5, uTime*FIRE_SPEED*3.0), 5);
|
||||
#else
|
||||
float noise = noise2D(uv * 7.5, 5);
|
||||
// float noise = noise3D(vec3(uv*7.5, uTime*FIRE_SPEED*4.0), 5);
|
||||
#endif
|
||||
|
||||
// Modulate noise by effect mask.
|
||||
vec2 effectMask = effectMask(HIDE_TIME, FADE_WIDTH, EDGE_FADE);
|
||||
|
||||
Reference in New Issue
Block a user