[gd_scene load_steps=13 format=3 uid="uid://0q5qa7yiya83"]

[ext_resource type="Script" uid="uid://c6et88s5hp5c7" path="res://slime_simulation.gd" id="1_s6nlv"]
[ext_resource type="Shader" uid="uid://cwt4a55lblykn" path="res://shaders/point_update_shader.gdshader" id="2_pxe3a"]
[ext_resource type="Shader" uid="uid://bq044vr2240p4" path="res://shaders/point_draw_shader.gdshader" id="3_g2c28"]
[ext_resource type="Shader" uid="uid://bj3v35wyy32la" path="res://shaders/dissolve.gdshader" id="3_s6nlv"]

[sub_resource type="QuadMesh" id="QuadMesh_h0wwo"]
size = Vector2(1920, 1080)

[sub_resource type="ViewportTexture" id="ViewportTexture_g2c28"]
viewport_path = NodePath("TrailUpdateViewport/PointDrawViewport")

[sub_resource type="ShaderMaterial" id="ShaderMaterial_g2c28"]
shader = ExtResource("3_s6nlv")
shader_parameter/decay_factor = 0.99

[sub_resource type="QuadMesh" id="QuadMesh_s6nlv"]
size = Vector2(1920, 1080)

[sub_resource type="ShaderMaterial" id="ShaderMaterial_vkm4v"]
shader = ExtResource("3_g2c28")
shader_parameter/point_texture_size = Vector2i(0, 0)
shader_parameter/canvas_size = Vector2i(0, 0)

[sub_resource type="PointMesh" id="PointMesh_g2c28"]

[sub_resource type="MultiMesh" id="MultiMesh_vkm4v"]
mesh = SubResource("PointMesh_g2c28")

[sub_resource type="ShaderMaterial" id="ShaderMaterial_s6nlv"]
shader = ExtResource("2_pxe3a")
shader_parameter/point_texture_size = Vector2i(0, 0)
shader_parameter/canvas_size = Vector2i(0, 0)
shader_parameter/point_speed = 0.0

[node name="SlimeSimulation" type="Node2D"]
script = ExtResource("1_s6nlv")

[node name="View" type="MeshInstance2D" parent="."]
position = Vector2(960, 540)
mesh = SubResource("QuadMesh_h0wwo")
texture = SubResource("ViewportTexture_g2c28")

[node name="TrailUpdateViewport" type="SubViewport" parent="."]
unique_name_in_owner = true
disable_3d = true
transparent_bg = true
handle_input_locally = false
snap_2d_vertices_to_pixel = true
size = Vector2i(1920, 1080)
render_target_update_mode = 4

[node name="Pass" type="MeshInstance2D" parent="TrailUpdateViewport"]
material = SubResource("ShaderMaterial_g2c28")
position = Vector2(960, 540)
mesh = SubResource("QuadMesh_s6nlv")

[node name="PointDrawViewport" type="SubViewport" parent="TrailUpdateViewport"]
unique_name_in_owner = true
disable_3d = true
transparent_bg = true
handle_input_locally = false
size = Vector2i(1920, 1080)
render_target_update_mode = 4

[node name="PointMesh" type="MultiMeshInstance2D" parent="TrailUpdateViewport/PointDrawViewport"]
material = SubResource("ShaderMaterial_vkm4v")
multimesh = SubResource("MultiMesh_vkm4v")

[node name="PointUpdateViewport" type="SubViewport" parent="TrailUpdateViewport/PointDrawViewport"]
unique_name_in_owner = true
disable_3d = true
transparent_bg = true
handle_input_locally = false
size = Vector2i(1920, 1080)
render_target_update_mode = 4

[node name="PointMesh" type="MultiMeshInstance2D" parent="TrailUpdateViewport/PointDrawViewport/PointUpdateViewport"]
material = SubResource("ShaderMaterial_s6nlv")
multimesh = SubResource("MultiMesh_vkm4v")
