2019-10-30 22:57:51 +01:00
|
|
|
[gd_scene load_steps=12 format=2]
|
2018-07-27 08:49:54 +02:00
|
|
|
|
2020-01-25 15:20:08 +01:00
|
|
|
[ext_resource path="res://material_maker/widgets/gradient_editor.gd" type="Script" id=1]
|
|
|
|
[ext_resource path="res://material_maker/icons/icons.svg" type="Texture" id=2]
|
|
|
|
|
2019-09-26 22:32:49 +02:00
|
|
|
[sub_resource type="Shader" id=1]
|
2018-11-03 17:43:32 +01:00
|
|
|
code = "shader_type canvas_item;
|
|
|
|
|
|
|
|
void fragment() {
|
2019-10-06 10:02:09 +02:00
|
|
|
COLOR = vec4(vec3(2.0*fract(0.5*(floor(0.12*FRAGCOORD.x)+floor(0.125*FRAGCOORD.y)))), 1.0);
|
2018-11-03 17:43:32 +01:00
|
|
|
}"
|
|
|
|
|
2019-09-26 22:32:49 +02:00
|
|
|
[sub_resource type="ShaderMaterial" id=2]
|
|
|
|
shader = SubResource( 1 )
|
2018-07-27 08:49:54 +02:00
|
|
|
|
2019-10-30 22:57:51 +01:00
|
|
|
[sub_resource type="Shader" id=3]
|
2018-07-27 08:49:54 +02:00
|
|
|
code = "shader_type canvas_item;
|
2018-11-03 17:43:32 +01:00
|
|
|
vec4 gradient(float x) {
|
2018-07-28 21:21:05 +02:00
|
|
|
if (x < 0.000000000) {
|
2018-11-03 17:43:32 +01:00
|
|
|
return vec4(0.000000000,0.000000000,0.000000000,0.000000000);
|
2019-10-30 22:57:51 +01:00
|
|
|
} else if (x < 1.000000000) {
|
|
|
|
return (mix(vec4(0.000000000,0.000000000,0.000000000,0.000000000), vec4(1.000000000,1.000000000,1.000000000,1.000000000), (x-0.000000000)/1.000000000));
|
2018-07-28 21:21:05 +02:00
|
|
|
}
|
2019-10-30 22:57:51 +01:00
|
|
|
return vec4(1.000000000,1.000000000,1.000000000,1.000000000);
|
2018-07-27 08:49:54 +02:00
|
|
|
}
|
2018-11-03 17:43:32 +01:00
|
|
|
void fragment() { COLOR = gradient(UV.x); }"
|
2018-07-27 08:49:54 +02:00
|
|
|
|
2019-10-30 22:57:51 +01:00
|
|
|
[sub_resource type="ShaderMaterial" id=4]
|
|
|
|
shader = SubResource( 3 )
|
2018-07-27 08:49:54 +02:00
|
|
|
|
2018-11-03 17:43:32 +01:00
|
|
|
[sub_resource type="Theme" id=5]
|
|
|
|
|
2019-10-30 22:57:51 +01:00
|
|
|
[sub_resource type="AtlasTexture" id=6]
|
|
|
|
flags = 4
|
|
|
|
atlas = ExtResource( 2 )
|
|
|
|
region = Rect2( 96, 0, 32, 16 )
|
|
|
|
|
|
|
|
[sub_resource type="AtlasTexture" id=7]
|
|
|
|
flags = 4
|
|
|
|
atlas = ExtResource( 2 )
|
|
|
|
region = Rect2( 64, 0, 32, 16 )
|
|
|
|
|
|
|
|
[sub_resource type="AtlasTexture" id=8]
|
|
|
|
flags = 4
|
|
|
|
atlas = ExtResource( 2 )
|
|
|
|
region = Rect2( 64, 16, 32, 16 )
|
|
|
|
|
|
|
|
[sub_resource type="AtlasTexture" id=9]
|
|
|
|
flags = 4
|
|
|
|
atlas = ExtResource( 2 )
|
|
|
|
region = Rect2( 96, 16, 32, 16 )
|
|
|
|
|
2018-11-03 17:43:32 +01:00
|
|
|
[node name="Control" type="Control"]
|
2018-09-09 12:09:05 +02:00
|
|
|
margin_right = 120.0
|
|
|
|
margin_bottom = 30.0
|
2019-10-13 10:14:43 +02:00
|
|
|
rect_min_size = Vector2( 120, 32 )
|
2018-07-27 08:49:54 +02:00
|
|
|
script = ExtResource( 1 )
|
2020-02-28 08:41:17 +01:00
|
|
|
__meta__ = {
|
|
|
|
"_edit_use_anchors_": false
|
|
|
|
}
|
2018-07-27 08:49:54 +02:00
|
|
|
|
2019-09-26 22:32:49 +02:00
|
|
|
[node name="Background" type="ColorRect" parent="."]
|
|
|
|
material = SubResource( 2 )
|
2019-10-06 10:02:09 +02:00
|
|
|
anchor_right = 1.0
|
2019-10-22 22:48:00 +02:00
|
|
|
margin_left = 4.0
|
|
|
|
margin_right = -4.0
|
|
|
|
margin_bottom = 15.0
|
|
|
|
rect_min_size = Vector2( 112, 17 )
|
2019-09-26 22:32:49 +02:00
|
|
|
mouse_filter = 2
|
2018-11-03 17:43:32 +01:00
|
|
|
|
2019-09-26 22:32:49 +02:00
|
|
|
[node name="Gradient" type="ColorRect" parent="."]
|
2019-10-30 22:57:51 +01:00
|
|
|
material = SubResource( 4 )
|
2019-10-06 10:02:09 +02:00
|
|
|
anchor_right = 1.0
|
2019-10-22 22:48:00 +02:00
|
|
|
margin_left = 4.0
|
|
|
|
margin_right = -4.0
|
|
|
|
margin_bottom = 15.0
|
|
|
|
rect_min_size = Vector2( 112, 17 )
|
2019-09-26 22:32:49 +02:00
|
|
|
mouse_filter = 2
|
2018-11-03 17:43:32 +01:00
|
|
|
theme = SubResource( 5 )
|
|
|
|
|
2020-03-14 19:56:57 +01:00
|
|
|
[node name="Popup" type="PopupPanel" parent="Gradient"]
|
|
|
|
visible = true
|
|
|
|
margin_right = 318.0
|
|
|
|
margin_bottom = 470.0
|
2018-07-27 08:49:54 +02:00
|
|
|
|
2019-09-26 22:32:49 +02:00
|
|
|
[node name="ColorPicker" type="ColorPicker" parent="Gradient/Popup"]
|
2018-07-27 08:49:54 +02:00
|
|
|
margin_left = 4.0
|
|
|
|
margin_top = 4.0
|
2020-03-14 19:56:57 +01:00
|
|
|
margin_right = 314.0
|
|
|
|
margin_bottom = 466.0
|
2019-10-30 22:57:51 +01:00
|
|
|
|
|
|
|
[node name="Interpolation" type="OptionButton" parent="."]
|
|
|
|
margin_left = 0.418457
|
|
|
|
margin_top = -2.90374
|
|
|
|
margin_right = 73.4185
|
|
|
|
margin_bottom = 19.0963
|
|
|
|
rect_scale = Vector2( 0.5, 0.5 )
|
|
|
|
icon = SubResource( 6 )
|
|
|
|
items = [ "", SubResource( 7 ), false, 0, null, "", SubResource( 6 ), false, 1, null, "", SubResource( 8 ), false, 2, null, "", SubResource( 9 ), false, 3, null ]
|
|
|
|
selected = 1
|
2018-07-27 08:49:54 +02:00
|
|
|
[connection signal="popup_hide" from="Gradient/Popup" to="." method="_on_Popup_popup_hide"]
|
2019-10-30 22:57:51 +01:00
|
|
|
[connection signal="item_selected" from="Interpolation" to="." method="_on_Interpolation_item_selected"]
|