make SwipeArrow color changing part of the shader parameter

This commit is contained in:
msk
2023-10-09 23:22:48 -07:00
parent 43776de41b
commit 66bd12dffb
5 changed files with 45 additions and 30 deletions
+37 -12
View File
@@ -1,4 +1,4 @@
[gd_resource type="VisualShader" load_steps=27 format=3 uid="uid://dm5rgp78v61ha"]
[gd_resource type="VisualShader" load_steps=30 format=3 uid="uid://dm5rgp78v61ha"]
[ext_resource type="Texture2D" uid="uid://cmaq66vbi80ug" path="res://_Assets/Textures/Notes/SlideArrow_Texture.png" id="1_cj2ec"]
[ext_resource type="Texture2D" uid="uid://kjoqem41xatr" path="res://_Assets/Textures/Notes/SlideArrow_Mask.png" id="2_p52jd"]
@@ -98,6 +98,16 @@ parameter_name = "TileMult"
default_value_enabled = true
default_value = 6.0
[sub_resource type="VisualShaderNodeSwitch" id="VisualShaderNodeSwitch_2ma3x"]
default_input_values = [0, false, 1, Quaternion(1, 1, 1, 1), 2, Quaternion(0, 0, 0, 0)]
op_type = 5
[sub_resource type="VisualShaderNodeColorConstant" id="VisualShaderNodeColorConstant_e28fg"]
constant = Color(1, 0.584314, 0, 1)
[sub_resource type="VisualShaderNodeColorConstant" id="VisualShaderNodeColorConstant_uf0bo"]
constant = Color(0, 1, 0, 1)
[sub_resource type="VisualShaderNodeVectorOp" id="VisualShaderNodeVectorOp_13pou"]
default_input_values = [0, Quaternion(0, 0, 0, 0), 1, Quaternion(0, 0, 0, 0)]
op_type = 2
@@ -112,7 +122,6 @@ operator = 2
code = "shader_type canvas_item;
render_mode blend_mix;
uniform vec4 ArrowColor : source_color = vec4(0.000000, 1.000000, 0.000000, 1.000000);
uniform bool isCwShape = false;
uniform float TileMult = 6;
uniform float scrollMultiplier = 1;
@@ -122,17 +131,26 @@ uniform sampler2D mask : hint_default_transparent, filter_linear_mipmap;
void fragment() {
// ColorParameter:29
vec4 n_out29p0 = ArrowColor;
// BooleanParameter:35
bool n_out35p0 = isCwShape;
// ColorConstant:40
vec4 n_out40p0 = vec4(1.000000, 0.584314, 0.000000, 1.000000);
// ColorConstant:41
vec4 n_out41p0 = vec4(0.000000, 1.000000, 0.000000, 1.000000);
vec4 n_out39p0;
// Switch:39
n_out39p0 = mix(n_out41p0, n_out40p0, float(n_out35p0));
// VectorOp:13
vec4 n_in13p1 = vec4(2.00000, 2.00000, 2.00000, 2.00000);
vec4 n_out13p0 = n_out29p0 * n_in13p1;
// BooleanParameter:35
bool n_out35p0 = isCwShape;
vec4 n_out13p0 = n_out39p0 * n_in13p1;
// Input:20
@@ -191,7 +209,7 @@ void fragment() {
// VectorOp:10
vec4 n_out10p0 = n_out11p0 + n_out29p0;
vec4 n_out10p0 = n_out11p0 + n_out39p0;
vec4 n_out16p0;
@@ -230,6 +248,7 @@ void fragment() {
}
"
graph_offset = Vector2(-1381.11, -324.544)
mode = 1
flags/light_only = false
nodes/fragment/0/position = Vector2(1500, 460)
@@ -244,7 +263,7 @@ nodes/fragment/10/position = Vector2(560, -80)
nodes/fragment/11/node = SubResource("VisualShaderNodeVectorOp_3pdfb")
nodes/fragment/11/position = Vector2(280, -160)
nodes/fragment/13/node = SubResource("VisualShaderNodeVectorOp_eesut")
nodes/fragment/13/position = Vector2(60, -220)
nodes/fragment/13/position = Vector2(-20, -260)
nodes/fragment/14/node = SubResource("VisualShaderNodeTexture_2u62d")
nodes/fragment/14/position = Vector2(-60, 120)
nodes/fragment/15/node = SubResource("VisualShaderNodeFloatOp_nqoll")
@@ -281,4 +300,10 @@ nodes/fragment/37/node = SubResource("VisualShaderNodeSwitch_si863")
nodes/fragment/37/position = Vector2(-1020, -20)
nodes/fragment/38/node = SubResource("VisualShaderNodeFloatParameter_2lm10")
nodes/fragment/38/position = Vector2(-1380, 280)
nodes/fragment/connections = PackedInt32Array(7, 0, 8, 0, 11, 0, 10, 0, 10, 0, 7, 0, 13, 0, 11, 0, 15, 0, 7, 1, 16, 1, 17, 1, 16, 3, 15, 1, 16, 2, 3, 2, 8, 0, 0, 0, 22, 0, 14, 0, 3, 0, 8, 1, 17, 0, 0, 1, 14, 1, 11, 1, 14, 1, 15, 0, 14, 2, 3, 0, 26, 0, 14, 2, 27, 0, 24, 1, 28, 0, 27, 1, 29, 0, 13, 0, 29, 0, 10, 1, 14, 3, 17, 0, 30, 0, 16, 2, 23, 0, 27, 0, 32, 0, 22, 1, 24, 0, 22, 2, 20, 0, 36, 0, 35, 0, 37, 0, 37, 0, 22, 0, 37, 0, 16, 0, 38, 0, 32, 1, 36, 0, 37, 1, 20, 0, 37, 2)
nodes/fragment/39/node = SubResource("VisualShaderNodeSwitch_2ma3x")
nodes/fragment/39/position = Vector2(-420, -220)
nodes/fragment/40/node = SubResource("VisualShaderNodeColorConstant_e28fg")
nodes/fragment/40/position = Vector2(-740, -260)
nodes/fragment/41/node = SubResource("VisualShaderNodeColorConstant_uf0bo")
nodes/fragment/41/position = Vector2(-800, -120)
nodes/fragment/connections = PackedInt32Array(7, 0, 8, 0, 11, 0, 10, 0, 10, 0, 7, 0, 13, 0, 11, 0, 15, 0, 7, 1, 16, 1, 17, 1, 16, 3, 15, 1, 16, 2, 3, 2, 8, 0, 0, 0, 22, 0, 14, 0, 3, 0, 8, 1, 17, 0, 0, 1, 14, 1, 11, 1, 14, 1, 15, 0, 14, 2, 3, 0, 26, 0, 14, 2, 27, 0, 24, 1, 28, 0, 27, 1, 29, 0, 13, 0, 29, 0, 10, 1, 14, 3, 17, 0, 30, 0, 16, 2, 23, 0, 27, 0, 32, 0, 22, 1, 24, 0, 22, 2, 20, 0, 36, 0, 35, 0, 37, 0, 37, 0, 22, 0, 37, 0, 16, 0, 38, 0, 32, 1, 36, 0, 37, 1, 20, 0, 37, 2, 35, 0, 39, 0, 40, 0, 39, 1, 41, 0, 39, 2, 39, 0, 13, 0, 39, 0, 10, 1)