[gd_scene load_steps=5 format=3 uid="uid://c2omlx4ptrc01"]

[ext_resource type="Script" uid="uid://hbl5u20wlwr5" path="res://src/world/gunk_body/gunk_body.gd" id="1_qqbpr"]
[ext_resource type="Material" uid="uid://cqjr3cbxtfg2j" path="res://assets/materials/gunk.material" id="2_hrldx"]
[ext_resource type="Script" uid="uid://bom5qysgfvap1" path="res://src/world/gunk_body/draw_controller.gd" id="2_kkcjw"]
[ext_resource type="Script" uid="uid://ba7480ara8eo" path="res://levels/sandbox/debug_draw.gd" id="3_m8wx4"]

[node name="GunkBody" type="StaticBody3D"]
collision_layer = 5
collision_mask = 0
script = ExtResource("1_qqbpr")
source_gunk_material = ExtResource("2_hrldx")

[node name="MaskViewport" type="SubViewport" parent="."]
unique_name_in_owner = true
handle_input_locally = false
size = Vector2i(1024, 1024)
render_target_clear_mode = 1
render_target_update_mode = 4

[node name="MaskClear" type="ColorRect" parent="MaskViewport"]
unique_name_in_owner = true
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 1)

[node name="MaskTexture" type="TextureRect" parent="MaskViewport"]
unique_name_in_owner = true
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="MaskControl" type="Control" parent="MaskViewport"]
unique_name_in_owner = true
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("2_kkcjw")

[node name="DebugDraw" type="Control" parent="."]
visible = false
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
script = ExtResource("3_m8wx4")

[connection signal="visibility_changed" from="MaskViewport/MaskClear" to="MaskViewport/MaskControl" method="_set_dirty"]
[connection signal="visibility_changed" from="MaskViewport/MaskTexture" to="MaskViewport/MaskControl" method="_set_dirty"]
[connection signal="draw" from="MaskViewport/MaskControl" to="." method="_on_mask_painted"]
