test.tscn 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. [gd_scene load_steps=8 format=3 uid="uid://c2wwh47i8o462"]
  2. [ext_resource type="PackedScene" uid="uid://doh0vqn8wpfky" path="res://living_room.glb" id="1_oncn7"]
  3. [ext_resource type="Script" path="res://options.gd" id="2_hjhvo"]
  4. [sub_resource type="PhysicalSkyMaterial" id="PhysicalSkyMaterial_6cd1w"]
  5. use_debanding = false
  6. [sub_resource type="Sky" id="Sky_i7d6m"]
  7. sky_material = SubResource("PhysicalSkyMaterial_6cd1w")
  8. [sub_resource type="Environment" id="Environment_3p42x"]
  9. background_mode = 2
  10. sky = SubResource("Sky_i7d6m")
  11. tonemap_mode = 3
  12. tonemap_white = 6.0
  13. sdfgi_use_occlusion = true
  14. sdfgi_cascades = 2
  15. sdfgi_min_cell_size = 0.15
  16. sdfgi_cascade0_distance = 9.6
  17. sdfgi_max_distance = 38.4
  18. sdfgi_y_scale = 0
  19. glow_enabled = true
  20. [sub_resource type="CameraAttributesPhysical" id="CameraAttributesPhysical_n2bnf"]
  21. auto_exposure_enabled = true
  22. auto_exposure_speed = 1.0
  23. [sub_resource type="CameraAttributesPhysical" id="CameraAttributesPhysical_drxnu"]
  24. auto_exposure_enabled = true
  25. auto_exposure_speed = 1.0
  26. frustum_focal_length = 25.0
  27. [node name="Node3D" type="Node3D"]
  28. [node name="WorldEnvironment" type="WorldEnvironment" parent="."]
  29. environment = SubResource("Environment_3p42x")
  30. camera_attributes = SubResource("CameraAttributesPhysical_n2bnf")
  31. [node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
  32. transform = Transform3D(-0.887673, -0.456539, 0.0600684, 0.273782, -0.418382, 0.866025, -0.370243, 0.785193, 0.496379, 0, 0, 0)
  33. light_angular_distance = 0.5
  34. light_bake_mode = 1
  35. shadow_enabled = true
  36. shadow_blur = 1.8
  37. directional_shadow_mode = 0
  38. directional_shadow_blend_splits = true
  39. directional_shadow_fade_start = 1.0
  40. directional_shadow_max_distance = 15.0
  41. [node name="Camera3D" type="Camera3D" parent="."]
  42. transform = Transform3D(-0.824458, 0.0252143, -0.565361, 0, 0.999007, 0.0445544, 0.565923, 0.0367332, -0.82364, -2.93199, 2.20651, -1.8947)
  43. attributes = SubResource("CameraAttributesPhysical_drxnu")
  44. current = true
  45. [node name="LivingRoom" parent="." instance=ExtResource("1_oncn7")]
  46. [node name="Lightbulb1" type="OmniLight3D" parent="."]
  47. transform = Transform3D(0.707107, 0, 0.707107, 0, 1, 0, -0.707107, 0, 0.707107, 2, 3.19673, 0)
  48. light_intensity_lumens = 800.0
  49. light_temperature = 5000.0
  50. light_size = 0.1
  51. shadow_enabled = true
  52. [node name="Lightbulb2" type="OmniLight3D" parent="."]
  53. transform = Transform3D(0.707107, 0, 0.707107, 0, 1, 0, -0.707107, 0, 0.707107, -2, 3.197, 0)
  54. light_intensity_lumens = 800.0
  55. light_temperature = 5000.0
  56. light_size = 0.1
  57. shadow_enabled = true
  58. [node name="Options" type="Control" parent="." node_paths=PackedStringArray("sun", "lightbulb_1", "lightbulb_2", "world_environment")]
  59. layout_mode = 3
  60. anchors_preset = 15
  61. anchor_right = 1.0
  62. anchor_bottom = 1.0
  63. grow_horizontal = 2
  64. grow_vertical = 2
  65. script = ExtResource("2_hjhvo")
  66. sun = NodePath("../DirectionalLight3D")
  67. lightbulb_1 = NodePath("../Lightbulb1")
  68. lightbulb_2 = NodePath("../Lightbulb2")
  69. world_environment = NodePath("../WorldEnvironment")
  70. [node name="Light" type="VBoxContainer" parent="Options"]
  71. layout_mode = 0
  72. offset_left = 16.0
  73. offset_top = 16.0
  74. offset_right = 516.0
  75. offset_bottom = 69.0
  76. [node name="TimeOfDay" type="HBoxContainer" parent="Options/Light"]
  77. layout_mode = 2
  78. theme_override_constants/separation = 15
  79. [node name="Label" type="Label" parent="Options/Light/TimeOfDay"]
  80. layout_mode = 2
  81. size_flags_horizontal = 3
  82. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  83. theme_override_constants/outline_size = 4
  84. text = "Time of Day"
  85. vertical_alignment = 1
  86. [node name="HSlider" type="HSlider" parent="Options/Light/TimeOfDay"]
  87. layout_mode = 2
  88. size_flags_horizontal = 3
  89. size_flags_vertical = 4
  90. max_value = 1410.0
  91. step = 15.0
  92. value = 840.0
  93. [node name="Value" type="Label" parent="Options/Light/TimeOfDay"]
  94. layout_mode = 2
  95. size_flags_horizontal = 3
  96. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  97. theme_override_constants/outline_size = 4
  98. text = "14:00"
  99. vertical_alignment = 1
  100. [node name="SunIntensity" type="HBoxContainer" parent="Options/Light"]
  101. layout_mode = 2
  102. theme_override_constants/separation = 15
  103. [node name="Label" type="Label" parent="Options/Light/SunIntensity"]
  104. layout_mode = 2
  105. size_flags_horizontal = 3
  106. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  107. theme_override_constants/outline_size = 4
  108. text = "Sun Intensity"
  109. vertical_alignment = 1
  110. [node name="HSlider" type="HSlider" parent="Options/Light/SunIntensity"]
  111. layout_mode = 2
  112. size_flags_horizontal = 3
  113. size_flags_vertical = 4
  114. max_value = 200000.0
  115. step = 2000.0
  116. value = 100000.0
  117. [node name="Value" type="Label" parent="Options/Light/SunIntensity"]
  118. layout_mode = 2
  119. size_flags_horizontal = 3
  120. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  121. theme_override_constants/outline_size = 4
  122. text = "100000 lux"
  123. vertical_alignment = 1
  124. [node name="Lightbulb1Intensity" type="HBoxContainer" parent="Options/Light"]
  125. layout_mode = 2
  126. theme_override_constants/separation = 15
  127. [node name="Label" type="Label" parent="Options/Light/Lightbulb1Intensity"]
  128. layout_mode = 2
  129. size_flags_horizontal = 3
  130. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  131. theme_override_constants/outline_size = 4
  132. text = "Lightbulb 1 Intensity"
  133. vertical_alignment = 1
  134. [node name="HSlider" type="HSlider" parent="Options/Light/Lightbulb1Intensity"]
  135. layout_mode = 2
  136. size_flags_horizontal = 3
  137. size_flags_vertical = 4
  138. max_value = 3000.0
  139. step = 50.0
  140. value = 800.0
  141. [node name="Value" type="Label" parent="Options/Light/Lightbulb1Intensity"]
  142. layout_mode = 2
  143. size_flags_horizontal = 3
  144. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  145. theme_override_constants/outline_size = 4
  146. text = "800 lm"
  147. vertical_alignment = 1
  148. [node name="Lightbulb1Temperature" type="HBoxContainer" parent="Options/Light"]
  149. layout_mode = 2
  150. theme_override_constants/separation = 15
  151. [node name="Label" type="Label" parent="Options/Light/Lightbulb1Temperature"]
  152. layout_mode = 2
  153. size_flags_horizontal = 3
  154. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  155. theme_override_constants/outline_size = 4
  156. theme_override_font_sizes/font_size = 14
  157. text = "Lightbulb 1 Temperature"
  158. horizontal_alignment = 1
  159. vertical_alignment = 1
  160. [node name="HSlider" type="HSlider" parent="Options/Light/Lightbulb1Temperature"]
  161. layout_mode = 2
  162. size_flags_horizontal = 3
  163. size_flags_vertical = 4
  164. min_value = 1000.0
  165. max_value = 15000.0
  166. step = 100.0
  167. value = 5000.0
  168. [node name="Value" type="Label" parent="Options/Light/Lightbulb1Temperature"]
  169. layout_mode = 2
  170. size_flags_horizontal = 3
  171. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  172. theme_override_constants/outline_size = 4
  173. text = "5000 K"
  174. vertical_alignment = 1
  175. [node name="Lightbulb2Intensity" type="HBoxContainer" parent="Options/Light"]
  176. layout_mode = 2
  177. theme_override_constants/separation = 15
  178. [node name="Label" type="Label" parent="Options/Light/Lightbulb2Intensity"]
  179. layout_mode = 2
  180. size_flags_horizontal = 3
  181. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  182. theme_override_constants/outline_size = 4
  183. text = "Lightbulb 2 Intensity"
  184. vertical_alignment = 1
  185. [node name="HSlider" type="HSlider" parent="Options/Light/Lightbulb2Intensity"]
  186. layout_mode = 2
  187. size_flags_horizontal = 3
  188. size_flags_vertical = 4
  189. max_value = 3000.0
  190. step = 50.0
  191. value = 800.0
  192. [node name="Value" type="Label" parent="Options/Light/Lightbulb2Intensity"]
  193. layout_mode = 2
  194. size_flags_horizontal = 3
  195. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  196. theme_override_constants/outline_size = 4
  197. text = "800 lm"
  198. vertical_alignment = 1
  199. [node name="Lightbulb2Temperature" type="HBoxContainer" parent="Options/Light"]
  200. layout_mode = 2
  201. theme_override_constants/separation = 15
  202. [node name="Label" type="Label" parent="Options/Light/Lightbulb2Temperature"]
  203. layout_mode = 2
  204. size_flags_horizontal = 3
  205. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  206. theme_override_constants/outline_size = 4
  207. theme_override_font_sizes/font_size = 14
  208. text = "Lightbulb 2 Temperature"
  209. vertical_alignment = 1
  210. [node name="HSlider" type="HSlider" parent="Options/Light/Lightbulb2Temperature"]
  211. layout_mode = 2
  212. size_flags_horizontal = 3
  213. size_flags_vertical = 4
  214. min_value = 1000.0
  215. max_value = 15000.0
  216. step = 100.0
  217. value = 5000.0
  218. [node name="Value" type="Label" parent="Options/Light/Lightbulb2Temperature"]
  219. layout_mode = 2
  220. size_flags_horizontal = 3
  221. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  222. theme_override_constants/outline_size = 4
  223. text = "5000 K"
  224. vertical_alignment = 1
  225. [node name="SDFGI" type="CheckButton" parent="Options/Light"]
  226. layout_mode = 2
  227. size_flags_horizontal = 0
  228. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  229. theme_override_constants/outline_size = 4
  230. text = "SDF Global Illumination"
  231. [node name="Camera" type="VBoxContainer" parent="Options"]
  232. layout_mode = 1
  233. anchors_preset = 2
  234. anchor_top = 1.0
  235. anchor_bottom = 1.0
  236. offset_left = 16.0
  237. offset_top = -42.0
  238. offset_right = 516.0
  239. offset_bottom = -16.0
  240. grow_vertical = 0
  241. [node name="FocusDistance" type="HBoxContainer" parent="Options/Camera"]
  242. layout_mode = 2
  243. theme_override_constants/separation = 15
  244. [node name="Label" type="Label" parent="Options/Camera/FocusDistance"]
  245. layout_mode = 2
  246. size_flags_horizontal = 3
  247. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  248. theme_override_constants/outline_size = 4
  249. text = "Focus Distance"
  250. [node name="HSlider" type="HSlider" parent="Options/Camera/FocusDistance"]
  251. layout_mode = 2
  252. size_flags_horizontal = 3
  253. size_flags_vertical = 4
  254. min_value = 0.5
  255. max_value = 20.0
  256. step = 0.1
  257. value = 10.0
  258. [node name="Value" type="Label" parent="Options/Camera/FocusDistance"]
  259. layout_mode = 2
  260. size_flags_horizontal = 3
  261. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  262. theme_override_constants/outline_size = 4
  263. text = "10 m"
  264. [node name="FocalLength" type="HBoxContainer" parent="Options/Camera"]
  265. layout_mode = 2
  266. theme_override_constants/separation = 15
  267. [node name="Label" type="Label" parent="Options/Camera/FocalLength"]
  268. layout_mode = 2
  269. size_flags_horizontal = 3
  270. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  271. theme_override_constants/outline_size = 4
  272. text = "Focal Length"
  273. [node name="HSlider" type="HSlider" parent="Options/Camera/FocalLength"]
  274. layout_mode = 2
  275. size_flags_horizontal = 3
  276. size_flags_vertical = 4
  277. min_value = 10.0
  278. value = 25.0
  279. [node name="Value" type="Label" parent="Options/Camera/FocalLength"]
  280. layout_mode = 2
  281. size_flags_horizontal = 3
  282. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  283. theme_override_constants/outline_size = 4
  284. text = "25 mm"
  285. [node name="Aperture" type="HBoxContainer" parent="Options/Camera"]
  286. layout_mode = 2
  287. theme_override_constants/separation = 15
  288. [node name="Label" type="Label" parent="Options/Camera/Aperture"]
  289. layout_mode = 2
  290. size_flags_horizontal = 3
  291. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  292. theme_override_constants/outline_size = 4
  293. text = "Aperture"
  294. [node name="HSlider" type="HSlider" parent="Options/Camera/Aperture"]
  295. layout_mode = 2
  296. size_flags_horizontal = 3
  297. size_flags_vertical = 4
  298. min_value = 0.5
  299. max_value = 64.0
  300. step = 0.5
  301. value = 16.0
  302. [node name="Value" type="Label" parent="Options/Camera/Aperture"]
  303. layout_mode = 2
  304. size_flags_horizontal = 3
  305. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  306. theme_override_constants/outline_size = 4
  307. text = "16.0 f-stop"
  308. [node name="ShutterSpeed" type="HBoxContainer" parent="Options/Camera"]
  309. layout_mode = 2
  310. theme_override_constants/separation = 15
  311. [node name="Label" type="Label" parent="Options/Camera/ShutterSpeed"]
  312. layout_mode = 2
  313. size_flags_horizontal = 3
  314. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  315. theme_override_constants/outline_size = 4
  316. text = "Shutter Speed"
  317. [node name="HSlider" type="HSlider" parent="Options/Camera/ShutterSpeed"]
  318. layout_mode = 2
  319. size_flags_horizontal = 3
  320. size_flags_vertical = 4
  321. min_value = 10.0
  322. max_value = 2000.0
  323. step = 10.0
  324. value = 100.0
  325. [node name="Value" type="Label" parent="Options/Camera/ShutterSpeed"]
  326. layout_mode = 2
  327. size_flags_horizontal = 3
  328. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  329. theme_override_constants/outline_size = 4
  330. text = "1/100"
  331. [node name="Sensitivity" type="HBoxContainer" parent="Options/Camera"]
  332. layout_mode = 2
  333. theme_override_constants/separation = 15
  334. [node name="Label" type="Label" parent="Options/Camera/Sensitivity"]
  335. layout_mode = 2
  336. size_flags_horizontal = 3
  337. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  338. theme_override_constants/outline_size = 4
  339. text = "Sensitivity"
  340. [node name="HSlider" type="HSlider" parent="Options/Camera/Sensitivity"]
  341. layout_mode = 2
  342. size_flags_horizontal = 3
  343. size_flags_vertical = 4
  344. min_value = 50.0
  345. max_value = 6400.0
  346. step = 50.0
  347. value = 100.0
  348. [node name="Value" type="Label" parent="Options/Camera/Sensitivity"]
  349. layout_mode = 2
  350. size_flags_horizontal = 3
  351. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  352. theme_override_constants/outline_size = 4
  353. text = "100 ISO"
  354. [node name="AutoexposureSpeed" type="HBoxContainer" parent="Options/Camera"]
  355. layout_mode = 2
  356. theme_override_constants/separation = 15
  357. [node name="Label" type="Label" parent="Options/Camera/AutoexposureSpeed"]
  358. layout_mode = 2
  359. size_flags_horizontal = 3
  360. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  361. theme_override_constants/outline_size = 4
  362. text = "Auto Exposure Speed"
  363. [node name="HSlider" type="HSlider" parent="Options/Camera/AutoexposureSpeed"]
  364. layout_mode = 2
  365. size_flags_horizontal = 3
  366. size_flags_vertical = 4
  367. max_value = 10.0
  368. step = 0.1
  369. value = 1.0
  370. [node name="Value" type="Label" parent="Options/Camera/AutoexposureSpeed"]
  371. layout_mode = 2
  372. size_flags_horizontal = 3
  373. theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
  374. theme_override_constants/outline_size = 4
  375. text = "1.0"
  376. [connection signal="value_changed" from="Options/Light/TimeOfDay/HSlider" to="Options" method="_on_time_of_day_value_changed"]
  377. [connection signal="value_changed" from="Options/Light/SunIntensity/HSlider" to="Options" method="_on_sun_intensity_value_changed"]
  378. [connection signal="value_changed" from="Options/Light/Lightbulb1Intensity/HSlider" to="Options" method="_on_lightbulb1_intensity_value_changed"]
  379. [connection signal="value_changed" from="Options/Light/Lightbulb1Temperature/HSlider" to="Options" method="_on_lightbulb1_temperature_value_changed"]
  380. [connection signal="value_changed" from="Options/Light/Lightbulb2Intensity/HSlider" to="Options" method="_on_lightbulb2_intensity_value_changed"]
  381. [connection signal="value_changed" from="Options/Light/Lightbulb2Temperature/HSlider" to="Options" method="_on_lightbulb2_temperature_value_changed"]
  382. [connection signal="toggled" from="Options/Light/SDFGI" to="Options" method="_on_sdfgi_button_toggled"]
  383. [connection signal="value_changed" from="Options/Camera/FocusDistance/HSlider" to="Options" method="_on_focus_distance_value_changed"]
  384. [connection signal="value_changed" from="Options/Camera/FocalLength/HSlider" to="Options" method="_on_focal_length_value_changed"]
  385. [connection signal="value_changed" from="Options/Camera/Aperture/HSlider" to="Options" method="_on_aperture_value_changed"]
  386. [connection signal="value_changed" from="Options/Camera/ShutterSpeed/HSlider" to="Options" method="_on_shutter_speed_value_changed"]
  387. [connection signal="value_changed" from="Options/Camera/Sensitivity/HSlider" to="Options" method="_on_sensitivity_value_changed"]
  388. [connection signal="value_changed" from="Options/Camera/AutoexposureSpeed/HSlider" to="Options" method="_on_autoexposure_speed_value_changed"]