main.tscn 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. [gd_scene load_steps=17 format=3 uid="uid://bpfg1l8j4i08u"]
  2. [ext_resource type="Script" uid="uid://4fiju4j550yb" path="res://main.gd" id="1_o0pyp"]
  3. [ext_resource type="Texture2D" uid="uid://br4k6sn2rvgj" path="res://pattern.png" id="1_r22bv"]
  4. [ext_resource type="Script" uid="uid://c726jddgfchjb" path="res://post_process_shader.gd" id="1_rkpno"]
  5. [ext_resource type="Script" uid="uid://b10l0f4aslyya" path="res://post_process_grayscale.gd" id="2_pwabc"]
  6. [sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_lnmx8"]
  7. sky_horizon_color = Color(0.64625, 0.65575, 0.67075, 1)
  8. ground_horizon_color = Color(0.64625, 0.65575, 0.67075, 1)
  9. [sub_resource type="Sky" id="Sky_guc0r"]
  10. sky_material = SubResource("ProceduralSkyMaterial_lnmx8")
  11. [sub_resource type="Environment" id="Environment_fjaix"]
  12. background_mode = 2
  13. sky = SubResource("Sky_guc0r")
  14. tonemap_mode = 4
  15. glow_enabled = true
  16. [sub_resource type="CompositorEffect" id="CompositorEffect_d6jju"]
  17. resource_local_to_scene = false
  18. resource_name = ""
  19. enabled = true
  20. effect_callback_type = 4
  21. needs_motion_vectors = false
  22. needs_normal_roughness = false
  23. script = ExtResource("2_pwabc")
  24. [sub_resource type="CompositorEffect" id="CompositorEffect_ek4c3"]
  25. resource_local_to_scene = false
  26. resource_name = ""
  27. enabled = false
  28. effect_callback_type = 4
  29. needs_motion_vectors = false
  30. needs_normal_roughness = false
  31. script = ExtResource("1_rkpno")
  32. shader_code = " // Invert color.
  33. color.rgb = vec3(1.0 - color.r, 1.0 - color.g, 1.0 - color.b);
  34. "
  35. [sub_resource type="Compositor" id="Compositor_xxhi4"]
  36. compositor_effects = Array[CompositorEffect]([SubResource("CompositorEffect_d6jju"), SubResource("CompositorEffect_ek4c3")])
  37. [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_xlpoj"]
  38. albedo_color = Color(0, 0.684707, 0.148281, 1)
  39. albedo_texture = ExtResource("1_r22bv")
  40. texture_filter = 5
  41. [sub_resource type="PlaneMesh" id="PlaneMesh_82vj7"]
  42. material = SubResource("StandardMaterial3D_xlpoj")
  43. size = Vector2(10, 10)
  44. [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_aqyxc"]
  45. albedo_color = Color(0.946837, 0.315651, 0.66999, 1)
  46. albedo_texture = ExtResource("1_r22bv")
  47. texture_filter = 5
  48. [sub_resource type="SphereMesh" id="SphereMesh_iuyuf"]
  49. material = SubResource("StandardMaterial3D_aqyxc")
  50. [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_188mc"]
  51. albedo_color = Color(0.436357, 0.305476, 0.999959, 1)
  52. albedo_texture = ExtResource("1_r22bv")
  53. texture_filter = 5
  54. [sub_resource type="BoxMesh" id="BoxMesh_h605a"]
  55. material = SubResource("StandardMaterial3D_188mc")
  56. [node name="Main" type="Node3D"]
  57. script = ExtResource("1_o0pyp")
  58. [node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
  59. transform = Transform3D(-0.866025, -0.433013, 0.25, 0, 0.5, 0.866025, -0.5, 0.75, -0.433013, 0, 0, 0)
  60. shadow_enabled = true
  61. shadow_bias = 0.04
  62. directional_shadow_mode = 0
  63. directional_shadow_fade_start = 1.0
  64. directional_shadow_max_distance = 15.0
  65. [node name="WorldEnvironment" type="WorldEnvironment" parent="."]
  66. environment = SubResource("Environment_fjaix")
  67. compositor = SubResource("Compositor_xxhi4")
  68. [node name="Camera3D" type="Camera3D" parent="."]
  69. transform = Transform3D(0.866025, -0.129409, 0.482963, -1.54268e-08, 0.965926, 0.258819, -0.5, -0.224144, 0.836516, 1, 1.2, 2)
  70. fov = 60.0
  71. [node name="Ground" type="MeshInstance3D" parent="."]
  72. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -3.01202)
  73. mesh = SubResource("PlaneMesh_82vj7")
  74. [node name="Sphere" type="MeshInstance3D" parent="."]
  75. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, -0.796)
  76. mesh = SubResource("SphereMesh_iuyuf")
  77. [node name="Box" type="MeshInstance3D" parent="."]
  78. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.333, 0.5, -0.392)
  79. mesh = SubResource("BoxMesh_h605a")
  80. [node name="Info" type="Label" parent="."]
  81. offset_left = 24.0
  82. offset_top = 24.0
  83. offset_right = 64.0
  84. offset_bottom = 47.0
  85. theme_override_constants/outline_size = 4
  86. text = "Grayscale effect: Enabled
  87. Shader effect: Disabled"
  88. [node name="Help" type="Label" parent="."]
  89. anchors_preset = 2
  90. anchor_top = 1.0
  91. anchor_bottom = 1.0
  92. offset_left = 24.0
  93. offset_top = -47.0
  94. offset_right = 175.0
  95. offset_bottom = -24.0
  96. grow_vertical = 0
  97. theme_override_constants/outline_size = 4
  98. text = "G: Toggle grayscale effect
  99. S: Toggle shader effect"