Create explosion GPUParticle system
parent
08c7d9ea12
commit
b396629e90
@ -0,0 +1,10 @@
|
||||
[gd_resource type="SphereMesh" load_steps=2 format=3 uid="uid://c1bemmgv6st52"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_mh4r4"]
|
||||
albedo_color = Color(1, 1, 0, 0.419608)
|
||||
emission_enabled = true
|
||||
emission = Color(1, 0, 0, 1)
|
||||
emission_energy_multiplier = 10.0
|
||||
|
||||
[resource]
|
||||
material = SubResource("StandardMaterial3D_mh4r4")
|
||||
@ -0,0 +1,68 @@
|
||||
[gd_scene load_steps=11 format=3 uid="uid://chkv84s8orhbr"]
|
||||
|
||||
[ext_resource type="SphereMesh" uid="uid://c1bemmgv6st52" path="res://Material/explosion.tres" id="1_6sgsn"]
|
||||
[ext_resource type="Script" path="res://Scripts/Explosion.cs" id="2_y6oxt"]
|
||||
|
||||
[sub_resource type="Curve" id="Curve_i7efe"]
|
||||
_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_xp5x6"]
|
||||
curve = SubResource("Curve_i7efe")
|
||||
|
||||
[sub_resource type="Curve" id="Curve_43f32"]
|
||||
_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_s7b1r"]
|
||||
curve = SubResource("Curve_43f32")
|
||||
|
||||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_ssaw8"]
|
||||
emission_shape = 1
|
||||
emission_sphere_radius = 1.0
|
||||
radial_velocity_min = 1.0
|
||||
radial_velocity_max = 2.0
|
||||
radial_velocity_curve = SubResource("CurveTexture_xp5x6")
|
||||
gravity = Vector3(0, 0, 0)
|
||||
scale_min = 0.01
|
||||
scale_max = 0.04
|
||||
scale_curve = SubResource("CurveTexture_s7b1r")
|
||||
turbulence_noise_strength = 0.5
|
||||
turbulence_influence_max = 0.2
|
||||
collision_mode = 2
|
||||
collision_use_scale = true
|
||||
sub_emitter_mode = 3
|
||||
sub_emitter_amount_at_collision = 32
|
||||
sub_emitter_keep_velocity = true
|
||||
|
||||
[sub_resource type="Curve" id="Curve_w41ea"]
|
||||
_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="StandardMaterial3D" id="StandardMaterial3D_0gt11"]
|
||||
albedo_color = Color(1, 1, 0, 1)
|
||||
albedo_texture_msdf = true
|
||||
emission_enabled = true
|
||||
emission = Color(1, 0, 0, 1)
|
||||
emission_energy_multiplier = 10.0
|
||||
use_particle_trails = true
|
||||
|
||||
[sub_resource type="RibbonTrailMesh" id="RibbonTrailMesh_gna8o"]
|
||||
material = SubResource("StandardMaterial3D_0gt11")
|
||||
size = 0.2
|
||||
curve = SubResource("Curve_w41ea")
|
||||
|
||||
[node name="Explosion" type="GPUParticles3D"]
|
||||
emitting = false
|
||||
amount = 100
|
||||
sub_emitter = NodePath(".")
|
||||
lifetime = 2.0
|
||||
one_shot = true
|
||||
explosiveness = 1.0
|
||||
trail_enabled = true
|
||||
trail_lifetime = 1.0
|
||||
process_material = SubResource("ParticleProcessMaterial_ssaw8")
|
||||
draw_passes = 2
|
||||
draw_pass_1 = ExtResource("1_6sgsn")
|
||||
draw_pass_2 = SubResource("RibbonTrailMesh_gna8o")
|
||||
script = ExtResource("2_y6oxt")
|
||||
@ -0,0 +1,8 @@
|
||||
using Godot;
|
||||
|
||||
public partial class Explosion : GpuParticles3D
|
||||
{
|
||||
public override void _Process(double delta) {
|
||||
if (!Emitting) QueueFree();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
shader_type particles;
|
||||
|
||||
void start() {
|
||||
// Called when a particle is spawned.
|
||||
}
|
||||
|
||||
void process() {
|
||||
// Called every frame on existing particles (according to the Fixed FPS property).
|
||||
}
|
||||
Loading…
Reference in New Issue