刀剑攻击特效优化,受击优化

master
chendian 11 months ago
parent eb890b7771
commit e2f8e9a105

@ -9,7 +9,6 @@ break_level = 2
stun_attack = 10.0
damage_type = 0
is_floating = false
is_hit_down = false
is_rebound = false
is_stop_self = true
is_throw_check = false

@ -9,7 +9,6 @@ break_level = 1
stun_attack = 10.0
damage_type = 0
is_floating = false
is_hit_down = false
is_rebound = false
is_stop_self = true
is_throw_check = false

@ -9,13 +9,12 @@ break_level = 2
stun_attack = 10.0
damage_type = 0
is_floating = false
is_hit_down = false
is_rebound = false
is_stop_self = true
is_throw_check = false
is_throw_end = false
hit_back_speed = 4.0
hit_up_speed = 2.0
hit_back_speed = 3.0
hit_up_speed = 1.5
hit_back_duration = 0.05
hit_up_duration = 0.05
pause_time = 0.02

@ -1,6 +1,7 @@
[gd_resource type="Resource" script_class="SkillWeaponCfg" load_steps=7 format=3 uid="uid://5ufjc1dso0y8"]
[gd_resource type="Resource" script_class="SkillWeaponCfg" load_steps=8 format=3 uid="uid://5ufjc1dso0y8"]
[ext_resource type="Resource" uid="uid://btg40rn2f36c2" path="res://config/attack/sharp_normal_hit_back.tres" id="1_7ai5j"]
[ext_resource type="Resource" uid="uid://d3mcp8sf6qbmd" path="res://config/attack/sharp_normal_hit.tres" id="1_rgi7a"]
[ext_resource type="Script" path="res://script/config/skill_weapon_cfg.gd" id="1_uaib7"]
[ext_resource type="Resource" uid="uid://cy3wwalxeyro0" path="res://config/weapon/long.tres" id="2_8uqiw"]
[ext_resource type="Resource" uid="uid://diedb7vw7eyxp" path="res://config/attack_box/box_mid.tres" id="2_j0l20"]
@ -16,7 +17,7 @@ skill_animation = ExtResource("2_ugt3f")
range = 0.0
free_lock = false
ignore_push = false
attack1 = ExtResource("1_7ai5j")
attack1 = ExtResource("1_rgi7a")
attack1_box = ExtResource("2_j0l20")
attack2 = ExtResource("1_7ai5j")
attack2_box = ExtResource("2_j0l20")
@ -25,6 +26,10 @@ stance_to = 3
break_level = 3
is_charging = false
mp_cost = 0
mp_sub_cost = false
warn_type = 0
with_stop = false
is_lock_x = true
refresh_animation = false
sprite_frames = ExtResource("3_sr2og")
animation_name = "long_attack03"

@ -0,0 +1,10 @@
[gd_resource type="ShaderMaterial" load_steps=3 format=3 uid="uid://cx6p4882iubaf"]
[ext_resource type="Shader" path="res://render/shader/fragment.gdshader" id="1_0msmq"]
[ext_resource type="Texture2D" uid="uid://bcrr12gbos636" path="res://render/texture/particle/shape/fragment1.png" id="2_stxp5"]
[resource]
render_priority = 0
shader = ExtResource("1_0msmq")
shader_parameter/is_shine = true
shader_parameter/tex_main = ExtResource("2_stxp5")

@ -4,7 +4,6 @@ render_mode blend_add,unshaded,depth_test_disabled,cull_disabled;
uniform sampler2D tex_main : source_color;
uniform sampler2D tex_noise : source_color;
uniform sampler2D tex_mask : source_color;
uniform sampler2D tex_mask2 : source_color;
uniform sampler2D tex_gradient : source_color;
uniform sampler2D screenTexture : hint_screen_texture;
@ -15,12 +14,6 @@ void fragment() {
vec4 col = (col_noise + col_main) * col_mask;
col = texture(tex_gradient, vec2(clamp(col.r,0.0,1.0),0.5));
//vec4 col_mask2 = texture(tex_mask2, UV);
//float noiseValueX = col_noise.r;
//float noiseValueY = col_noise.r;
//vec2 noiseDistort = vec2(noiseValueX, noiseValueY) * 0.1 * col_mask2.r;
//vec3 distortedScreenTexture = vec3(texture(screenTexture, SCREEN_UV + noiseDistort).rgb);
//
ALBEDO = col.rgb;
ALPHA = col_mask.r * COLOR.a;
}

