main.tscn 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. [gd_scene load_steps=4 format=3 uid="uid://dm8doenormt4l"]
  2. [ext_resource type="Script" path="res://main.gd" id="1_r4h6n"]
  3. [sub_resource type="Gradient" id="Gradient_l3ffd"]
  4. colors = PackedColorArray(0, 0.686275, 0.658824, 1, 0.542081, 0.741499, 1, 1)
  5. [sub_resource type="GradientTexture2D" id="GradientTexture2D_uwj8q"]
  6. gradient = SubResource("Gradient_l3ffd")
  7. fill_to = Vector2(1, 1)
  8. [node name="Main" type="Control"]
  9. layout_mode = 3
  10. anchors_preset = 15
  11. anchor_right = 1.0
  12. anchor_bottom = 1.0
  13. grow_horizontal = 2
  14. grow_vertical = 2
  15. script = ExtResource("1_r4h6n")
  16. shader_file = "res://compute_shader.glsl"
  17. [node name="Background" type="TextureRect" parent="."]
  18. layout_mode = 1
  19. anchors_preset = 15
  20. anchor_right = 1.0
  21. anchor_bottom = 1.0
  22. grow_horizontal = 2
  23. grow_vertical = 2
  24. texture = SubResource("GradientTexture2D_uwj8q")
  25. [node name="CenterContainer" type="CenterContainer" parent="."]
  26. layout_mode = 1
  27. anchors_preset = 15
  28. anchor_right = 1.0
  29. anchor_bottom = 1.0
  30. grow_horizontal = 2
  31. grow_vertical = 2
  32. [node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"]
  33. layout_mode = 2
  34. theme_override_constants/separation = 10
  35. [node name="PanelContainer" type="PanelContainer" parent="CenterContainer/VBoxContainer"]
  36. custom_minimum_size = Vector2(250, 0)
  37. layout_mode = 2
  38. [node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer/VBoxContainer/PanelContainer"]
  39. layout_mode = 2
  40. theme_override_constants/separation = 8
  41. [node name="TitleLabel" type="Label" parent="CenterContainer/VBoxContainer/PanelContainer/VBoxContainer"]
  42. layout_mode = 2
  43. theme_override_font_sizes/font_size = 20
  44. text = "Create Island"
  45. horizontal_alignment = 1
  46. vertical_alignment = 2
  47. [node name="HSeparator" type="HSeparator" parent="CenterContainer/VBoxContainer/PanelContainer/VBoxContainer"]
  48. layout_mode = 2
  49. [node name="GridContainer" type="HBoxContainer" parent="CenterContainer/VBoxContainer/PanelContainer/VBoxContainer"]
  50. layout_mode = 2
  51. alignment = 1
  52. [node name="SeedLabel" type="Label" parent="CenterContainer/VBoxContainer/PanelContainer/VBoxContainer/GridContainer"]
  53. layout_mode = 2
  54. size_flags_vertical = 1
  55. text = "Seed"
  56. horizontal_alignment = 2
  57. vertical_alignment = 1
  58. [node name="SeedInput" type="SpinBox" parent="CenterContainer/VBoxContainer/PanelContainer/VBoxContainer/GridContainer"]
  59. custom_minimum_size = Vector2(140, 35)
  60. layout_mode = 2
  61. max_value = 1e+12
  62. [node name="RandomButton" type="Button" parent="CenterContainer/VBoxContainer/PanelContainer/VBoxContainer/GridContainer"]
  63. layout_mode = 2
  64. text = "Random"
  65. [node name="HBoxContainer" type="HBoxContainer" parent="CenterContainer/VBoxContainer/PanelContainer/VBoxContainer"]
  66. layout_mode = 2
  67. alignment = 1
  68. [node name="CreateButtonGPU" type="Button" parent="CenterContainer/VBoxContainer/PanelContainer/VBoxContainer/HBoxContainer"]
  69. custom_minimum_size = Vector2(0, 54)
  70. layout_mode = 2
  71. size_flags_horizontal = 3
  72. text = "Create (GPU)"
  73. [node name="CreateButtonCPU" type="Button" parent="CenterContainer/VBoxContainer/PanelContainer/VBoxContainer/HBoxContainer"]
  74. custom_minimum_size = Vector2(0, 54)
  75. layout_mode = 2
  76. size_flags_horizontal = 3
  77. text = "Create (CPU)"
  78. [node name="PanelContainer2" type="PanelContainer" parent="CenterContainer/VBoxContainer"]
  79. custom_minimum_size = Vector2(1034, 0)
  80. layout_mode = 2
  81. [node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer/VBoxContainer/PanelContainer2"]
  82. layout_mode = 2
  83. [node name="GridContainer" type="GridContainer" parent="CenterContainer/VBoxContainer/PanelContainer2/VBoxContainer"]
  84. layout_mode = 2
  85. theme_override_constants/v_separation = 10
  86. columns = 2
  87. [node name="Label" type="Label" parent="CenterContainer/VBoxContainer/PanelContainer2/VBoxContainer/GridContainer"]
  88. custom_minimum_size = Vector2(0, 30)
  89. layout_mode = 2
  90. text = "Raw Heightmap"
  91. horizontal_alignment = 1
  92. vertical_alignment = 2
  93. [node name="Label2" type="Label" parent="CenterContainer/VBoxContainer/PanelContainer2/VBoxContainer/GridContainer"]
  94. custom_minimum_size = Vector2(0, 30)
  95. layout_mode = 2
  96. text = "Computed Island"
  97. horizontal_alignment = 1
  98. vertical_alignment = 2
  99. [node name="RawHeightmap" type="TextureRect" parent="CenterContainer/VBoxContainer/PanelContainer2/VBoxContainer/GridContainer"]
  100. custom_minimum_size = Vector2(384, 384)
  101. layout_mode = 2
  102. size_flags_horizontal = 3
  103. expand_mode = 1
  104. stretch_mode = 5
  105. [node name="ComputedHeightmap" type="TextureRect" parent="CenterContainer/VBoxContainer/PanelContainer2/VBoxContainer/GridContainer"]
  106. custom_minimum_size = Vector2(384, 384)
  107. layout_mode = 2
  108. size_flags_horizontal = 3
  109. expand_mode = 1
  110. stretch_mode = 5
  111. [node name="HBoxContainer" type="HBoxContainer" parent="CenterContainer/VBoxContainer/PanelContainer2/VBoxContainer"]
  112. layout_mode = 2
  113. theme_override_constants/separation = 10
  114. [node name="Label" type="Label" parent="CenterContainer/VBoxContainer/PanelContainer2/VBoxContainer/HBoxContainer"]
  115. layout_mode = 2
  116. size_flags_horizontal = 3
  117. text = "Time elapsed: "
  118. horizontal_alignment = 2
  119. vertical_alignment = 1
  120. [node name="Label2" type="Label" parent="CenterContainer/VBoxContainer/PanelContainer2/VBoxContainer/HBoxContainer"]
  121. custom_minimum_size = Vector2(0, 40)
  122. layout_mode = 2
  123. size_flags_horizontal = 3
  124. theme_override_colors/font_color = Color(1, 0.941176, 0.47451, 1)
  125. theme_override_font_sizes/font_size = 24
  126. text = "... ms"
  127. [connection signal="pressed" from="CenterContainer/VBoxContainer/PanelContainer/VBoxContainer/GridContainer/RandomButton" to="." method="_on_random_button_pressed"]
  128. [connection signal="pressed" from="CenterContainer/VBoxContainer/PanelContainer/VBoxContainer/HBoxContainer/CreateButtonGPU" to="." method="_on_create_button_gpu_pressed"]
  129. [connection signal="pressed" from="CenterContainer/VBoxContainer/PanelContainer/VBoxContainer/HBoxContainer/CreateButtonCPU" to="." method="_on_create_button_cpu_pressed"]