From c711af00ecd25b5cd718d2d59c7f049bf67a421f Mon Sep 17 00:00:00 2001 From: Mario Brandao Date: Thu, 14 Dec 2023 22:10:23 +0100 Subject: [PATCH] Particles with a menu --- .../kenney_particle_pack/light_01.png.import | 13 +- .../kenney_particle_pack/muzzle_02.png.import | 13 +- .../kenney_particle_pack/muzzle_03.png.import | 13 +- .../kenney_particle_pack/muzzle_04.png.import | 13 +- .../kenney_particle_pack/muzzle_05.png.import | 13 +- .../kenney_particle_pack/scorch_03.png.import | 13 +- .../kenney_particle_pack/star_07.png.import | 13 +- environments/black-environment.tres | 3 +- particle-effects.tscn | 203 +++++++++++++++--- particles/fire.tscn | 4 +- particles/impact.tscn | 81 +++++-- particles/implosion.tscn | 39 ++-- particles/particle-effects-scene.gd | 36 ++++ particles/particles_button_group.tres | 3 + particles/shockwave.tscn | 82 +++---- particles/smoke.tscn | 1 - project.godot | 5 + 17 files changed, 380 insertions(+), 168 deletions(-) create mode 100644 particles/particle-effects-scene.gd create mode 100644 particles/particles_button_group.tres diff --git a/addons/kenney_particle_pack/light_01.png.import b/addons/kenney_particle_pack/light_01.png.import index 19586b9..dcd50e3 100644 --- a/addons/kenney_particle_pack/light_01.png.import +++ b/addons/kenney_particle_pack/light_01.png.import @@ -3,25 +3,26 @@ importer="texture" type="CompressedTexture2D" uid="uid://d13htnt3w5v7h" -path="res://.godot/imported/light_01.png-7be74028366de437e7b0c8f542b7c268.ctex" +path.s3tc="res://.godot/imported/light_01.png-7be74028366de437e7b0c8f542b7c268.s3tc.ctex" metadata={ -"vram_texture": false +"imported_formats": ["s3tc_bptc"], +"vram_texture": true } [deps] source_file="res://addons/kenney_particle_pack/light_01.png" -dest_files=["res://.godot/imported/light_01.png-7be74028366de437e7b0c8f542b7c268.ctex"] +dest_files=["res://.godot/imported/light_01.png-7be74028366de437e7b0c8f542b7c268.s3tc.ctex"] [params] -compress/mode=0 +compress/mode=2 compress/high_quality=false compress/lossy_quality=0.7 compress/hdr_compression=1 compress/normal_map=0 compress/channel_pack=0 -mipmaps/generate=false +mipmaps/generate=true mipmaps/limit=-1 roughness/mode=0 roughness/src_normal="" @@ -31,4 +32,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/addons/kenney_particle_pack/muzzle_02.png.import b/addons/kenney_particle_pack/muzzle_02.png.import index 5d28ec5..3b1e170 100644 --- a/addons/kenney_particle_pack/muzzle_02.png.import +++ b/addons/kenney_particle_pack/muzzle_02.png.import @@ -3,25 +3,26 @@ importer="texture" type="CompressedTexture2D" uid="uid://c60gps5cwt2c7" -path="res://.godot/imported/muzzle_02.png-5f7494331d894d23b8317af11bf7cc4a.ctex" +path.s3tc="res://.godot/imported/muzzle_02.png-5f7494331d894d23b8317af11bf7cc4a.s3tc.ctex" metadata={ -"vram_texture": false +"imported_formats": ["s3tc_bptc"], +"vram_texture": true } [deps] source_file="res://addons/kenney_particle_pack/muzzle_02.png" -dest_files=["res://.godot/imported/muzzle_02.png-5f7494331d894d23b8317af11bf7cc4a.ctex"] +dest_files=["res://.godot/imported/muzzle_02.png-5f7494331d894d23b8317af11bf7cc4a.s3tc.ctex"] [params] -compress/mode=0 +compress/mode=2 compress/high_quality=false compress/lossy_quality=0.7 compress/hdr_compression=1 compress/normal_map=0 compress/channel_pack=0 -mipmaps/generate=false +mipmaps/generate=true mipmaps/limit=-1 roughness/mode=0 roughness/src_normal="" @@ -31,4 +32,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/addons/kenney_particle_pack/muzzle_03.png.import b/addons/kenney_particle_pack/muzzle_03.png.import index e701837..57fbb02 100644 --- a/addons/kenney_particle_pack/muzzle_03.png.import +++ b/addons/kenney_particle_pack/muzzle_03.png.import @@ -3,25 +3,26 @@ importer="texture" type="CompressedTexture2D" uid="uid://cyiletq0pkl0n" -path="res://.godot/imported/muzzle_03.png-1239ba890c93338bc21f3f74f77b786f.ctex" +path.s3tc="res://.godot/imported/muzzle_03.png-1239ba890c93338bc21f3f74f77b786f.s3tc.ctex" metadata={ -"vram_texture": false +"imported_formats": ["s3tc_bptc"], +"vram_texture": true } [deps] source_file="res://addons/kenney_particle_pack/muzzle_03.png" -dest_files=["res://.godot/imported/muzzle_03.png-1239ba890c93338bc21f3f74f77b786f.ctex"] +dest_files=["res://.godot/imported/muzzle_03.png-1239ba890c93338bc21f3f74f77b786f.s3tc.ctex"] [params] -compress/mode=0 +compress/mode=2 compress/high_quality=false compress/lossy_quality=0.7 compress/hdr_compression=1 compress/normal_map=0 compress/channel_pack=0 -mipmaps/generate=false +mipmaps/generate=true mipmaps/limit=-1 roughness/mode=0 roughness/src_normal="" @@ -31,4 +32,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/addons/kenney_particle_pack/muzzle_04.png.import b/addons/kenney_particle_pack/muzzle_04.png.import index 7e13c1f..b4a687f 100644 --- a/addons/kenney_particle_pack/muzzle_04.png.import +++ b/addons/kenney_particle_pack/muzzle_04.png.import @@ -3,25 +3,26 @@ importer="texture" type="CompressedTexture2D" uid="uid://bixgnuiv2dcuu" -path="res://.godot/imported/muzzle_04.png-5687910aa2f9d3ca2c89f51b2e3d2c14.ctex" +path.s3tc="res://.godot/imported/muzzle_04.png-5687910aa2f9d3ca2c89f51b2e3d2c14.s3tc.ctex" metadata={ -"vram_texture": false +"imported_formats": ["s3tc_bptc"], +"vram_texture": true } [deps] source_file="res://addons/kenney_particle_pack/muzzle_04.png" -dest_files=["res://.godot/imported/muzzle_04.png-5687910aa2f9d3ca2c89f51b2e3d2c14.ctex"] +dest_files=["res://.godot/imported/muzzle_04.png-5687910aa2f9d3ca2c89f51b2e3d2c14.s3tc.ctex"] [params] -compress/mode=0 +compress/mode=2 compress/high_quality=false compress/lossy_quality=0.7 compress/hdr_compression=1 compress/normal_map=0 compress/channel_pack=0 -mipmaps/generate=false +mipmaps/generate=true mipmaps/limit=-1 roughness/mode=0 roughness/src_normal="" @@ -31,4 +32,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/addons/kenney_particle_pack/muzzle_05.png.import b/addons/kenney_particle_pack/muzzle_05.png.import index 174b18f..fe9a1a0 100644 --- a/addons/kenney_particle_pack/muzzle_05.png.import +++ b/addons/kenney_particle_pack/muzzle_05.png.import @@ -3,25 +3,26 @@ importer="texture" type="CompressedTexture2D" uid="uid://brrnpdlw0bs1e" -path="res://.godot/imported/muzzle_05.png-4495385d4c2765cb6d5ce751f8e0b962.ctex" +path.s3tc="res://.godot/imported/muzzle_05.png-4495385d4c2765cb6d5ce751f8e0b962.s3tc.ctex" metadata={ -"vram_texture": false +"imported_formats": ["s3tc_bptc"], +"vram_texture": true } [deps] source_file="res://addons/kenney_particle_pack/muzzle_05.png" -dest_files=["res://.godot/imported/muzzle_05.png-4495385d4c2765cb6d5ce751f8e0b962.ctex"] +dest_files=["res://.godot/imported/muzzle_05.png-4495385d4c2765cb6d5ce751f8e0b962.s3tc.ctex"] [params] -compress/mode=0 +compress/mode=2 compress/high_quality=false compress/lossy_quality=0.7 compress/hdr_compression=1 compress/normal_map=0 compress/channel_pack=0 -mipmaps/generate=false +mipmaps/generate=true mipmaps/limit=-1 roughness/mode=0 roughness/src_normal="" @@ -31,4 +32,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/addons/kenney_particle_pack/scorch_03.png.import b/addons/kenney_particle_pack/scorch_03.png.import index d79442e..92c415b 100644 --- a/addons/kenney_particle_pack/scorch_03.png.import +++ b/addons/kenney_particle_pack/scorch_03.png.import @@ -3,25 +3,26 @@ importer="texture" type="CompressedTexture2D" uid="uid://c5uglgcwox5j0" -path="res://.godot/imported/scorch_03.png-44e72463b931759356bc18eeb22da879.ctex" +path.s3tc="res://.godot/imported/scorch_03.png-44e72463b931759356bc18eeb22da879.s3tc.ctex" metadata={ -"vram_texture": false +"imported_formats": ["s3tc_bptc"], +"vram_texture": true } [deps] source_file="res://addons/kenney_particle_pack/scorch_03.png" -dest_files=["res://.godot/imported/scorch_03.png-44e72463b931759356bc18eeb22da879.ctex"] +dest_files=["res://.godot/imported/scorch_03.png-44e72463b931759356bc18eeb22da879.s3tc.ctex"] [params] -compress/mode=0 +compress/mode=2 compress/high_quality=false compress/lossy_quality=0.7 compress/hdr_compression=1 compress/normal_map=0 compress/channel_pack=0 -mipmaps/generate=false +mipmaps/generate=true mipmaps/limit=-1 roughness/mode=0 roughness/src_normal="" @@ -31,4 +32,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/addons/kenney_particle_pack/star_07.png.import b/addons/kenney_particle_pack/star_07.png.import index 9942446..37adb0c 100644 --- a/addons/kenney_particle_pack/star_07.png.import +++ b/addons/kenney_particle_pack/star_07.png.import @@ -3,25 +3,26 @@ importer="texture" type="CompressedTexture2D" uid="uid://jx5afpr38qkm" -path="res://.godot/imported/star_07.png-270a23685f71e687b5f82d6e0794ffda.ctex" +path.s3tc="res://.godot/imported/star_07.png-270a23685f71e687b5f82d6e0794ffda.s3tc.ctex" metadata={ -"vram_texture": false +"imported_formats": ["s3tc_bptc"], +"vram_texture": true } [deps] source_file="res://addons/kenney_particle_pack/star_07.png" -dest_files=["res://.godot/imported/star_07.png-270a23685f71e687b5f82d6e0794ffda.ctex"] +dest_files=["res://.godot/imported/star_07.png-270a23685f71e687b5f82d6e0794ffda.s3tc.ctex"] [params] -compress/mode=0 +compress/mode=2 compress/high_quality=false compress/lossy_quality=0.7 compress/hdr_compression=1 compress/normal_map=0 compress/channel_pack=0 -mipmaps/generate=false +mipmaps/generate=true mipmaps/limit=-1 roughness/mode=0 roughness/src_normal="" @@ -31,4 +32,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/environments/black-environment.tres b/environments/black-environment.tres index aecfe32..5dcd218 100644 --- a/environments/black-environment.tres +++ b/environments/black-environment.tres @@ -2,8 +2,9 @@ [resource] background_mode = 1 +background_color = Color(0.466667, 0.466667, 0.466667, 1) +background_energy_multiplier = 2.98 glow_enabled = true -glow_strength = 1.1 glow_blend_mode = 0 fog_light_energy = 0.82 fog_sun_scatter = 0.15 diff --git a/particle-effects.tscn b/particle-effects.tscn index 12d3682..0b77f65 100644 --- a/particle-effects.tscn +++ b/particle-effects.tscn @@ -1,16 +1,19 @@ -[gd_scene load_steps=14 format=3 uid="uid://chomobsn1vdo4"] +[gd_scene load_steps=18 format=3 uid="uid://chomobsn1vdo4"] +[ext_resource type="Script" path="res://particles/particle-effects-scene.gd" id="1_62kg4"] [ext_resource type="Environment" uid="uid://dxrk0u62aekxt" path="res://environments/black-environment.tres" id="1_k1rat"] [ext_resource type="PackedScene" uid="uid://cxj4cf67il71y" path="res://particles/smoke.tscn" id="1_vs4eb"] [ext_resource type="PackedScene" uid="uid://c4g1wgyk5ynef" path="res://particles/fire.tscn" id="2_ua5o7"] [ext_resource type="PackedScene" uid="uid://bdwxckix3vslo" path="res://particles/hurricane.tscn" id="3_1jf4n"] [ext_resource type="PackedScene" uid="uid://ce6advdj56x0c" path="res://particles/hyperdrive.tscn" id="4_waeec"] [ext_resource type="PackedScene" uid="uid://b2dthk7xytysh" path="res://particles/shield.tscn" id="5_iqqai"] -[ext_resource type="PackedScene" uid="uid://ck5vuhi3tffgl" path="res://particles/sparks.tscn" id="6_n8y86"] +[ext_resource type="PackedScene" uid="uid://1p0djdxytw42" path="res://particles/sparks.tscn" id="6_n8y86"] [ext_resource type="PackedScene" uid="uid://1nbihtdf4hnv" path="res://particles/rain.tscn" id="8_pqidy"] -[ext_resource type="PackedScene" uid="uid://jyk4uwcupa50" path="res://particles/impact.tscn" id="9_x76w5"] -[ext_resource type="PackedScene" path="res://particles/shockwave.tscn" id="10_e5e8r"] -[ext_resource type="PackedScene" path="res://particles/implosion.tscn" id="11_df01b"] +[ext_resource type="PackedScene" uid="uid://xilvyurttymc" path="res://particles/impact.tscn" id="9_rjfb0"] +[ext_resource type="PackedScene" uid="uid://r8y6qoevceyk" path="res://particles/shockwave.tscn" id="10_e5e8r"] +[ext_resource type="PackedScene" uid="uid://b8468qkcraev" path="res://particles/implosion.tscn" id="11_df01b"] +[ext_resource type="Texture2D" uid="uid://etnwfy334jt" path="res://addons/kenney_particle_pack/window_03.png" id="12_frhsd"] +[ext_resource type="ButtonGroup" uid="uid://crqtlmwxkve6i" path="res://particles/particles_button_group.tres" id="13_k8na1"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_njwlo"] shading_mode = 0 @@ -18,60 +21,212 @@ albedo_color = Color(0, 0, 0, 1) [sub_resource type="PlaneMesh" id="PlaneMesh_1mtlo"] material = SubResource("StandardMaterial3D_njwlo") -size = Vector2(10, 10) +size = Vector2(20, 20) -[node name="Particle Effects" type="Node3D"] +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_pwnty"] +bg_color = Color(0.278431, 0, 0.141176, 0.392157) + +[node name="Particle Effects Scene" type="Node3D"] +script = ExtResource("1_62kg4") [node name="Camera3D" type="Camera3D" parent="."] -transform = Transform3D(0.707107, -0.40558, 0.579228, 0, 0.819152, 0.573576, -0.707107, -0.40558, 0.579228, 30, 30, 30) +transform = Transform3D(0.707107, -0.40051, 0.582745, 0, 0.824126, 0.566406, -0.707107, -0.40051, 0.582745, 30, 30, 30) environment = ExtResource("1_k1rat") +projection = 1 current = true fov = 3.8 -size = 3.0 +size = 4.0 [node name="DirectionalLight3D" type="DirectionalLight3D" parent="."] [node name="Ground" type="MeshInstance3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.01, 0) mesh = SubResource("PlaneMesh_1mtlo") -skeleton = NodePath("../Shield") +skeleton = NodePath("") [node name="GPUParticlesCollisionBox3D" type="GPUParticlesCollisionBox3D" parent="Ground"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.52, 0) size = Vector3(10, 1, 10) -[node name="Smoke" parent="." instance=ExtResource("1_vs4eb")] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0) -visible = false +[node name="Effects" type="Node3D" parent="."] +unique_name_in_owner = true -[node name="Fire" parent="." instance=ExtResource("2_ua5o7")] +[node name="Fire" parent="Effects" instance=ExtResource("2_ua5o7")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.25, 0) visible = false -[node name="Hurricane" parent="." instance=ExtResource("3_1jf4n")] +[node name="Hurricane" parent="Effects" instance=ExtResource("3_1jf4n")] visible = false -[node name="Hyperdrive" parent="." instance=ExtResource("4_waeec")] +[node name="Hyperdrive" parent="Effects" instance=ExtResource("4_waeec")] visible = false -[node name="Shield" parent="." instance=ExtResource("5_iqqai")] +[node name="Impact" parent="Effects" instance=ExtResource("9_rjfb0")] visible = false -[node name="Sparks" parent="." instance=ExtResource("6_n8y86")] +[node name="Implosion" parent="Effects" node_paths=PackedStringArray("Particles") instance=ExtResource("11_df01b")] +Particles = [] -[node name="Rain" parent="." instance=ExtResource("8_pqidy")] +[node name="Rain" parent="Effects" instance=ExtResource("8_pqidy")] visible = false -[node name="Impact" parent="." instance=ExtResource("9_x76w5")] +[node name="Shield" parent="Effects" instance=ExtResource("5_iqqai")] visible = false -[node name="Shockwave" parent="." node_paths=PackedStringArray("Particles") instance=ExtResource("10_e5e8r")] +[node name="Shockwave" parent="Effects" node_paths=PackedStringArray("Particles") instance=ExtResource("10_e5e8r")] visible = false Particles = [] -[node name="Implosion" parent="." node_paths=PackedStringArray("Particles") instance=ExtResource("11_df01b")] +[node name="Smoke" parent="Effects" instance=ExtResource("1_vs4eb")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0) visible = false -Particles = [] -[node name="Electricity" type="Node3D" parent="."] +[node name="Sparks" parent="Effects" instance=ExtResource("6_n8y86")] +transform = Transform3D(0.707107, 0.707107, 0, -0.707107, 0.707107, 0, 0, 0, 1, 0, 0.1, 0) visible = false + +[node name="Electricity" type="Node3D" parent="Effects"] +visible = false + +[node name="CanvasLayer UI" type="CanvasLayer" parent="."] + +[node name="SideBar" type="HBoxContainer" parent="CanvasLayer UI"] +anchors_preset = 9 +anchor_bottom = 1.0 +grow_vertical = 2 + +[node name="SideBar Menu" type="MarginContainer" parent="CanvasLayer UI/SideBar"] +layout_mode = 2 + +[node name="Panel" type="Panel" parent="CanvasLayer UI/SideBar/SideBar Menu"] +layout_mode = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_pwnty") + +[node name="MarginContainer" type="MarginContainer" parent="CanvasLayer UI/SideBar/SideBar Menu"] +layout_mode = 2 +theme_override_constants/margin_left = 10 +theme_override_constants/margin_top = 10 +theme_override_constants/margin_right = 10 +theme_override_constants/margin_bottom = 10 + +[node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer UI/SideBar/SideBar Menu/MarginContainer"] +custom_minimum_size = Vector2(200, 0) +layout_mode = 2 + +[node name="ButtonFire" type="Button" parent="CanvasLayer UI/SideBar/SideBar Menu/MarginContainer/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +theme_override_font_sizes/font_size = 24 +toggle_mode = true +button_group = ExtResource("13_k8na1") +text = "Fire" + +[node name="ButtonHurricane" type="Button" parent="CanvasLayer UI/SideBar/SideBar Menu/MarginContainer/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +theme_override_font_sizes/font_size = 24 +toggle_mode = true +button_group = ExtResource("13_k8na1") +text = "Hurricane" + +[node name="ButtonHyperdrive" type="Button" parent="CanvasLayer UI/SideBar/SideBar Menu/MarginContainer/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +theme_override_font_sizes/font_size = 24 +toggle_mode = true +button_group = ExtResource("13_k8na1") +text = "Hyperdrive" + +[node name="ButtonImpact" type="Button" parent="CanvasLayer UI/SideBar/SideBar Menu/MarginContainer/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +theme_override_font_sizes/font_size = 24 +toggle_mode = true +button_group = ExtResource("13_k8na1") +text = "Impact" + +[node name="ButtonImplosion" type="Button" parent="CanvasLayer UI/SideBar/SideBar Menu/MarginContainer/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +theme_override_font_sizes/font_size = 24 +toggle_mode = true +button_group = ExtResource("13_k8na1") +text = "Implosion" + +[node name="ButtonRain" type="Button" parent="CanvasLayer UI/SideBar/SideBar Menu/MarginContainer/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +theme_override_font_sizes/font_size = 24 +toggle_mode = true +button_group = ExtResource("13_k8na1") +text = "Rain" + +[node name="ButtonShield" type="Button" parent="CanvasLayer UI/SideBar/SideBar Menu/MarginContainer/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +theme_override_font_sizes/font_size = 24 +toggle_mode = true +button_group = ExtResource("13_k8na1") +text = "Shield" + +[node name="ButtonShockwave" type="Button" parent="CanvasLayer UI/SideBar/SideBar Menu/MarginContainer/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +theme_override_font_sizes/font_size = 24 +toggle_mode = true +button_group = ExtResource("13_k8na1") +text = "Shockwave" + +[node name="ButtonSmoke" type="Button" parent="CanvasLayer UI/SideBar/SideBar Menu/MarginContainer/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +theme_override_font_sizes/font_size = 24 +toggle_mode = true +button_group = ExtResource("13_k8na1") +text = "Smoke" + +[node name="ButtonSparks" type="Button" parent="CanvasLayer UI/SideBar/SideBar Menu/MarginContainer/VBoxContainer"] +unique_name_in_owner = true +layout_mode = 2 +theme_override_font_sizes/font_size = 24 +toggle_mode = true +button_group = ExtResource("13_k8na1") +text = "Sparks" + +[node name="ToggleButton" type="TextureButton" parent="CanvasLayer UI/SideBar"] +custom_minimum_size = Vector2(64, 2.08165e-12) +layout_mode = 2 +texture_normal = ExtResource("12_frhsd") +ignore_texture_size = true +stretch_mode = 4 + +[node name="BottomBar" type="MarginContainer" parent="CanvasLayer UI"] +anchors_preset = 12 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_top = -50.0 +grow_horizontal = 2 +grow_vertical = 0 +size_flags_vertical = 8 +theme_override_constants/margin_bottom = 10 + +[node name="LabelVisibleEffects" type="RichTextLabel" parent="CanvasLayer UI/BottomBar"] +unique_name_in_owner = true +custom_minimum_size = Vector2(2.08165e-12, 40) +layout_mode = 2 +theme_override_colors/default_color = Color(1, 1, 1, 1) +theme_override_font_sizes/normal_font_size = 24 +bbcode_enabled = true + +[connection signal="pressed" from="CanvasLayer UI/SideBar/SideBar Menu/MarginContainer/VBoxContainer/ButtonFire" to="." method="updateVisibleEffects"] +[connection signal="pressed" from="CanvasLayer UI/SideBar/SideBar Menu/MarginContainer/VBoxContainer/ButtonHurricane" to="." method="updateVisibleEffects"] +[connection signal="pressed" from="CanvasLayer UI/SideBar/SideBar Menu/MarginContainer/VBoxContainer/ButtonHyperdrive" to="." method="updateVisibleEffects"] +[connection signal="pressed" from="CanvasLayer UI/SideBar/SideBar Menu/MarginContainer/VBoxContainer/ButtonImpact" to="." method="updateVisibleEffects"] +[connection signal="pressed" from="CanvasLayer UI/SideBar/SideBar Menu/MarginContainer/VBoxContainer/ButtonImplosion" to="." method="updateVisibleEffects"] +[connection signal="pressed" from="CanvasLayer UI/SideBar/SideBar Menu/MarginContainer/VBoxContainer/ButtonRain" to="." method="updateVisibleEffects"] +[connection signal="pressed" from="CanvasLayer UI/SideBar/SideBar Menu/MarginContainer/VBoxContainer/ButtonShield" to="." method="updateVisibleEffects"] +[connection signal="pressed" from="CanvasLayer UI/SideBar/SideBar Menu/MarginContainer/VBoxContainer/ButtonShockwave" to="." method="updateVisibleEffects"] +[connection signal="pressed" from="CanvasLayer UI/SideBar/SideBar Menu/MarginContainer/VBoxContainer/ButtonSmoke" to="." method="updateVisibleEffects"] +[connection signal="pressed" from="CanvasLayer UI/SideBar/SideBar Menu/MarginContainer/VBoxContainer/ButtonSparks" to="." method="updateVisibleEffects"] +[connection signal="pressed" from="CanvasLayer UI/SideBar/ToggleButton" to="." method="toggleSideBar"] diff --git a/particles/fire.tscn b/particles/fire.tscn index 5c34167..d78328b 100644 --- a/particles/fire.tscn +++ b/particles/fire.tscn @@ -3,7 +3,7 @@ [ext_resource type="Texture2D" uid="uid://52dsxhh2k7e1" path="res://addons/kenney_particle_pack/fire_01.png" id="1_q2wt5"] [sub_resource type="Gradient" id="Gradient_eonhu"] -offsets = PackedFloat32Array(0, 0.201566, 0.78865, 1) +offsets = PackedFloat32Array(0.104693, 0.238267, 0.78865, 1) colors = PackedColorArray(0, 0.356863, 1, 1, 0.894118, 0.290196, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1) [sub_resource type="GradientTexture1D" id="GradientTexture1D_cmn7d"] @@ -29,7 +29,7 @@ color_ramp = SubResource("GradientTexture1D_cmn7d") transparency = 1 blend_mode = 1 vertex_color_use_as_albedo = true -albedo_color = Color(2, 2, 2, 1) +albedo_color = Color(1.5, 1.5, 1.5, 1) albedo_texture = ExtResource("1_q2wt5") billboard_mode = 3 billboard_keep_scale = true diff --git a/particles/impact.tscn b/particles/impact.tscn index a77fada..2c283a6 100644 --- a/particles/impact.tscn +++ b/particles/impact.tscn @@ -1,7 +1,6 @@ -[gd_scene load_steps=13 format=3 uid="uid://jyk4uwcupa50"] +[gd_scene load_steps=17 format=3 uid="uid://xilvyurttymc"] -[ext_resource type="Texture2D" uid="uid://cpqufbjs2rf5t" path="res://addons/kenney_particle_pack/muzzle_01.png" id="1_nj335"] -[ext_resource type="Texture2D" uid="uid://b8yqiftn6q2ij" path="res://addons/kenney_particle_pack/circle_05.png" id="2_6unvo"] +[ext_resource type="Texture2D" uid="uid://bixgnuiv2dcuu" path="res://addons/kenney_particle_pack/muzzle_04.png" id="1_vpc1r"] [sub_resource type="Curve" id="Curve_lqnej"] _data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(0.370492, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] @@ -10,26 +9,44 @@ point_count = 3 [sub_resource type="CurveTexture" id="CurveTexture_rymgb"] curve = SubResource("Curve_lqnej") -[sub_resource type="Curve" id="Curve_mr68g"] -_data = [Vector2(0, 0.521682), 0.0, 0.0, 0, 0, Vector2(0.144262, 1), 0.0, 0.0, 0, 0] +[sub_resource type="Curve" id="Curve_3ftq8"] +max_value = 2.0 +_data = [Vector2(0, 0.0519054), 0.0, 0.0, 0, 0, Vector2(1, 2), 0.0, 0.0, 0, 0] point_count = 2 -[sub_resource type="CurveTexture" id="CurveTexture_7xpum"] -curve = SubResource("Curve_mr68g") +[sub_resource type="Curve" id="Curve_d7y1q"] +_data = [Vector2(0.272131, 1), 0.0, 0.0, 0, 0, Vector2(0.386885, 0.666886), 0.0, 0.0, 0, 0] +point_count = 2 + +[sub_resource type="Curve" id="Curve_orjn8"] +_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0] +point_count = 2 + +[sub_resource type="CurveXYZTexture" id="CurveXYZTexture_j5tl2"] +curve_x = SubResource("Curve_3ftq8") +curve_y = SubResource("Curve_d7y1q") +curve_z = SubResource("Curve_orjn8") [sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_s3tbj"] -gravity = Vector3(0, 0, 0) -scale_curve = SubResource("CurveTexture_7xpum") +emission_shape_offset = Vector3(0, 1, 0) +gravity = Vector3(0, -20, 0) +scale_curve = SubResource("CurveXYZTexture_j5tl2") alpha_curve = SubResource("CurveTexture_rymgb") -sub_emitter_mode = 2 -sub_emitter_amount_at_end = 1 +hue_variation_min = -0.5 +hue_variation_max = 0.5 +collision_mode = 1 +collision_friction = 0.0 +collision_bounce = 0.0 +collision_use_scale = true +sub_emitter_mode = 3 +sub_emitter_amount_at_collision = 1 [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ky36s"] transparency = 1 blend_mode = 1 vertex_color_use_as_albedo = true albedo_color = Color(1, 1, 1, 0.0392157) -albedo_texture = ExtResource("1_nj335") +albedo_texture = ExtResource("1_vpc1r") rim_enabled = true billboard_mode = 3 billboard_keep_scale = true @@ -41,35 +58,53 @@ particles_anim_loop = false material = SubResource("StandardMaterial3D_ky36s") center_offset = Vector3(0, 0.4, 0) -[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_iv2ux"] +[sub_resource type="Curve" id="Curve_tsw8s"] +_data = [Vector2(0, 0.812089), 0.0, 0.0, 0, 0, Vector2(0.501639, 1), 0.0, 0.0, 0, 0, Vector2(1, 0.461892), 0.0, 0.0, 0, 0] +point_count = 3 + +[sub_resource type="CurveTexture" id="CurveTexture_bum2j"] +curve = SubResource("Curve_tsw8s") + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_7no0b"] direction = Vector3(0, 2, 0) initial_velocity_min = 3.0 initial_velocity_max = 3.0 +scale_curve = SubResource("CurveTexture_bum2j") -[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_6ojok"] +[sub_resource type="CompressedTexture2D" id="CompressedTexture2D_4ivdu"] +load_path = "res://.godot/imported/circle_05.png-2d6c777c446ba2a583b61d30e52bc466.s3tc.ctex" + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_xhpkt"] transparency = 1 +blend_mode = 1 vertex_color_use_as_albedo = true -albedo_texture = ExtResource("2_6unvo") +albedo_texture = SubResource("CompressedTexture2D_4ivdu") +rim_enabled = true billboard_mode = 3 billboard_keep_scale = true particles_anim_h_frames = 1 particles_anim_v_frames = 1 particles_anim_loop = false -[sub_resource type="QuadMesh" id="QuadMesh_pmnps"] -material = SubResource("StandardMaterial3D_6ojok") +[sub_resource type="QuadMesh" id="QuadMesh_hvt0q"] +material = SubResource("StandardMaterial3D_xhpkt") size = Vector2(0.1, 0.1) -[node name="Impact" type="Node3D"] - -[node name="GPUParticles3D" type="GPUParticles3D" parent="."] +[node name="Impact" type="GPUParticles3D"] amount = 10 -sub_emitter = NodePath("../GPUParticles3D2") +sub_emitter = NodePath("GPUParticles3D2") +speed_scale = 0.5 explosiveness = 1.0 fixed_fps = 60 process_material = SubResource("ParticleProcessMaterial_s3tbj") draw_pass_1 = SubResource("QuadMesh_ot0ot") [node name="GPUParticles3D2" type="GPUParticles3D" parent="."] -process_material = SubResource("ParticleProcessMaterial_iv2ux") -draw_pass_1 = SubResource("QuadMesh_pmnps") +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.1, 0) +emitting = false +amount = 16 +lifetime = 2.0 +one_shot = true +explosiveness = 1.0 +process_material = SubResource("ParticleProcessMaterial_7no0b") +draw_pass_1 = SubResource("QuadMesh_hvt0q") diff --git a/particles/implosion.tscn b/particles/implosion.tscn index 99e22ed..c3f3716 100644 --- a/particles/implosion.tscn +++ b/particles/implosion.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=23 format=3 uid="uid://10u16dtnpupt"] +[gd_scene load_steps=21 format=3 uid="uid://b8468qkcraev"] [ext_resource type="Script" path="res://scripts/MultiParticles.cs" id="1_weson"] [ext_resource type="Texture2D" uid="uid://b8yqiftn6q2ij" path="res://addons/kenney_particle_pack/circle_05.png" id="2_qtlvw"] @@ -23,8 +23,8 @@ curve = SubResource("Curve_7t07v") emission_shape = 2 emission_sphere_radius = 3.0 gravity = Vector3(2.08165e-12, 2.08165e-12, 2.08165e-12) -radial_accel_min = 0.2 -radial_accel_max = 0.2 +radial_accel_min = 0.18 +radial_accel_max = 0.22 radial_accel_curve = SubResource("CurveTexture_8froe") color = Color(0, 0.564706, 1, 1) alpha_curve = SubResource("CurveTexture_wtgks") @@ -48,14 +48,14 @@ material = SubResource("StandardMaterial3D_blklt") size = Vector2(0.1, 0.1) [sub_resource type="Curve" id="Curve_0jmg7"] -_data = [Vector2(0.251318, 1), 0.0, 0.0, 0, 0, Vector2(0.991213, 0), 0.0, 0.0, 0, 0] +_data = [Vector2(0.251318, 1), 0.0, 0.0, 0, 0, Vector2(0.898361, 0), 0.0, 0.0, 0, 0] point_count = 2 [sub_resource type="CurveTexture" id="CurveTexture_gf3su"] curve = SubResource("Curve_0jmg7") [sub_resource type="Gradient" id="Gradient_vj4no"] -offsets = PackedFloat32Array(0.448141, 0.636008) +offsets = PackedFloat32Array(0, 0.636008) colors = PackedColorArray(0, 0.894118, 1, 1, 0, 0.564706, 1, 1) [sub_resource type="GradientTexture1D" id="GradientTexture1D_8k4ey"] @@ -83,30 +83,15 @@ color_ramp = SubResource("GradientTexture1D_8k4ey") alpha_curve = SubResource("CurveTexture_gf3su") emission_curve = SubResource("CurveTexture_ga1td") -[sub_resource type="Gradient" id="Gradient_30bhn"] -offsets = PackedFloat32Array(0.506744, 0.689788) -colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0) - -[sub_resource type="GradientTexture2D" id="GradientTexture2D_1pmsb"] -gradient = SubResource("Gradient_30bhn") -width = 256 -height = 256 -fill = 1 -fill_from = Vector2(0.5, 0.5) - -[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_k5esa"] +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_egr1g"] transparency = 1 -blend_mode = 1 vertex_color_use_as_albedo = true -albedo_texture = SubResource("GradientTexture2D_1pmsb") -billboard_mode = 3 -billboard_keep_scale = true -particles_anim_h_frames = 1 -particles_anim_v_frames = 1 -particles_anim_loop = false +emission = Color(0, 0.682353, 1, 1) +emission_energy_multiplier = 11.57 +rim_enabled = true -[sub_resource type="QuadMesh" id="QuadMesh_gvf03"] -material = SubResource("StandardMaterial3D_k5esa") +[sub_resource type="SphereMesh" id="SphereMesh_ik8yd"] +material = SubResource("StandardMaterial3D_egr1g") [node name="Implosion" type="Node3D" node_paths=PackedStringArray("Particles")] script = ExtResource("1_weson") @@ -125,4 +110,4 @@ amount = 1 lifetime = 4.0 fixed_fps = 60 process_material = SubResource("ParticleProcessMaterial_t7lly") -draw_pass_1 = SubResource("QuadMesh_gvf03") +draw_pass_1 = SubResource("SphereMesh_ik8yd") diff --git a/particles/particle-effects-scene.gd b/particles/particle-effects-scene.gd new file mode 100644 index 0000000..f3b236f --- /dev/null +++ b/particles/particle-effects-scene.gd @@ -0,0 +1,36 @@ +extends Node3D + +@onready var labelVisibleEffects = %LabelVisibleEffects +@onready var buttonSmoke = %ButtonSmoke +@onready var effectsContainer = %Effects +@onready var sideBarMenu = $"CanvasLayer UI/SideBar/SideBar Menu" + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(_delta): + pass + + +func updateVisibleEffects(): + var pressedButton = buttonSmoke.button_group.get_pressed_button() + var effect = get_node("Effects/" + pressedButton.text.strip_edges()) + + for child in effectsContainer.get_children(): + if child == effect: + child.show() + else: + child.hide() + + labelVisibleEffects.text = "[center]" + pressedButton.text + + +func toggleSideBar(): + if sideBarMenu.visible: # Replace with function body. + sideBarMenu.hide() + else: + sideBarMenu.show() + diff --git a/particles/particles_button_group.tres b/particles/particles_button_group.tres new file mode 100644 index 0000000..58b881c --- /dev/null +++ b/particles/particles_button_group.tres @@ -0,0 +1,3 @@ +[gd_resource type="ButtonGroup" format=3 uid="uid://crqtlmwxkve6i"] + +[resource] diff --git a/particles/shockwave.tscn b/particles/shockwave.tscn index f81479d..65d0d77 100644 --- a/particles/shockwave.tscn +++ b/particles/shockwave.tscn @@ -1,46 +1,10 @@ -[gd_scene load_steps=17 format=3 uid="uid://brf0ftux0hwy8"] +[gd_scene load_steps=15 format=3 uid="uid://r8y6qoevceyk"] [ext_resource type="Script" path="res://scripts/MultiParticles.cs" id="1_yvu1a"] [ext_resource type="Texture2D" uid="uid://bd2arrqo7xw7c" path="res://addons/kenney_particle_pack/circle_01.png" id="2_s6tl6"] -[sub_resource type="Curve" id="Curve_jaxyf"] -_data = [Vector2(0.381371, 1), 0.0, 0.0, 0, 0, Vector2(1, 0.0937408), 0.0, 0.0, 0, 0] -point_count = 2 - -[sub_resource type="CurveTexture" id="CurveTexture_qx1ma"] -curve = SubResource("Curve_jaxyf") - -[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_dbh2b"] -gravity = Vector3(2.08165e-12, 2.08165e-12, 2.08165e-12) -scale_curve = SubResource("CurveTexture_qx1ma") - -[sub_resource type="Gradient" id="Gradient_2mquu"] -offsets = PackedFloat32Array(0.506744, 0.689788) -colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0) - -[sub_resource type="GradientTexture2D" id="GradientTexture2D_fmsbu"] -gradient = SubResource("Gradient_2mquu") -width = 256 -height = 256 -fill = 1 -fill_from = Vector2(0.5, 0.5) - -[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_82lug"] -transparency = 1 -blend_mode = 1 -vertex_color_use_as_albedo = true -albedo_texture = SubResource("GradientTexture2D_fmsbu") -billboard_mode = 3 -billboard_keep_scale = true -particles_anim_h_frames = 1 -particles_anim_v_frames = 1 -particles_anim_loop = false - -[sub_resource type="QuadMesh" id="QuadMesh_vwe5g"] -material = SubResource("StandardMaterial3D_82lug") - [sub_resource type="Curve" id="Curve_q71c2"] -_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] +_data = [Vector2(0, 0.487516), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] point_count = 2 [sub_resource type="CurveTexture" id="CurveTexture_5xkdf"] @@ -48,7 +12,7 @@ curve = SubResource("Curve_q71c2") [sub_resource type="Curve" id="Curve_0s8ld"] max_value = 3.0 -_data = [Vector2(0, 0.0927029), 0.0, 0.0, 0, 0, Vector2(1, 3), 0.0, 0.0, 0, 0] +_data = [Vector2(0, 0.591327), 0.0, 0.0, 0, 0, Vector2(1, 3), 0.0, 0.0, 0, 0] point_count = 2 [sub_resource type="CurveTexture" id="CurveTexture_406ad"] @@ -68,20 +32,42 @@ rim_enabled = true [sub_resource type="PlaneMesh" id="PlaneMesh_iktve"] material = SubResource("StandardMaterial3D_y7i1b") +[sub_resource type="Curve" id="Curve_jaxyf"] +_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(0.381371, 1), 0.0, 0.0, 0, 0, Vector2(1, 0.0937408), 0.0, 0.0, 0, 0] +point_count = 3 + +[sub_resource type="CurveTexture" id="CurveTexture_qx1ma"] +curve = SubResource("Curve_jaxyf") + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_dbh2b"] +gravity = Vector3(2.08165e-12, 2.08165e-12, 2.08165e-12) +scale_curve = SubResource("CurveTexture_qx1ma") + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_kcy1j"] +transparency = 1 +blend_mode = 1 +vertex_color_use_as_albedo = true +rim_enabled = true + +[sub_resource type="SphereMesh" id="SphereMesh_7m7gc"] +material = SubResource("StandardMaterial3D_kcy1j") +radius = 0.4 +height = 0.8 + [node name="Shockwave" type="Node3D" node_paths=PackedStringArray("Particles")] script = ExtResource("1_yvu1a") -Particles = [NodePath("Sphere"), NodePath("Ripple")] +Particles = [NodePath("Sphere"), NodePath("Waves")] + +[node name="Waves" type="GPUParticles3D" parent="."] +amount = 3 +lifetime = 3.0 +explosiveness = 0.8 +process_material = SubResource("ParticleProcessMaterial_aak2r") +draw_pass_1 = SubResource("PlaneMesh_iktve") [node name="Sphere" type="GPUParticles3D" parent="."] amount = 1 lifetime = 3.0 fixed_fps = 60 process_material = SubResource("ParticleProcessMaterial_dbh2b") -draw_pass_1 = SubResource("QuadMesh_vwe5g") - -[node name="Ripple" type="GPUParticles3D" parent="."] -amount = 3 -lifetime = 3.0 -explosiveness = 0.8 -process_material = SubResource("ParticleProcessMaterial_aak2r") -draw_pass_1 = SubResource("PlaneMesh_iktve") +draw_pass_1 = SubResource("SphereMesh_7m7gc") diff --git a/particles/smoke.tscn b/particles/smoke.tscn index 9f7fff5..dbde96f 100644 --- a/particles/smoke.tscn +++ b/particles/smoke.tscn @@ -39,7 +39,6 @@ alpha_curve = SubResource("CurveTexture_qjymw") [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_0ufmo"] transparency = 1 -blend_mode = 1 vertex_color_use_as_albedo = true albedo_texture = ExtResource("1_v5mjt") billboard_mode = 3 diff --git a/project.godot b/project.godot index b33941d..36150f5 100644 --- a/project.godot +++ b/project.godot @@ -15,6 +15,11 @@ run/main_scene="res://particle-effects.tscn" config/features=PackedStringArray("4.2", "C#", "Forward Plus") config/icon="res://icon.svg" +[display] + +window/size/viewport_width=2304 +window/size/viewport_height=1296 + [dotnet] project/assembly_name="godot-visual-effects"