@ -0,0 +1,19 @@
shader_type spatial;
render_mode unshaded,depth_test_disabled,cull_disabled;
uniform sampler2D tex_main : source_color;
uniform sampler2D tex_noise : source_color;
uniform sampler2D tex_mask : source_color;
uniform sampler2D tex_gradient : source_color;
uniform sampler2D screenTexture : hint_screen_texture;
void fragment() {
vec4 col_main = texture(tex_main, UV);
vec4 col_noise = texture(tex_noise, UV - 0.5 * vec2(mod(TIME, 2.0) - 1.0, 0));
vec4 col_mask = texture(tex_mask, UV);
vec4 col = (col_noise + col_main) * col_mask;
col = texture(tex_gradient, vec2(clamp(col.r,0.0,1.0),0.5));
ALBEDO = col.rgb;
ALPHA = col_mask.r * COLOR.a;
}

@ -1,10 +1,15 @@
shader_type spatial;
uniform sampler2D tex_main : source_color;
uniform bool is_shine;
void fragment() {
vec4 col = texture(tex_main, UV);
float shine = 1.0;
if(is_shine){
shine += texture(tex_main, UV).r * (2.0 + sin(TIME*2.0));
}
ALBEDO = COLOR.rgb * col.r;
ALPHA = COLOR.a * col.r;
EMISSION = COLOR.rgb;
EMISSION = COLOR.rgb * shine;
}

