2019-12-27 22:30:49 +01:00
|
|
|
[gd_scene load_steps=8 format=2]
|
2019-12-08 08:50:14 +01:00
|
|
|
|
2020-01-25 15:20:08 +01:00
|
|
|
[ext_resource path="res://material_maker/preview/preview_2d.gd" type="Script" id=1]
|
|
|
|
[ext_resource path="res://material_maker/preview/control_point.tscn" type="PackedScene" id=2]
|
|
|
|
[ext_resource path="res://material_maker/icons/icons.svg" type="Texture" id=3]
|
|
|
|
|
|
|
|
|
2019-12-08 08:50:14 +01:00
|
|
|
|
|
|
|
[sub_resource type="Shader" id=1]
|
|
|
|
code = "shader_type canvas_item;
|
|
|
|
|
|
|
|
uniform sampler2D tex;
|
2019-12-10 08:00:55 +01:00
|
|
|
uniform vec2 size;
|
2019-12-08 08:50:14 +01:00
|
|
|
|
|
|
|
void fragment() {
|
2019-12-10 08:00:55 +01:00
|
|
|
float ms = max(size.x, size.y);
|
|
|
|
vec2 uv = fract(0.5+1.2*(UV-vec2(0.5))*ms/size.yx);
|
|
|
|
vec2 m2 = min(fract(uv), 1.0-fract(uv));
|
2020-01-06 08:18:42 +01:00
|
|
|
float color = 0.5*(cos(5.0*TIME+100.0*(UV.x+UV.y))+1.0);
|
|
|
|
COLOR = mix(texture(tex, uv), vec4(vec3(color), 1.0), step(min(m2.x, m2.y), 1.0/min(size.x, size.y)));
|
2019-12-08 08:50:14 +01:00
|
|
|
}"
|
|
|
|
|
|
|
|
[sub_resource type="ShaderMaterial" id=2]
|
|
|
|
shader = SubResource( 1 )
|
2019-12-27 22:30:49 +01:00
|
|
|
shader_param/size = Vector2( 721, 546 )
|
|
|
|
|
|
|
|
[sub_resource type="AtlasTexture" id=3]
|
|
|
|
flags = 4
|
|
|
|
atlas = ExtResource( 3 )
|
|
|
|
region = Rect2( 64, 48, 32, 32 )
|
|
|
|
|
|
|
|
[sub_resource type="AtlasTexture" id=4]
|
|
|
|
flags = 4
|
|
|
|
atlas = ExtResource( 3 )
|
2019-12-29 18:12:35 +01:00
|
|
|
region = Rect2( 16, 64, 16, 16 )
|
2019-12-08 08:50:14 +01:00
|
|
|
|
|
|
|
[node name="Preview2D" type="ColorRect"]
|
|
|
|
material = SubResource( 2 )
|
|
|
|
anchor_right = 1.0
|
|
|
|
anchor_bottom = 1.0
|
2019-12-27 22:30:49 +01:00
|
|
|
margin_right = -559.0
|
|
|
|
margin_bottom = -174.0
|
2019-12-08 08:50:14 +01:00
|
|
|
rect_min_size = Vector2( 64, 64 )
|
2019-12-27 22:30:49 +01:00
|
|
|
rect_clip_content = true
|
2019-12-08 08:50:14 +01:00
|
|
|
mouse_filter = 1
|
|
|
|
size_flags_horizontal = 0
|
|
|
|
size_flags_vertical = 8
|
|
|
|
script = ExtResource( 1 )
|
2019-12-27 22:30:49 +01:00
|
|
|
|
|
|
|
[node name="P1" parent="." instance=ExtResource( 2 )]
|
|
|
|
visible = false
|
|
|
|
self_modulate = Color( 1, 0.466667, 0, 1 )
|
|
|
|
texture = SubResource( 3 )
|
|
|
|
|
|
|
|
[node name="P2" parent="." instance=ExtResource( 2 )]
|
|
|
|
visible = false
|
|
|
|
self_modulate = Color( 0, 0.505882, 1, 1 )
|
|
|
|
texture = SubResource( 3 )
|
|
|
|
|
|
|
|
[node name="Rect1" parent="." instance=ExtResource( 2 )]
|
|
|
|
visible = false
|
|
|
|
self_modulate = Color( 1, 0.631373, 0, 1 )
|
|
|
|
margin_right = 16.0
|
|
|
|
margin_bottom = 16.0
|
|
|
|
texture = SubResource( 4 )
|
|
|
|
parent_control = "P1"
|
|
|
|
control_type = 1
|
|
|
|
|
|
|
|
[node name="Radius1" parent="." instance=ExtResource( 2 )]
|
|
|
|
visible = false
|
|
|
|
self_modulate = Color( 1, 0.631373, 0, 1 )
|
|
|
|
margin_right = 16.0
|
|
|
|
margin_bottom = 16.0
|
|
|
|
mouse_default_cursor_shape = 10
|
|
|
|
texture = SubResource( 4 )
|
|
|
|
parent_control = "P1"
|
|
|
|
control_type = 2
|
|
|
|
|
|
|
|
[node name="Radius11" parent="." instance=ExtResource( 2 )]
|
|
|
|
visible = false
|
|
|
|
self_modulate = Color( 1, 0.631373, 0, 1 )
|
|
|
|
margin_right = 16.0
|
|
|
|
margin_bottom = 16.0
|
|
|
|
mouse_default_cursor_shape = 10
|
|
|
|
texture = SubResource( 4 )
|
|
|
|
parent_control = "Radius1"
|
|
|
|
control_type = 2
|
|
|
|
|
|
|
|
[node name="Scale1" parent="." instance=ExtResource( 2 )]
|
|
|
|
visible = false
|
|
|
|
self_modulate = Color( 1, 0.631373, 0, 1 )
|
|
|
|
margin_right = 16.0
|
|
|
|
margin_bottom = 16.0
|
|
|
|
mouse_default_cursor_shape = 10
|
|
|
|
texture = SubResource( 4 )
|
|
|
|
parent_control = "P1"
|
|
|
|
control_type = 3
|
2019-12-29 18:12:35 +01:00
|
|
|
|
|
|
|
[node name="Angle1" parent="." instance=ExtResource( 2 )]
|
|
|
|
visible = false
|
|
|
|
self_modulate = Color( 1, 0.631373, 0, 1 )
|
|
|
|
margin_right = 16.0
|
|
|
|
margin_bottom = 16.0
|
|
|
|
mouse_default_cursor_shape = 10
|
|
|
|
texture = SubResource( 4 )
|
|
|
|
parent_control = "P1"
|
|
|
|
control_type = 2
|
|
|
|
|
|
|
|
[node name="Angle2" parent="." instance=ExtResource( 2 )]
|
|
|
|
visible = false
|
|
|
|
self_modulate = Color( 1, 0.631373, 0, 1 )
|
|
|
|
margin_right = 16.0
|
|
|
|
margin_bottom = 16.0
|
|
|
|
mouse_default_cursor_shape = 10
|
|
|
|
texture = SubResource( 4 )
|
|
|
|
parent_control = "P1"
|
|
|
|
control_type = 2
|
2019-12-10 08:00:55 +01:00
|
|
|
[connection signal="resized" from="." to="." method="on_resized"]
|