From 69226310ddb2a14130c1f82f9ba8a8b06055b709 Mon Sep 17 00:00:00 2001 From: Marinho Brandao Date: Fri, 15 Dec 2023 15:08:07 +0100 Subject: [PATCH] Ring Portal particle --- .../kenney_particle_pack/star_09.png.import | 13 +- .../kenney_particle_pack/twirl_01.png.import | 13 +- .../kenney_particle_pack/twirl_02.png.import | 13 +- .../kenney_particle_pack/twirl_03.png.import | 13 +- camera-effects/color_correction.tscn | 3 +- particle-effects.tscn | 34 ++++- particles/particle-effects-scene.gd | 5 + particles/ring_portal.tscn | 139 ++++++++++++++++++ 8 files changed, 205 insertions(+), 28 deletions(-) create mode 100644 particles/ring_portal.tscn diff --git a/addons/kenney_particle_pack/star_09.png.import b/addons/kenney_particle_pack/star_09.png.import index d940b6c..8da8eb3 100644 --- a/addons/kenney_particle_pack/star_09.png.import +++ b/addons/kenney_particle_pack/star_09.png.import @@ -3,25 +3,26 @@ importer="texture" type="CompressedTexture2D" uid="uid://oniakpdqxpop" -path="res://.godot/imported/star_09.png-287477eeac6e9af1dbdc968755b97432.ctex" +path.s3tc="res://.godot/imported/star_09.png-287477eeac6e9af1dbdc968755b97432.s3tc.ctex" metadata={ -"vram_texture": false +"imported_formats": ["s3tc_bptc"], +"vram_texture": true } [deps] source_file="res://addons/kenney_particle_pack/star_09.png" -dest_files=["res://.godot/imported/star_09.png-287477eeac6e9af1dbdc968755b97432.ctex"] +dest_files=["res://.godot/imported/star_09.png-287477eeac6e9af1dbdc968755b97432.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/twirl_01.png.import b/addons/kenney_particle_pack/twirl_01.png.import index f58639e..98f76a1 100644 --- a/addons/kenney_particle_pack/twirl_01.png.import +++ b/addons/kenney_particle_pack/twirl_01.png.import @@ -3,25 +3,26 @@ importer="texture" type="CompressedTexture2D" uid="uid://66jey2yfu51b" -path="res://.godot/imported/twirl_01.png-4eec85b07d3088871ddf2901f4fc61a1.ctex" +path.s3tc="res://.godot/imported/twirl_01.png-4eec85b07d3088871ddf2901f4fc61a1.s3tc.ctex" metadata={ -"vram_texture": false +"imported_formats": ["s3tc_bptc"], +"vram_texture": true } [deps] source_file="res://addons/kenney_particle_pack/twirl_01.png" -dest_files=["res://.godot/imported/twirl_01.png-4eec85b07d3088871ddf2901f4fc61a1.ctex"] +dest_files=["res://.godot/imported/twirl_01.png-4eec85b07d3088871ddf2901f4fc61a1.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/twirl_02.png.import b/addons/kenney_particle_pack/twirl_02.png.import index 38a776d..641d6dc 100644 --- a/addons/kenney_particle_pack/twirl_02.png.import +++ b/addons/kenney_particle_pack/twirl_02.png.import @@ -3,25 +3,26 @@ importer="texture" type="CompressedTexture2D" uid="uid://dqvuxe4gxsaky" -path="res://.godot/imported/twirl_02.png-8a207734234698b1193ac6a5b3833f15.ctex" +path.s3tc="res://.godot/imported/twirl_02.png-8a207734234698b1193ac6a5b3833f15.s3tc.ctex" metadata={ -"vram_texture": false +"imported_formats": ["s3tc_bptc"], +"vram_texture": true } [deps] source_file="res://addons/kenney_particle_pack/twirl_02.png" -dest_files=["res://.godot/imported/twirl_02.png-8a207734234698b1193ac6a5b3833f15.ctex"] +dest_files=["res://.godot/imported/twirl_02.png-8a207734234698b1193ac6a5b3833f15.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/twirl_03.png.import b/addons/kenney_particle_pack/twirl_03.png.import index 088d87e..72d7745 100644 --- a/addons/kenney_particle_pack/twirl_03.png.import +++ b/addons/kenney_particle_pack/twirl_03.png.import @@ -3,25 +3,26 @@ importer="texture" type="CompressedTexture2D" uid="uid://caxhytnpo4m8o" -path="res://.godot/imported/twirl_03.png-c58325fee0c93702c3429e69a1cfe62b.ctex" +path.s3tc="res://.godot/imported/twirl_03.png-c58325fee0c93702c3429e69a1cfe62b.s3tc.ctex" metadata={ -"vram_texture": false +"imported_formats": ["s3tc_bptc"], +"vram_texture": true } [deps] source_file="res://addons/kenney_particle_pack/twirl_03.png" -dest_files=["res://.godot/imported/twirl_03.png-c58325fee0c93702c3429e69a1cfe62b.ctex"] +dest_files=["res://.godot/imported/twirl_03.png-c58325fee0c93702c3429e69a1cfe62b.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/camera-effects/color_correction.tscn b/camera-effects/color_correction.tscn index a4d1f7f..1aab1da 100644 --- a/camera-effects/color_correction.tscn +++ b/camera-effects/color_correction.tscn @@ -3,7 +3,8 @@ [ext_resource type="Shader" path="res://camera-effects/color_correction.gdshader" id="1_hrc25"] [sub_resource type="Gradient" id="Gradient_2gmpi"] -colors = PackedColorArray(6.80027e-06, 0.172575, 0.517032, 1, 0, 0.792157, 1, 1) +offsets = PackedFloat32Array(0, 0.504587, 1) +colors = PackedColorArray(0, 0.792157, 1, 1, 1, 0.788235, 0, 1, 1, 0, 0, 1) [sub_resource type="GradientTexture2D" id="GradientTexture2D_qt6f0"] gradient = SubResource("Gradient_2gmpi") diff --git a/particle-effects.tscn b/particle-effects.tscn index f91b4a5..f03b8a4 100644 --- a/particle-effects.tscn +++ b/particle-effects.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=18 format=3 uid="uid://chomobsn1vdo4"] +[gd_scene load_steps=19 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"] @@ -14,6 +14,7 @@ [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"] +[ext_resource type="PackedScene" uid="uid://dxbwdhrcv17yk" path="res://particles/ring_portal.tscn" id="13_ya4y5"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_njwlo"] shading_mode = 0 @@ -21,7 +22,7 @@ albedo_color = Color(0, 0, 0, 1) [sub_resource type="PlaneMesh" id="PlaneMesh_1mtlo"] material = SubResource("StandardMaterial3D_njwlo") -size = Vector2(20, 20) +size = Vector2(40, 40) [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_pwnty"] bg_color = Color(0.278431, 0, 0.141176, 0.392157) @@ -30,7 +31,8 @@ bg_color = Color(0.278431, 0, 0.141176, 0.392157) script = ExtResource("1_62kg4") [node name="Camera3D" type="Camera3D" parent="."] -transform = Transform3D(0.707107, -0.40051, 0.582745, 0, 0.824126, 0.566406, -0.707107, -0.40051, 0.582745, 30, 30, 30) +unique_name_in_owner = true +transform = Transform3D(0.707107, -0.40558, 0.579228, 2.8571e-16, 0.819152, 0.573576, -0.707107, -0.40558, 0.579228, 30, 30, 30) environment = ExtResource("1_k1rat") projection = 1 current = true @@ -65,6 +67,7 @@ visible = false visible = false [node name="Implosion" parent="Effects" node_paths=PackedStringArray("Particles") instance=ExtResource("11_df01b")] +visible = false Particles = [] [node name="Rain" parent="Effects" instance=ExtResource("8_pqidy")] @@ -85,6 +88,8 @@ visible = false transform = Transform3D(0.707107, 0.707107, 0, -0.707107, 0.707107, 0, 0, 0, 1, 0, 0.1, 0) visible = false +[node name="Ring Portal" parent="Effects" instance=ExtResource("13_ya4y5")] + [node name="Electricity" type="Node3D" parent="Effects"] visible = false @@ -113,6 +118,19 @@ theme_override_constants/margin_bottom = 10 custom_minimum_size = Vector2(200, 0) layout_mode = 2 +[node name="Label Camera Zoom" type="RichTextLabel" parent="CanvasLayer UI/SideBar/SideBar Menu/MarginContainer/VBoxContainer"] +layout_mode = 2 +bbcode_enabled = true +text = "[center]Camera Zoom" +fit_content = true + +[node name="HSlider Camera Zoom" type="HSlider" parent="CanvasLayer UI/SideBar/SideBar Menu/MarginContainer/VBoxContainer"] +layout_mode = 2 +min_value = 2.0 +max_value = 8.0 +step = 0.1 +value = 6.0 + [node name="ButtonFire" type="Button" parent="CanvasLayer UI/SideBar/SideBar Menu/MarginContainer/VBoxContainer"] unique_name_in_owner = true layout_mode = 2 @@ -193,6 +211,14 @@ toggle_mode = true button_group = ExtResource("13_k8na1") text = "Sparks" +[node name="ButtonRingPortal" 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 = "Ring Portal" + [node name="ToggleButton" type="TextureButton" parent="CanvasLayer UI/SideBar"] custom_minimum_size = Vector2(64, 2.08165e-12) layout_mode = 2 @@ -219,6 +245,7 @@ theme_override_colors/default_color = Color(1, 1, 1, 1) theme_override_font_sizes/normal_font_size = 24 bbcode_enabled = true +[connection signal="value_changed" from="CanvasLayer UI/SideBar/SideBar Menu/MarginContainer/VBoxContainer/HSlider Camera Zoom" to="." method="slider_camera_zoom_value_changed"] [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"] @@ -229,4 +256,5 @@ bbcode_enabled = true [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/SideBar Menu/MarginContainer/VBoxContainer/ButtonRingPortal" to="." method="updateVisibleEffects"] [connection signal="pressed" from="CanvasLayer UI/SideBar/ToggleButton" to="." method="toggleSideBar"] diff --git a/particles/particle-effects-scene.gd b/particles/particle-effects-scene.gd index f3b236f..1c424cf 100644 --- a/particles/particle-effects-scene.gd +++ b/particles/particle-effects-scene.gd @@ -4,6 +4,7 @@ extends Node3D @onready var buttonSmoke = %ButtonSmoke @onready var effectsContainer = %Effects @onready var sideBarMenu = $"CanvasLayer UI/SideBar/SideBar Menu" +@onready var camera = %Camera3D # Called when the node enters the scene tree for the first time. func _ready(): @@ -34,3 +35,7 @@ func toggleSideBar(): else: sideBarMenu.show() + + +func slider_camera_zoom_value_changed(value): + camera.size = 10 - value diff --git a/particles/ring_portal.tscn b/particles/ring_portal.tscn new file mode 100644 index 0000000..8d4e9d2 --- /dev/null +++ b/particles/ring_portal.tscn @@ -0,0 +1,139 @@ +[gd_scene load_steps=25 format=3 uid="uid://dxbwdhrcv17yk"] + +[ext_resource type="Texture2D" uid="uid://3co4nf76dimy" path="res://addons/kenney_particle_pack/light_03.png" id="1_doeqm"] +[ext_resource type="Texture2D" uid="uid://caxhytnpo4m8o" path="res://addons/kenney_particle_pack/twirl_03.png" id="2_rfyul"] +[ext_resource type="Texture2D" uid="uid://oniakpdqxpop" path="res://addons/kenney_particle_pack/star_09.png" id="3_cobuj"] + +[sub_resource type="Gradient" id="Gradient_q708y"] +offsets = PackedFloat32Array(0, 0.531353, 1) +colors = PackedColorArray(0, 0.388235, 1, 1, 1, 0, 1, 1, 0, 0.388235, 1, 1) + +[sub_resource type="GradientTexture1D" id="GradientTexture1D_pr6jd"] +gradient = SubResource("Gradient_q708y") + +[sub_resource type="Curve" id="Curve_lkuf0"] +_data = [Vector2(0, 0.987753), 0.0, 0.0, 0, 0, Vector2(0.498615, 0.868347), 0.0, 0.0, 0, 0, Vector2(1, 0.987753), 0.0, 0.0, 0, 0] +point_count = 3 + +[sub_resource type="CurveTexture" id="CurveTexture_cumia"] +curve = SubResource("Curve_lkuf0") + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_idoxc"] +particle_flag_rotate_y = true +radial_velocity_max = 2.08167e-14 +gravity = Vector3(2.08165e-12, 2.08165e-12, 2.08165e-12) +scale_curve = SubResource("CurveTexture_cumia") +color_ramp = SubResource("GradientTexture1D_pr6jd") + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ciliw"] +transparency = 1 +blend_mode = 1 +vertex_color_use_as_albedo = true +albedo_texture = ExtResource("1_doeqm") +emission = Color(1, 1, 1, 1) +emission_energy_multiplier = 0.0 +rim_enabled = true + +[sub_resource type="QuadMesh" id="QuadMesh_hy743"] +material = SubResource("StandardMaterial3D_ciliw") +orientation = 1 + +[sub_resource type="Curve" id="Curve_ptk1q"] +min_value = -360.0 +max_value = 360.0 +_data = [Vector2(0, -360), 0.0, 720.0, 0, 1, Vector2(1, 360), 720.0, 0.0, 1, 0] +point_count = 2 + +[sub_resource type="CurveTexture" id="CurveTexture_x3org"] +curve = SubResource("Curve_ptk1q") + +[sub_resource type="Gradient" id="Gradient_bm8tk"] +offsets = PackedFloat32Array(0, 0.524752, 1) +colors = PackedColorArray(1, 0.290196, 0, 1, 1, 1, 0, 1, 1, 0.290196, 0, 1) + +[sub_resource type="GradientTexture1D" id="GradientTexture1D_udo51"] +gradient = SubResource("Gradient_bm8tk") + +[sub_resource type="Curve" id="Curve_de6lf"] +_data = [Vector2(0, 0.222327), 0.0, 0.0, 0, 0, Vector2(0.357341, 0.500942), 0.0, 0.0, 0, 0, Vector2(1, 0.225389), 0.0, 0.0, 0, 0] +point_count = 3 + +[sub_resource type="CurveTexture" id="CurveTexture_h0khy"] +curve = SubResource("Curve_de6lf") + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_t36pa"] +particle_flag_rotate_y = true +angle_min = 1.0 +angle_max = 1.0 +angle_curve = SubResource("CurveTexture_x3org") +radial_velocity_max = 2.08167e-14 +gravity = Vector3(2.08165e-12, 2.08165e-12, 2.08165e-12) +color_ramp = SubResource("GradientTexture1D_udo51") +emission_curve = SubResource("CurveTexture_h0khy") +hue_variation_min = -0.2 +hue_variation_max = 0.2 + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_6p8b5"] +transparency = 1 +vertex_color_use_as_albedo = true +albedo_texture = ExtResource("2_rfyul") +emission = Color(1, 1, 1, 1) +emission_energy_multiplier = 0.0 +rim_enabled = true + +[sub_resource type="QuadMesh" id="QuadMesh_gs1vn"] +material = SubResource("StandardMaterial3D_6p8b5") +size = Vector2(0.9, 0.9) +orientation = 1 + +[sub_resource type="Curve" id="Curve_dk8fi"] +_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] +point_count = 2 + +[sub_resource type="CurveTexture" id="CurveTexture_nursa"] +curve = SubResource("Curve_dk8fi") + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_oxwdp"] +emission_shape = 1 +emission_sphere_radius = 0.4 +gravity = Vector3(2.08165e-12, 0.3, 2.08165e-12) +scale_curve = SubResource("CurveTexture_nursa") +hue_variation_min = -1.0 +hue_variation_max = 1.0 + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_2fbg6"] +transparency = 1 +vertex_color_use_as_albedo = true +albedo_texture = ExtResource("3_cobuj") +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_04k0d"] +material = SubResource("StandardMaterial3D_2fbg6") +size = Vector2(0.05, 0.05) + +[node name="Ring Portal" type="GPUParticles3D"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.08165e-12, 2.08165e-12, 2.08165e-12) +amount = 1 +lifetime = 5.0 +fixed_fps = 60 +process_material = SubResource("ParticleProcessMaterial_idoxc") +draw_pass_1 = SubResource("QuadMesh_hy743") + +[node name="Ring" type="GPUParticles3D" parent="."] +amount = 1 +lifetime = 5.0 +fixed_fps = 60 +process_material = SubResource("ParticleProcessMaterial_t36pa") +draw_pass_1 = SubResource("QuadMesh_gs1vn") + +[node name="Sparklings" type="GPUParticles3D" parent="."] +amount = 16 +lifetime = 3.0 +fixed_fps = 60 +process_material = SubResource("ParticleProcessMaterial_oxwdp") +draw_pass_1 = SubResource("QuadMesh_04k0d")