@ -1,5 +1,5 @@
shader_type spatial;
render_mode unshaded,particle_trails;
render_mode unshaded,particle_trails,cull_disabled;
uniform sampler2D tex_gradient : source_color;

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bt32dgn3mag0w"
path="res://.godot/imported/gradient5.png-e6f877853d0edd8f39ef16b73beeda32.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://render/texture/particle/gradient/gradient5.png"
dest_files=["res://.godot/imported/gradient5.png-e6f877853d0edd8f39ef16b73beeda32.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=0
compress/normal_map=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=false
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://hcpxvwtjhvag"
path="res://.godot/imported/mask11.png-6dbaf61e3702593361312f67dccf791b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://render/texture/particle/mask/mask11.png"
dest_files=["res://.godot/imported/mask11.png-6dbaf61e3702593361312f67dccf791b.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=0
compress/normal_map=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=false
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cjm6q6us375xm"
path="res://.godot/imported/mask12.png-5bdddbea0f1f26f38ff5865f1fee2dd5.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://render/texture/particle/mask/mask12.png"
dest_files=["res://.godot/imported/mask12.png-5bdddbea0f1f26f38ff5865f1fee2dd5.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=0
compress/normal_map=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=false
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b5nr3mq3u5tjn"
path="res://.godot/imported/mask13.png-f33290df74aa50ce0401311e62515569.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://render/texture/particle/mask/mask13.png"
dest_files=["res://.godot/imported/mask13.png-f33290df74aa50ce0401311e62515569.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=0
compress/normal_map=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=false
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c61nspskft0to"
path="res://.godot/imported/mask14.png-c0724a33ef162a976e58d3f78211ec2c.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://render/texture/particle/mask/mask14.png"
dest_files=["res://.godot/imported/mask14.png-c0724a33ef162a976e58d3f78211ec2c.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=0
compress/normal_map=2
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=false
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 20 KiB

@ -1,16 +1,14 @@
[gd_resource type="RibbonTrailMesh" load_steps=5 format=3 uid="uid://bs5hlmt5xvqfd"]
[gd_resource type="RibbonTrailMesh" load_steps=4 format=3 uid="uid://bs5hlmt5xvqfd"]
[ext_resource type="Shader" path="res://render/shader/trail.gdshader" id="1_mjqg8"]
[ext_resource type="Texture2D" uid="uid://4cxxxxdbbugc" path="res://render/texture/particle/gradient/gradient1.png" id="2_juhic"]
[ext_resource type="Texture2D" uid="uid://b0bmvub81xvmf" path="res://render/texture/particle/shape/glow1.png" id="3_jw1ov"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_bnn4j"]
render_priority = 0
shader = ExtResource("1_mjqg8")
shader_parameter/tex_main = ExtResource("3_jw1ov")
shader_parameter/tex_gradient = ExtResource("2_juhic")
[resource]
material = SubResource("ShaderMaterial_bnn4j")
size = 0.03
size = 0.02
section_segments = 4

@ -1,60 +1,140 @@
[gd_scene load_steps=18 format=3 uid="uid://b2h4pcmlii7dg"]
[gd_scene load_steps=35 format=3 uid="uid://b2h4pcmlii7dg"]
[ext_resource type="Script" path="res://script/effect/particle.gd" id="1_fx8ev"]
[ext_resource type="Shader" path="res://render/shader/effect_slash.gdshader" id="2_a0jwb"]
[ext_resource type="Texture2D" uid="uid://4cxxxxdbbugc" path="res://render/texture/particle/gradient/gradient1.png" id="3_16hna"]
[ext_resource type="Texture2D" uid="uid://c4byf37he3mjt" path="res://render/texture/particle/noise/noise1.png" id="3_fvsr3"]
[ext_resource type="ArrayMesh" uid="uid://dq207a0waxk0j" path="res://render/mesh/slash1.obj" id="3_idjnm"]
[ext_resource type="Texture2D" uid="uid://csjm7d1tg6b50" path="res://render/texture/particle/mask/mask6.png" id="4_wvohg"]
[ext_resource type="Texture2D" uid="uid://c1e2fcr0nucku" path="res://render/texture/particle/mask/mask9.png" id="5_n15k1"]
[ext_resource type="Texture2D" uid="uid://hcpxvwtjhvag" path="res://render/texture/particle/mask/mask11.png" id="5_22kwb"]
[ext_resource type="Texture2D" uid="uid://dd3e7ol8qa5eq" path="res://render/texture/particle/noise/noise2.png" id="5_ymh7m"]
[ext_resource type="Texture2D" uid="uid://ddrm1reu30eux" path="res://render/texture/common/common_emission.tres" id="8_e30fx"]
[ext_resource type="Shader" path="res://render/shader/effect_slash_dark.gdshader" id="8_kx83u"]
[ext_resource type="Texture2D" uid="uid://bt32dgn3mag0w" path="res://render/texture/particle/gradient/gradient5.png" id="8_nsb82"]
[ext_resource type="RibbonTrailMesh" uid="uid://bs5hlmt5xvqfd" path="res://render/trail_mesh/flare_sharp.tres" id="9_0e33x"]
[ext_resource type="Texture2D" uid="uid://ciusodtprwghg" path="res://render/texture/particle/gradient/gradient4.png" id="9_b0p13"]
[ext_resource type="Texture2D" uid="uid://b5nr3mq3u5tjn" path="res://render/texture/particle/mask/mask13.png" id="9_gj8ht"]
[ext_resource type="Texture2D" uid="uid://c61nspskft0to" path="res://render/texture/particle/mask/mask14.png" id="12_grbpp"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_hupcc"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_q8746"]
render_priority = 0
shader = ExtResource("2_a0jwb")
shader_parameter/tex_main = ExtResource("3_fvsr3")
shader_parameter/tex_noise = ExtResource("5_ymh7m")
shader_parameter/tex_mask = ExtResource("4_wvohg")
shader_parameter/tex_mask2 = ExtResource("5_n15k1")
shader_parameter/tex_mask = ExtResource("9_gj8ht")
shader_parameter/tex_gradient = ExtResource("3_16hna")
[sub_resource type="Curve" id="Curve_7oqkb"]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(0.370536, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
[sub_resource type="Curve" id="Curve_0f46c"]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(0.8, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 3
metadata/_snap_enabled = true
[sub_resource type="CurveTexture" id="CurveTexture_n6ite"]
curve = SubResource("Curve_0f46c")
[sub_resource type="Curve" id="Curve_injip"]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 1, Vector2(0.8, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), -5.0, 0.0, 1, 0]
point_count = 3
metadata/_snap_enabled = true
[sub_resource type="CurveTexture" id="CurveTexture_eepmy"]
curve = SubResource("Curve_injip")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_eppsm"]
particle_flag_rotate_y = true
angle_min = 180.0
angle_max = 180.0
angular_velocity_min = -720.0
angular_velocity_max = -720.0
gravity = Vector3(0, 0, 0)
alpha_curve = SubResource("CurveTexture_n6ite")
emission_curve = SubResource("CurveTexture_eepmy")
[sub_resource type="ShaderMaterial" id="ShaderMaterial_hupcc"]
render_priority = 0
shader = ExtResource("2_a0jwb")
shader_parameter/tex_main = ExtResource("3_fvsr3")
shader_parameter/tex_noise = ExtResource("5_ymh7m")
shader_parameter/tex_mask = ExtResource("5_22kwb")
shader_parameter/tex_gradient = ExtResource("8_nsb82")
[sub_resource type="Curve" id="Curve_avkhe"]
_data = [Vector2(0, 0.1), 0.0, 0.0, 0, 0, Vector2(0.8, 0.1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 3
metadata/_snap_enabled = true
[sub_resource type="CurveTexture" id="CurveTexture_fa6y5"]
curve = SubResource("Curve_7oqkb")
[sub_resource type="CurveTexture" id="CurveTexture_kne6w"]
curve = SubResource("Curve_avkhe")
[sub_resource type="Curve" id="Curve_wcls6"]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 1, Vector2(0.8, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), -5.0, 0.0, 1, 0]
point_count = 3
metadata/_snap_enabled = true
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_m0ar0"]
[sub_resource type="CurveTexture" id="CurveTexture_wahpj"]
curve = SubResource("Curve_wcls6")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_g33uw"]
particle_flag_rotate_y = true
angle_min = 180.0
angle_max = 180.0
angular_velocity_min = -720.0
angular_velocity_max = -720.0
gravity = Vector3(0, 0, 0)
alpha_curve = SubResource("CurveTexture_fa6y5")
emission_curve = ExtResource("8_e30fx")
alpha_curve = SubResource("CurveTexture_kne6w")
emission_curve = SubResource("CurveTexture_wahpj")
[sub_resource type="Curve" id="Curve_a8a1y"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_uh70h"]
render_priority = 0
shader = ExtResource("8_kx83u")
shader_parameter/tex_main = ExtResource("3_fvsr3")
shader_parameter/tex_noise = ExtResource("5_ymh7m")
shader_parameter/tex_mask = ExtResource("12_grbpp")
shader_parameter/tex_gradient = ExtResource("9_b0p13")
[sub_resource type="Curve" id="Curve_ssudk"]
_data = [Vector2(0, 0.2), 0.0, 0.0, 0, 0, Vector2(0.8, 0.2), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 3
metadata/_snap_enabled = true
[sub_resource type="CurveTexture" id="CurveTexture_nob8g"]
curve = SubResource("Curve_ssudk")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_k158j"]
particle_flag_rotate_y = true
angle_min = 180.0
angle_max = 180.0
angular_velocity_min = -720.0
angular_velocity_max = -720.0
gravity = Vector3(0, 0, 0)
alpha_curve = SubResource("CurveTexture_nob8g")
[sub_resource type="Curve" id="Curve_oytdv"]
_data = [Vector2(0, 0.538462), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_wpjie"]
curve = SubResource("Curve_a8a1y")
[sub_resource type="CurveTexture" id="CurveTexture_h11yj"]
curve = SubResource("Curve_oytdv")
[sub_resource type="Curve" id="Curve_uuda5"]
_data = [Vector2(0, 1), 0.0, -7.39098e-07, 0, 0, Vector2(0.1, 0.1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 3
metadata/_snap_enabled = true
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_rewyi"]
[sub_resource type="CurveTexture" id="CurveTexture_eqt5p"]
curve = SubResource("Curve_uuda5")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_228c5"]
emission_shape = 6
emission_ring_axis = Vector3(0, 1, 0)
emission_ring_height = 0.0
emission_ring_radius = 1.0
emission_ring_inner_radius = 0.9
direction = Vector3(0, 1, 1)
radial_velocity_min = 3.99998
emission_ring_height = 0.2
emission_ring_radius = 1.25
emission_ring_inner_radius = 1.0
radial_velocity_min = 2.99998
radial_velocity_max = 3.99998
radial_velocity_curve = SubResource("CurveTexture_eqt5p")
gravity = Vector3(0, 0, 0)
alpha_curve = SubResource("CurveTexture_wpjie")
alpha_curve = SubResource("CurveTexture_h11yj")
turbulence_enabled = true
turbulence_influence_max = 0.5
[node name="Particle" type="Node3D"]
script = ExtResource("1_fx8ev")
@ -62,6 +142,22 @@ script = ExtResource("1_fx8ev")
[node name="Slash" type="GPUParticles3D" parent="."]
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
layers = 512
material_override = SubResource("ShaderMaterial_q8746")
cast_shadow = 0
gi_mode = 0
emitting = false
amount = 1
lifetime = 0.2
one_shot = true
speed_scale = 2.5
fixed_fps = 60
local_coords = true
process_material = SubResource("ParticleProcessMaterial_eppsm")
draw_pass_1 = ExtResource("3_idjnm")
[node name="SlashAir" type="GPUParticles3D" parent="."]
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
layers = 512
material_override = SubResource("ShaderMaterial_hupcc")
cast_shadow = 0
gi_mode = 0
@ -72,17 +168,32 @@ one_shot = true
speed_scale = 1.8
fixed_fps = 60
local_coords = true
process_material = SubResource("ParticleProcessMaterial_m0ar0")
process_material = SubResource("ParticleProcessMaterial_g33uw")
draw_pass_1 = ExtResource("3_idjnm")
[node name="SlashDark" type="GPUParticles3D" parent="."]
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
layers = 512
material_override = SubResource("ShaderMaterial_uh70h")
cast_shadow = 0
gi_mode = 0
emitting = false
amount = 1
lifetime = 0.25
one_shot = true
speed_scale = 1.8
fixed_fps = 60
local_coords = true
process_material = SubResource("ParticleProcessMaterial_k158j")
draw_pass_1 = ExtResource("3_idjnm")
[node name="Flare" type="GPUParticles3D" parent="."]
emitting = false
amount = 10
lifetime = 0.2
amount = 40
lifetime = 0.8
one_shot = true
explosiveness = 1.0
local_coords = true
trail_enabled = true
trail_lifetime = 0.1
process_material = SubResource("ParticleProcessMaterial_rewyi")
process_material = SubResource("ParticleProcessMaterial_228c5")
draw_pass_1 = ExtResource("9_0e33x")

@ -0,0 +1,88 @@
[gd_scene load_steps=18 format=3 uid="uid://cp5eaiqn5u2tu"]
[ext_resource type="Script" path="res://script/effect/particle.gd" id="1_xld4w"]
[ext_resource type="Shader" path="res://render/shader/effect_slash.gdshader" id="2_x0g1q"]
[ext_resource type="Texture2D" uid="uid://4cxxxxdbbugc" path="res://render/texture/particle/gradient/gradient1.png" id="3_poysl"]
[ext_resource type="Texture2D" uid="uid://c4byf37he3mjt" path="res://render/texture/particle/noise/noise1.png" id="4_do65m"]
[ext_resource type="Texture2D" uid="uid://csjm7d1tg6b50" path="res://render/texture/particle/mask/mask6.png" id="5_k70ui"]
[ext_resource type="Texture2D" uid="uid://c1e2fcr0nucku" path="res://render/texture/particle/mask/mask9.png" id="6_s00va"]
[ext_resource type="Texture2D" uid="uid://dd3e7ol8qa5eq" path="res://render/texture/particle/noise/noise2.png" id="7_fcone"]
[ext_resource type="Texture2D" uid="uid://ddrm1reu30eux" path="res://render/texture/common/common_emission.tres" id="8_nyomb"]
[ext_resource type="ArrayMesh" uid="uid://dq207a0waxk0j" path="res://render/mesh/slash1.obj" id="9_p4cf0"]
[ext_resource type="RibbonTrailMesh" uid="uid://bs5hlmt5xvqfd" path="res://render/trail_mesh/flare_sharp.tres" id="10_ca10q"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_hupcc"]
render_priority = 0
shader = ExtResource("2_x0g1q")
shader_parameter/tex_main = ExtResource("4_do65m")
shader_parameter/tex_noise = ExtResource("7_fcone")
shader_parameter/tex_mask = ExtResource("5_k70ui")
shader_parameter/tex_mask2 = ExtResource("6_s00va")
shader_parameter/tex_gradient = ExtResource("3_poysl")
[sub_resource type="Curve" id="Curve_7oqkb"]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(0.370536, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 3
[sub_resource type="CurveTexture" id="CurveTexture_fa6y5"]
curve = SubResource("Curve_7oqkb")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_m0ar0"]
particle_flag_rotate_y = true
angle_min = 180.0
angle_max = 180.0
angular_velocity_min = -720.0
angular_velocity_max = -720.0
gravity = Vector3(0, 0, 0)
alpha_curve = SubResource("CurveTexture_fa6y5")
emission_curve = ExtResource("8_nyomb")
[sub_resource type="Curve" id="Curve_a8a1y"]
_data = [Vector2(0, 0.538462), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_wpjie"]
curve = SubResource("Curve_a8a1y")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_rewyi"]
emission_shape = 6
emission_ring_axis = Vector3(0, 1, 0)
emission_ring_height = 0.0
emission_ring_radius = 1.0
emission_ring_inner_radius = 0.9
direction = Vector3(0, 1, 1)
radial_velocity_min = 3.99998
radial_velocity_max = 3.99998
gravity = Vector3(0, 0, 0)
alpha_curve = SubResource("CurveTexture_wpjie")
[node name="Particle" type="Node3D"]
script = ExtResource("1_xld4w")
[node name="Slash" type="GPUParticles3D" parent="."]
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
layers = 512
material_override = SubResource("ShaderMaterial_hupcc")
cast_shadow = 0
gi_mode = 0
emitting = false
amount = 1
lifetime = 0.25
one_shot = true
speed_scale = 1.8
fixed_fps = 60
local_coords = true
process_material = SubResource("ParticleProcessMaterial_m0ar0")
draw_pass_1 = ExtResource("9_p4cf0")
[node name="Flare" type="GPUParticles3D" parent="."]
emitting = false
amount = 10
lifetime = 0.2
one_shot = true
explosiveness = 1.0
local_coords = true
trail_enabled = true
trail_lifetime = 0.1
process_material = SubResource("ParticleProcessMaterial_rewyi")
draw_pass_1 = ExtResource("10_ca10q")

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://dj04l4oge27f0"]
[gd_scene load_steps=2 format=3 uid="uid://l2swlcnrse1q"]
[ext_resource type="PackedScene" uid="uid://b2h4pcmlii7dg" path="res://scene/effect/particle/_particle_slash1.tscn" id="1_078jk"]
[ext_resource type="PackedScene" uid="uid://b2h4pcmlii7dg" path="res://scene/effect/particle/_particle_slash1.tscn" id="1_idxjg"]
[node name="Particle" instance=ExtResource("1_078jk")]
transform = Transform3D(1, 0, 0, 0, 0.5, 0.433012, 0, -0.866026, 0.25, 0, 0, 0)
[node name="Particle" instance=ExtResource("1_idxjg")]
transform = Transform3D(1.1, 0, 0, 0, -0.5, 0.433013, 0, -0.866025, -0.25, 0, 0, 0)

@ -3,4 +3,4 @@
[ext_resource type="PackedScene" uid="uid://b2h4pcmlii7dg" path="res://scene/effect/particle/_particle_slash1.tscn" id="1_5b0hk"]
[node name="Particle" instance=ExtResource("1_5b0hk")]
transform = Transform3D(1.6, 0, 0, 0, 0.707107, -0.353553, 0, 0.707107, 0.353553, 0, 0, 0)
transform = Transform3D(1.2, 0, 0, 0, 0.707107, -0.353553, 0, 0.707107, 0.353553, 0, 0, 0)

@ -12,8 +12,6 @@ radius = 0.1
collision_layer = 256
script = ExtResource("1_cgwed")
sub = ExtResource("2_2xoel")
velocity_min = Vector2(1, 2)
velocity_max = Vector2(2, 4)
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("SphereShape3D_1r022")

@ -8,11 +8,10 @@
radius = 0.1
[node name="Fragment" type="CharacterBody3D"]
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0)
transform = Transform3D(0.6, 0, 0, 0, 0.6, 0, 0, 0, 0.6, 0, 0, 0)
collision_layer = 256
script = ExtResource("1_14ie3")
velocity_min = Vector2(1, 2)
velocity_max = Vector2(2, 4)
alive_time = 1.5
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("SphereShape3D_1r022")

@ -10,6 +10,5 @@ script = ExtResource("1_mj544")
[node name="ParticleSubEmitter" type="Node3D" parent="."]
script = ExtResource("2_k8mlr")
sub = ExtResource("3_lryd5")
count_min = 2
count_max = 3
lifetime = 0.1

@ -34,8 +34,6 @@ turbulence_influence_over_life = SubResource("CurveTexture_apkn5")
script = ExtResource("1_m0soh")
[node name="Flare" type="GPUParticles3D" parent="."]
emitting = false
one_shot = true
explosiveness = 1.0
trail_enabled = true
trail_lifetime = 0.1

@ -1,7 +1,7 @@
[gd_scene load_steps=6 format=3 uid="uid://cjvrn0m6dnkwm"]
[ext_resource type="Script" path="res://script/item/pt.gd" id="1_7fo1j"]
[ext_resource type="Material" uid="uid://b3mpocbc8svx2" path="res://render/material/fragment.tres" id="2_rgdfq"]
[ext_resource type="Material" uid="uid://cx6p4882iubaf" path="res://render/material/fragment_shine.tres" id="2_4qu1f"]
[ext_resource type="Texture2D" uid="uid://bcrr12gbos636" path="res://render/texture/particle/shape/fragment1.png" id="3_slgv7"]
[sub_resource type="Curve" id="Curve_q38s7"]
@ -18,8 +18,8 @@ collision_layer = 256
linear_damp = 0.1
script = ExtResource("1_7fo1j")
follow_speed_curve = SubResource("Curve_q38s7")
color_hp = Color(0.94902, 0.494118, 0.498039, 1)
color_mp = Color(0.286275, 0.701961, 0.854902, 1)
color_hp = Color(0.295216, 0.0607715, 0.0805138, 1)
color_mp = Color(0.0391896, 0.195944, 0.250799, 1)
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
unique_name_in_owner = true
@ -27,7 +27,7 @@ shape = SubResource("BoxShape3D_4u1o3")
[node name="Sprite3D" type="Sprite3D" parent="."]
unique_name_in_owner = true
material_override = ExtResource("2_rgdfq")
material_override = ExtResource("2_4qu1f")
pixel_size = 0.004
texture = ExtResource("3_slgv7")
hframes = 2

@ -3,14 +3,17 @@ class_name Fragment
@export var sub: PackedScene
@export var gravity_scale: float = 1.0
@export var velocity_min: Vector2 = Vector2.ONE
@export var velocity_max: Vector2 = Vector2.ONE
@export var alive_time: float = 1.0
var velocity_min: Vector2 = Vector2(0, 2)
var velocity_max: Vector2 = Vector2(2, 4)
@onready var sprite3D: Sprite3D = %Sprite3D as Sprite3D
var gravity = ProjectSettings.get_setting("physics/3d/default_gravity")
var frame_rate: float = 0.1
var frame_time: float = 0
var fade_out_treshold: float = 0.5
func _ready():
@ -18,23 +21,32 @@ func _ready():
velocity.x = dir.x
velocity.z = dir.y
velocity.y = randf_range(velocity_min.y, velocity_max.y)
alive_time += randf_range(0, 0.5)
func _process(delta: float) -> void:
velocity.y -= gravity * gravity_scale * delta
var frame_count: int = sprite3D.hframes * sprite3D.vframes
var frame_time_all: float = frame_rate * frame_count
frame_time += delta
sprite3D.frame = int(frame_time / frame_rate) % frame_count
frame_time = fmod(frame_time, frame_time_all)
if velocity.length() > 0.01:
var frame_count: int = sprite3D.hframes * sprite3D.vframes
var frame_time_all: float = frame_rate * frame_count
frame_time += delta
sprite3D.frame = int(frame_time / frame_rate) % frame_count
frame_time = fmod(frame_time, frame_time_all)
move_and_slide()
var collision_count: int = get_slide_collision_count()
if collision_count > 0:
var normal: Vector3 = Vector3.ZERO
for i in collision_count:
var collision: KinematicCollision3D = get_slide_collision(i)
normal += collision.get_normal()
normal = normal.normalized()
if sub:
var normal: Vector3 = Vector3.ZERO
for i in collision_count:
var collision: KinematicCollision3D = get_slide_collision(i)
normal += collision.get_normal()
normal = normal.normalized()
Global.effect_mgr.cast_particle(sub, global_position, normal)
queue_free()
#反弹
velocity = (velocity - normal * velocity.dot(normal)) * 0.8
alive_time -= delta
if alive_time < fade_out_treshold:
sprite3D.modulate.a = alive_time / fade_out_treshold
if alive_time <= 0:
queue_free()

@ -7,8 +7,8 @@ class_name PT
var type: Enum.EPtType
var value: int = 1
var velocity_min: Vector2 = Vector2.RIGHT *1
var velocity_max: Vector2 = Vector2.ONE *4
var velocity_min: Vector2 = Vector2(0, 3)
var velocity_max: Vector2 = Vector2(3, 6)
var born_time: float = 0.5 #生成时间,无法收集
var alive_time: float = 10.0 #存活时间
var is_born: bool = false
@ -25,25 +25,25 @@ var frame_time: float = 0
func _ready():
var dir: Vector2 = Util.angle_dir(randf_range(0, 360)) * randf_range(velocity_min.x, velocity_max.x)
var velocity: Vector3 = Vector3(dir.x, randf_range(velocity_min.y, velocity_max.y), dir.y)
var velocity_xz: Vector2 = Util.angle_dir(randf_range(0, 360)) * randf_range(velocity_min.x, velocity_max.x)
var velocity: Vector3 = Vector3(velocity_xz.x, randf_range(velocity_min.y, velocity_max.y), velocity_xz.y)
set_linear_velocity(velocity)
func _process(delta: float) -> void:
if not is_init:
var scale: Vector3 = Vector3.ONE * sqrt(sqrt(sqrt(value)))
sprite3D.scale = scale
collision_shape.scale = scale
var color: Color = Color.WHITE
var pt_scale: Vector3 = Vector3.ONE * sqrt(sqrt(sqrt(value)))
sprite3D.scale = pt_scale
collision_shape.scale = pt_scale
var color: Color = Color.WHITE
match type:
Enum.EPtType.HP: color = color_hp
Enum.EPtType.MP: color = color_mp
_: pass
#随机色移
color.r += randf_range(0, 0.3)
color.g += randf_range(0, 0.3)
color.b += randf_range(0, 0.3)
color.r += randf_range(0, 0.1)
color.g += randf_range(0, 0.1)
color.b += randf_range(0, 0.1)
color.clamp()
sprite3D.modulate = color
sprite3D.rotation.z = randf_range(0, 360)

Loading…
Cancel
Save