scene.tscn 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  1. [gd_scene load_steps=32 format=2]
  2. [ext_resource path="res://scripts/scene.gd" type="Script" id=1]
  3. [ext_resource path="res://shaders/2dGI.shader" type="Shader" id=2]
  4. [ext_resource path="res://shaders/2dGI_rtx.shader" type="Shader" id=3]
  5. [ext_resource path="res://scripts/iChannels.gd" type="Script" id=4]
  6. [ext_resource path="res://scripts/fb_self.gd" type="Script" id=5]
  7. [ext_resource path="res://shaders/bg.shader" type="Shader" id=6]
  8. [ext_resource path="res://textures/grid.png" type="Texture" id=7]
  9. [ext_resource path="res://scripts/menu.gd" type="Script" id=8]
  10. [sub_resource type="ShaderMaterial" id=1]
  11. shader = ExtResource( 2 )
  12. shader_param/iTime = 0.0
  13. shader_param/iFrame = 0
  14. shader_param/iFrame1 = null
  15. [sub_resource type="ImageTexture" id=2]
  16. size = Vector2( 1280, 720 )
  17. [sub_resource type="ShaderMaterial" id=3]
  18. shader = ExtResource( 3 )
  19. shader_param/iTime = 0.0
  20. shader_param/iFrame = 0
  21. [sub_resource type="ImageTexture" id=4]
  22. size = Vector2( 640, 360 )
  23. [sub_resource type="ViewportTexture" id=5]
  24. viewport_path = NodePath("Viewport2")
  25. [sub_resource type="ViewportTexture" id=6]
  26. viewport_path = NodePath("Viewport")
  27. [sub_resource type="ViewportTexture" id=7]
  28. viewport_path = NodePath("Viewport2")
  29. [sub_resource type="ShaderMaterial" id=8]
  30. resource_local_to_scene = true
  31. shader = ExtResource( 6 )
  32. shader_param/iTime = 0.0
  33. shader_param/iFrame = 0
  34. shader_param/l_res = Vector2( 1280, 720 )
  35. shader_param/render = false
  36. shader_param/render2 = null
  37. shader_param/render3 = false
  38. shader_param/iChannel0 = ExtResource( 7 )
  39. shader_param/iChannel2 = SubResource( 6 )
  40. shader_param/iChannel3 = SubResource( 7 )
  41. [sub_resource type="ImageTexture" id=9]
  42. size = Vector2( 1280, 720 )
  43. [sub_resource type="StyleBoxFlat" id=10]
  44. bg_color = Color( 0, 0, 0, 0.411765 )
  45. [sub_resource type="StyleBoxFlat" id=11]
  46. bg_color = Color( 0.0588235, 0.317647, 0.145098, 1 )
  47. [sub_resource type="StyleBoxFlat" id=12]
  48. bg_color = Color( 0.0666667, 0.32549, 0.0901961, 1 )
  49. [sub_resource type="StyleBoxFlat" id=13]
  50. bg_color = Color( 0.0352941, 0.215686, 0.0784314, 1 )
  51. [sub_resource type="StyleBoxFlat" id=14]
  52. bg_color = Color( 0.278431, 0.278431, 0.278431, 1 )
  53. [sub_resource type="StyleBoxFlat" id=15]
  54. bg_color = Color( 0.0784314, 0.211765, 0.0666667, 1 )
  55. [sub_resource type="StyleBoxFlat" id=16]
  56. bg_color = Color( 0.137255, 0.372549, 0.0588235, 1 )
  57. [sub_resource type="StyleBoxFlat" id=17]
  58. bg_color = Color( 0.776471, 0.12549, 0.12549, 1 )
  59. [sub_resource type="StyleBoxFlat" id=18]
  60. bg_color = Color( 0.0588235, 0.137255, 0.482353, 0.690196 )
  61. [sub_resource type="StyleBoxFlat" id=19]
  62. bg_color = Color( 0.6, 0.231373, 0.231373, 0.760784 )
  63. [sub_resource type="StyleBoxFlat" id=20]
  64. bg_color = Color( 0.223529, 0.521569, 0.211765, 1 )
  65. [sub_resource type="StyleBoxFlat" id=21]
  66. bg_color = Color( 0.141176, 0.14902, 0.207843, 0.603922 )
  67. [sub_resource type="StyleBoxFlat" id=22]
  68. bg_color = Color( 0.211765, 0.235294, 0.521569, 1 )
  69. [sub_resource type="StyleBoxFlat" id=23]
  70. bg_color = Color( 0.141176, 0.14902, 0.207843, 0.603922 )
  71. [node name="scene" type="Node2D"]
  72. script = ExtResource( 1 )
  73. [node name="Viewport" type="Viewport" parent="."]
  74. size = Vector2( 1280, 720 )
  75. disable_3d = true
  76. render_target_clear_mode = 1
  77. render_target_update_mode = 0
  78. [node name="Sprite" type="Sprite" parent="Viewport"]
  79. material = SubResource( 1 )
  80. texture = SubResource( 2 )
  81. centered = false
  82. [node name="Viewport2" type="Viewport" parent="."]
  83. size = Vector2( 640, 360 )
  84. disable_3d = true
  85. render_target_update_mode = 0
  86. [node name="Sprite" type="Sprite" parent="Viewport2"]
  87. material = SubResource( 3 )
  88. texture = SubResource( 4 )
  89. centered = false
  90. script = ExtResource( 4 )
  91. [node name="Viewport3" type="Viewport" parent="."]
  92. size = Vector2( 640, 360 )
  93. disable_3d = true
  94. render_target_update_mode = 0
  95. script = ExtResource( 5 )
  96. [node name="Sprite" type="Sprite" parent="Viewport3"]
  97. texture = SubResource( 5 )
  98. centered = false
  99. [node name="bg" type="Sprite" parent="."]
  100. material = SubResource( 8 )
  101. texture = SubResource( 9 )
  102. centered = false
  103. script = ExtResource( 4 )
  104. [node name="Control" type="Control" parent="."]
  105. margin_right = 40.0
  106. margin_bottom = 40.0
  107. [node name="menu" type="GridContainer" parent="Control"]
  108. margin_right = 1280.0
  109. margin_bottom = 720.0
  110. columns = 6
  111. script = ExtResource( 8 )
  112. [node name="Control" type="Control" parent="Control/menu"]
  113. margin_right = 210.0
  114. margin_bottom = 720.0
  115. size_flags_horizontal = 3
  116. size_flags_vertical = 3
  117. [node name="Control4" type="Control" parent="Control/menu"]
  118. margin_left = 214.0
  119. margin_right = 424.0
  120. margin_bottom = 720.0
  121. size_flags_horizontal = 3
  122. size_flags_vertical = 3
  123. [node name="Control2" type="Control" parent="Control/menu"]
  124. margin_left = 428.0
  125. margin_right = 638.0
  126. margin_bottom = 720.0
  127. size_flags_horizontal = 3
  128. size_flags_vertical = 3
  129. [node name="Control3" type="Control" parent="Control/menu"]
  130. margin_left = 642.0
  131. margin_right = 852.0
  132. margin_bottom = 720.0
  133. size_flags_horizontal = 3
  134. size_flags_vertical = 3
  135. [node name="Control5" type="Control" parent="Control/menu"]
  136. margin_left = 856.0
  137. margin_right = 1066.0
  138. margin_bottom = 720.0
  139. size_flags_horizontal = 3
  140. size_flags_vertical = 3
  141. [node name="vc" type="VBoxContainer" parent="Control/menu"]
  142. margin_left = 1070.0
  143. margin_right = 1280.0
  144. margin_bottom = 720.0
  145. size_flags_horizontal = 3
  146. size_flags_vertical = 3
  147. [node name="t" type="Label" parent="Control/menu/vc"]
  148. margin_right = 210.0
  149. margin_bottom = 14.0
  150. custom_styles/normal = SubResource( 10 )
  151. text = "Text"
  152. align = 1
  153. [node name="at" type="Button" parent="Control/menu/vc"]
  154. margin_top = 18.0
  155. margin_right = 210.0
  156. margin_bottom = 38.0
  157. text = "Add text"
  158. [node name="s" type="Label" parent="Control/menu/vc"]
  159. margin_top = 42.0
  160. margin_right = 210.0
  161. margin_bottom = 56.0
  162. custom_styles/normal = SubResource( 10 )
  163. text = "Shapes"
  164. align = 1
  165. [node name="al" type="Button" parent="Control/menu/vc"]
  166. margin_top = 60.0
  167. margin_right = 210.0
  168. margin_bottom = 80.0
  169. text = "Add line"
  170. [node name="al2" type="Button" parent="Control/menu/vc"]
  171. margin_top = 84.0
  172. margin_right = 210.0
  173. margin_bottom = 104.0
  174. text = "Add circle"
  175. [node name="al3" type="Button" parent="Control/menu/vc"]
  176. margin_top = 108.0
  177. margin_right = 210.0
  178. margin_bottom = 128.0
  179. text = "Add box"
  180. [node name="al4" type="Button" parent="Control/menu/vc"]
  181. margin_top = 132.0
  182. margin_right = 210.0
  183. margin_bottom = 152.0
  184. text = "Add triangle"
  185. [node name="se" type="Label" parent="Control/menu/vc"]
  186. margin_top = 156.0
  187. margin_right = 210.0
  188. margin_bottom = 170.0
  189. custom_styles/normal = SubResource( 10 )
  190. text = "Background image"
  191. align = 1
  192. [node name="sehb" type="HBoxContainer" parent="Control/menu/vc"]
  193. margin_top = 174.0
  194. margin_right = 210.0
  195. margin_bottom = 194.0
  196. [node name="bgib" type="Button" parent="Control/menu/vc/sehb"]
  197. margin_right = 103.0
  198. margin_bottom = 20.0
  199. size_flags_horizontal = 3
  200. text = "Select"
  201. [node name="bgib2" type="Button" parent="Control/menu/vc/sehb"]
  202. margin_left = 107.0
  203. margin_right = 210.0
  204. margin_bottom = 20.0
  205. size_flags_horizontal = 3
  206. text = "Clean"
  207. [node name="o" type="Label" parent="Control/menu/vc"]
  208. margin_top = 198.0
  209. margin_right = 210.0
  210. margin_bottom = 212.0
  211. custom_styles/normal = SubResource( 10 )
  212. text = "Out image resolution"
  213. align = 1
  214. [node name="opx" type="OptionButton" parent="Control/menu/vc"]
  215. margin_top = 216.0
  216. margin_right = 210.0
  217. margin_bottom = 236.0
  218. text = "1280x720"
  219. items = [ "1280x720", null, false, 0, null, "1920x1080", null, false, 1, null, "3840x2160", null, false, 2, null ]
  220. selected = 0
  221. [node name="hb" type="HBoxContainer" parent="Control/menu/vc"]
  222. margin_top = 240.0
  223. margin_right = 210.0
  224. margin_bottom = 240.0
  225. size_flags_horizontal = 3
  226. [node name="o2" type="Label" parent="Control/menu/vc/hb"]
  227. visible = false
  228. margin_right = 80.0
  229. margin_bottom = 14.0
  230. custom_styles/normal = SubResource( 10 )
  231. text = "width/height"
  232. align = 1
  233. [node name="x" type="LineEdit" parent="Control/menu/vc/hb"]
  234. visible = false
  235. margin_right = 58.0
  236. margin_bottom = 24.0
  237. text = "1280"
  238. max_length = 4
  239. editable = false
  240. [node name="y" type="LineEdit" parent="Control/menu/vc/hb"]
  241. visible = false
  242. margin_right = 58.0
  243. margin_bottom = 24.0
  244. text = "720"
  245. max_length = 4
  246. editable = false
  247. [node name="io" type="Label" parent="Control/menu/vc"]
  248. margin_top = 244.0
  249. margin_right = 210.0
  250. margin_bottom = 258.0
  251. custom_styles/normal = SubResource( 10 )
  252. text = "Real time render"
  253. align = 1
  254. [node name="rtx" type="CheckBox" parent="Control/menu/vc"]
  255. margin_top = 262.0
  256. margin_right = 210.0
  257. margin_bottom = 278.0
  258. custom_styles/hover = SubResource( 11 )
  259. custom_styles/pressed = SubResource( 12 )
  260. custom_styles/focus = SubResource( 13 )
  261. custom_styles/disabled = SubResource( 14 )
  262. custom_styles/hover_pressed = SubResource( 15 )
  263. custom_styles/normal = SubResource( 16 )
  264. text = "Real time render(low cost)"
  265. [node name="io2" type="Label" parent="Control/menu/vc"]
  266. margin_top = 282.0
  267. margin_right = 210.0
  268. margin_bottom = 296.0
  269. custom_styles/normal = SubResource( 10 )
  270. text = "----------------"
  271. align = 1
  272. [node name="re" type="Button" parent="Control/menu/vc"]
  273. margin_top = 300.0
  274. margin_right = 210.0
  275. margin_bottom = 314.0
  276. custom_styles/normal = SubResource( 17 )
  277. text = "Render"
  278. [node name="hp" type="Button" parent="Control/menu/vc"]
  279. margin_top = 318.0
  280. margin_right = 210.0
  281. margin_bottom = 338.0
  282. text = "Help"
  283. [node name="hs" type="Button" parent="Control/menu/vc"]
  284. margin_top = 342.0
  285. margin_right = 210.0
  286. margin_bottom = 356.0
  287. custom_styles/normal = SubResource( 18 )
  288. text = "Hide/show buttons"
  289. [node name="imgl" type="FileDialog" parent="Control"]
  290. margin_left = 286.981
  291. margin_top = 168.368
  292. margin_right = 983.981
  293. margin_bottom = 548.368
  294. popup_exclusive = true
  295. window_title = "Open a File"
  296. resizable = true
  297. mode = 0
  298. access = 2
  299. filters = PoolStringArray( "*.jpg", "*.png", "*.jpeg" )
  300. [node name="info" type="AcceptDialog" parent="Control"]
  301. margin_left = 231.579
  302. margin_top = 108.421
  303. margin_right = 1011.58
  304. margin_bottom = 463.421
  305. popup_exclusive = true
  306. window_title = "Info"
  307. dialog_text = "Example:
  308. check Real time render to see result in real time
  309. press Add text
  310. White Cross icon to move element (by mouse)
  311. Edit is text to render
  312. Checkbox is to render with glow (color*2)
  313. Second edit is Angle (deg)
  314. Drop menu is size
  315. Color is text color (can be >1)
  316. Red button to delete
  317. press Add box
  318. White Cross icon to move element (by mouse)
  319. Edit is box size (pixels)
  320. Checkbox is to render with glow (color*2)
  321. Second edit rotation angle(deg)
  322. Color is box color (can be >1)
  323. Red button to delete
  324. (other shapes are similar to this)
  325. then press Render, it create images at this *.exe location, folder \"out_img\". Old files will be overwritten.
  326. to have more options just edit source: https://github.com/danilw/godot-utils-and-other
  327. **render with Glow(checkbox) mean render 2 frames(2image) with glow, and without(normal color).
  328. ***backgound image simply added as +color
  329. ****to have different glow color-render one-by-one frames with color you want and save. (have glow color select is overkill for this)
  330. https://twitter.com/arugl"
  331. [node name="warn" type="ConfirmationDialog" parent="Control"]
  332. margin_left = 505.0
  333. margin_top = 300.0
  334. margin_right = 705.0
  335. margin_bottom = 370.0
  336. popup_exclusive = true
  337. dialog_text = "Warning! Render very slow!
  338. it MAY or WILL ruin your OS(GPU driver) or user session!
  339. Save everything outside to have not lost any data!
  340. Press Cancel to not render."
  341. [node name="pct" type="Control" parent="Control"]
  342. visible = false
  343. margin_right = 40.0
  344. margin_bottom = 40.0
  345. [node name="Label" type="Label" parent="Control/pct"]
  346. margin_left = 189.0
  347. margin_top = 397.0
  348. margin_right = 313.0
  349. margin_bottom = 411.0
  350. custom_styles/normal = SubResource( 19 )
  351. text = "Progress: Frame - 1"
  352. [node name="ProgressBar" type="ProgressBar" parent="Control/pct"]
  353. margin_left = 191.36
  354. margin_top = 337.504
  355. margin_right = 1089.36
  356. margin_bottom = 387.504
  357. custom_styles/fg = SubResource( 20 )
  358. custom_styles/bg = SubResource( 21 )
  359. [node name="ProgressBar2" type="ProgressBar" parent="Control/pct"]
  360. margin_left = 332.0
  361. margin_top = 392.0
  362. margin_right = 1090.0
  363. margin_bottom = 416.0
  364. custom_styles/fg = SubResource( 22 )
  365. custom_styles/bg = SubResource( 23 )
  366. [node name="maxe" type="AcceptDialog" parent="Control"]
  367. margin_left = 527.028
  368. margin_top = 304.015
  369. margin_right = 712.028
  370. margin_bottom = 362.015
  371. popup_exclusive = true
  372. dialog_text = "Max 5 elems of each type!
  373. (edit source(const max_elems) if you need more)"
  374. [node name="serr" type="AcceptDialog" parent="Control"]
  375. margin_left = 527.028
  376. margin_top = 304.015
  377. margin_right = 712.028
  378. margin_bottom = 362.015
  379. popup_exclusive = true
  380. dialog_text = "Error on save image file: "
  381. [node name="elems" type="Control" parent="."]
  382. margin_right = 40.0
  383. margin_bottom = 40.0
  384. [connection signal="pressed" from="Control/menu/vc/at" to="Control/menu" method="_on_at_pressed"]
  385. [connection signal="pressed" from="Control/menu/vc/al" to="Control/menu" method="_on_al_pressed"]
  386. [connection signal="pressed" from="Control/menu/vc/al2" to="Control/menu" method="_on_al2_pressed"]
  387. [connection signal="pressed" from="Control/menu/vc/al3" to="Control/menu" method="_on_al3_pressed"]
  388. [connection signal="pressed" from="Control/menu/vc/al4" to="Control/menu" method="_on_al4_pressed"]
  389. [connection signal="pressed" from="Control/menu/vc/sehb/bgib" to="Control/menu" method="_on_bgib_pressed"]
  390. [connection signal="pressed" from="Control/menu/vc/sehb/bgib2" to="Control/menu" method="_on_bgib2_pressed"]
  391. [connection signal="item_selected" from="Control/menu/vc/opx" to="Control/menu" method="_on_opx_item_selected"]
  392. [connection signal="text_changed" from="Control/menu/vc/hb/x" to="Control/menu" method="_on_x_text_changed"]
  393. [connection signal="text_changed" from="Control/menu/vc/hb/y" to="Control/menu" method="_on_y_text_changed"]
  394. [connection signal="toggled" from="Control/menu/vc/rtx" to="Control/menu" method="_on_rtx_toggled"]
  395. [connection signal="pressed" from="Control/menu/vc/re" to="Control/menu" method="_on_re_pressed"]
  396. [connection signal="pressed" from="Control/menu/vc/hp" to="Control/menu" method="_on_hp_pressed"]
  397. [connection signal="pressed" from="Control/menu/vc/hs" to="Control/menu" method="_on_hs_pressed"]