🎉 Add initial magic lamp code
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// ) ( //
|
||||
// ( /( ( ( ) ( ( ( ( )\ ) ( ( //
|
||||
// )\()) ))\ )( ( ( )\ ) )\))( )\ ( (()/( ( )\))( ( //
|
||||
// ((_)\ /((_|()\ )\ ) )\ '(()/( ((_)()((_) )\ ) ((_)))\((_)()\ )\ //
|
||||
// | |(_|_))( ((_)_(_/( _((_)) )(_)) _(()((_|_)_(_/( _| |((_)(()((_|(_) //
|
||||
// | '_ \ || | '_| ' \)) | ' \()| || | \ V V / | ' \)) _` / _ \ V V (_-< //
|
||||
// |_.__/\_,_|_| |_||_| |_|_|_| \_, | \_/\_/|_|_||_|\__,_\___/\_/\_//__/ //
|
||||
// |__/ //
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// SPDX-FileCopyrightText: Simon Schneegans <code@simonschneegans.de>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// The content from common.glsl is automatically prepended to each shader effect.
|
||||
|
||||
uniform vec2 uActorScale;
|
||||
uniform vec2 uPointerPos;
|
||||
uniform vec2 uControlPointA;
|
||||
uniform vec2 uControlPointB;
|
||||
|
||||
void main() {
|
||||
float progress = uForOpening ? 1.0 - uProgress : uProgress;
|
||||
|
||||
vec2 texcoord = iTexCoord.st;
|
||||
texcoord = texcoord * uActorScale + 0.5 - uActorScale * 0.5;
|
||||
|
||||
vec4 oColor = getInputColor(texcoord);
|
||||
oColor.rgb *= vec3(1.0, 0.5, 0.5);
|
||||
|
||||
if (length(texcoord - uPointerPos) < 0.02) {
|
||||
oColor = vec4(1.0);
|
||||
}
|
||||
|
||||
if (length(texcoord - uControlPointA) < 0.02) {
|
||||
oColor = vec4(1.0, 0.0, 0.0, 1.0);
|
||||
}
|
||||
|
||||
if (length(texcoord - uControlPointB) < 0.02) {
|
||||
oColor = vec4(0.0, 1.0, 0.0, 1.0);
|
||||
}
|
||||
|
||||
setOutputColor(oColor);
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!--
|
||||
SPDX-FileCopyrightText: Simon Schneegans <code@simonschneegans.de>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
|
||||
<interface domain="burn-my-windows">
|
||||
|
||||
<object class="AdwExpanderRow" id="magic-lamp-prefs">
|
||||
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">Animation Time [ms]</property>
|
||||
<child>
|
||||
<object class="GtkScale">
|
||||
<property name="valign">center</property>
|
||||
<property name="draw-value">1</property>
|
||||
<property name="digits">0</property>
|
||||
<property name="value-pos">left</property>
|
||||
<property name="width-request">300</property>
|
||||
<property name="adjustment">
|
||||
<object class="GtkAdjustment" id="magic-lamp-animation-time">
|
||||
<property name="upper">10000</property>
|
||||
<property name="lower">100</property>
|
||||
<property name="step-increment">1</property>
|
||||
<property name="page-increment">100</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="reset-magic-lamp-animation-time">
|
||||
<property name="icon-name">edit-clear-symbolic</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="tooltip-text" translatable="yes">Reset to Default Value</property>
|
||||
<style>
|
||||
<class name="flat" />
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
</object>
|
||||
|
||||
</interface>
|
||||
Reference in New Issue
Block a user