受击特效优化

master
chendian 2 years ago
parent 69a9d5c981
commit 5ff48d18e4

@ -1,10 +0,0 @@
[gd_resource type="ShaderMaterial" load_steps=3 format=3 uid="uid://tlhcll6fyp7q"]
[ext_resource type="Shader" path="res://render/shader/effect_billboard.gdshader" id="1_jw6vt"]
[ext_resource type="Texture2D" uid="uid://bb0yfk0u4lqqn" path="res://render/texture/particle/shape/flare.png" id="2_ax7mv"]
[resource]
render_priority = 0
shader = ExtResource("1_jw6vt")
shader_parameter/sheet_size = Vector2(1, 1)
shader_parameter/tex_main = ExtResource("2_ax7mv")

@ -1,17 +0,0 @@
shader_type spatial;
render_mode blend_add,unshaded;
uniform sampler2D tex_main : source_color;
uniform vec2 sheet_size = vec2(1,1);
//void vertex() {
//vec3 billboard_offset = VERTEX;
//VERTEX.xz = normalize(INV_VIEW_MATRIX[0].xz) * billboard_offset.x + normalize(INV_VIEW_MATRIX[2].xz) * billboard_offset.z;
//VERTEX.y = billboard_offset.y;
//}
void fragment() {
vec4 col = texture(tex_main, UV);
ALBEDO = mix(col.rgb, COLOR.rgb, COLOR.a);
ALPHA = col.r;
}

@ -1,6 +1,6 @@
shader_type spatial;
render_mode unshaded;
render_mode blend_add,unshaded,depth_test_disabled;
uniform sampler2D noise;
uniform sampler2D tex_mask : source_color;
@ -19,4 +19,5 @@ void fragment()
vec3 distortedScreenTexture = vec3(texture(screenTexture, SCREEN_UV + noiseDistort).rgb);
ALBEDO = distortedScreenTexture;
ALPHA = col_mask.r;
}

@ -1,5 +1,5 @@
shader_type spatial;
render_mode blend_add,unshaded;
render_mode blend_add,unshaded,depth_test_disabled;
uniform sampler2D tex_main : source_color;
uniform sampler2D tex_noise : source_color;

@ -0,0 +1,19 @@
shader_type spatial;
render_mode blend_add,unshaded,depth_test_disabled;
uniform sampler2D tex_main : source_color;
uniform bool is_billboard;
void vertex() {
if (is_billboard){
vec3 billboard_offset = VERTEX;
VERTEX.xz = normalize(INV_VIEW_MATRIX[0].xz) * billboard_offset.x + normalize(INV_VIEW_MATRIX[2].xz) * billboard_offset.z;
VERTEX.y = billboard_offset.y;
}
}
void fragment() {
vec4 col = texture(tex_main, UV);
ALBEDO = COLOR.rgb * col.r;
ALPHA = COLOR.a * col.r;
}

@ -48,7 +48,7 @@ tracks/3/path = NodePath("Status:break_level")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0, 0.1, 0.8),
"times": PackedFloat32Array(0, 0.5, 0.8),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [0, 3, 4]

@ -2,7 +2,7 @@
[ext_resource type="PackedScene" uid="uid://8rcvw1vnjcf7" path="res://scene/character/character.tscn" id="1_pot50"]
[ext_resource type="Script" path="res://script/character/player/combo.gd" id="2_i44w8"]
[ext_resource type="SpriteFrames" uid="uid://dhfqj1dxldqao" path="res://resource/animation/character/hero01_long_skill01.aseprite" id="2_ln80n"]
[ext_resource type="SpriteFrames" uid="uid://cajgs8smbkjan" path="res://resource/animation/character/hero01_fist_skill01.aseprite" id="2_rubkv"]
[ext_resource type="Script" path="res://script/character/player/player_input.gd" id="3_n07go"]
[ext_resource type="Script" path="res://script/character/player/core.gd" id="3_rxdse"]
[ext_resource type="Script" path="res://script/character/player/player_info.gd" id="4_mi1lk"]
@ -12,8 +12,8 @@
[node name="View" parent="." index="2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.693056, 0)
sprite_frames = ExtResource("2_ln80n")
animation = &"long_skill01"
sprite_frames = ExtResource("2_rubkv")
animation = &"fist_air_skill01"
[node name="Combo" type="Node3D" parent="." index="8"]
unique_name_in_owner = true

@ -1,35 +1,99 @@
[gd_scene load_steps=6 format=3 uid="uid://io1yfgjm480t"]
[gd_scene load_steps=19 format=3 uid="uid://io1yfgjm480t"]
[ext_resource type="Script" path="res://script/effect/particle.gd" id="1_qxvm2"]
[ext_resource type="Material" uid="uid://tlhcll6fyp7q" path="res://render/material/effect_hit.tres" id="2_54a52"]
[ext_resource type="Material" uid="uid://bns2vfyf2qy6u" path="res://render/process_material/hit_normal.tres" id="3_1alqw"]
[ext_resource type="Shader" path="res://render/shader/particle.gdshader" id="2_hr443"]
[ext_resource type="Texture2D" uid="uid://bb0yfk0u4lqqn" path="res://render/texture/particle/shape/flare.png" id="3_c5vjp"]
[ext_resource type="Texture2D" uid="uid://colhtjt8jon3v" path="res://render/texture/particle/shape/smoke.png" id="5_loelc"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_dkmkb"]
render_priority = 0
shader = ExtResource("2_hr443")
shader_parameter/is_billboard = null
shader_parameter/tex_main = ExtResource("3_c5vjp")
[sub_resource type="Curve" id="Curve_n5hkj"]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(0.82266, 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_hdmmt"]
curve = SubResource("Curve_n5hkj")
[sub_resource type="Curve" id="Curve_2o6rl"]
max_value = 6.0
_data = [Vector2(0, 4.81319), 0.0, 9.63692, 0, 0, Vector2(0.123153, 6), 0.0, 0.0, 0, 0, Vector2(0.221675, 6), 0.0, 0.0, 0, 0, Vector2(1, 4.68132), 0.0, 0.0, 0, 0]
point_count = 4
[sub_resource type="CurveTexture" id="CurveTexture_5ce5r"]
curve = SubResource("Curve_2o6rl")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_acw2w"]
angle_min = -72.3
angle_max = -72.3
gravity = Vector3(0, 0, 0)
scale_curve = SubResource("CurveTexture_5ce5r")
color = Color(0.635294, 0.827451, 1, 1)
alpha_curve = SubResource("CurveTexture_hdmmt")
[sub_resource type="QuadMesh" id="QuadMesh_0j7av"]
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_pcbb8"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_vkw8i"]
render_priority = 0
shader = ExtResource("2_hr443")
shader_parameter/is_billboard = false
shader_parameter/tex_main = ExtResource("5_loelc")
[sub_resource type="Curve" id="Curve_didyq"]
_data = [Vector2(0, 0.32967), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_3pi6l"]
curve = SubResource("Curve_didyq")
[sub_resource type="Curve" id="Curve_6dnuy"]
max_value = 4.0
_data = [Vector2(0, 1.75824), 0.0, 0.0, 0, 0, Vector2(1, 2.76923), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_skg43"]
curve = SubResource("Curve_6dnuy")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_gjwvd"]
angle_min = 1.07288e-05
angle_max = 720.0
velocity_pivot = Vector3(0, 0, 1)
spread = 180.0
initial_velocity_max = 0.2
gravity = Vector3(0, 0, 0)
scale_curve = SubResource("CurveTexture_skg43")
color = Color(0.521569, 0.509804, 0.501961, 1)
alpha_curve = SubResource("CurveTexture_3pi6l")
[sub_resource type="QuadMesh" id="QuadMesh_0kefl"]
[node name="Particle" type="Node3D"]
script = ExtResource("1_qxvm2")
[node name="Slash" type="GPUParticles3D" parent="."]
material_override = ExtResource("2_54a52")
layers = 512
material_override = SubResource("ShaderMaterial_dkmkb")
cast_shadow = 0
emitting = false
amount = 1
lifetime = 0.25
lifetime = 0.15
one_shot = true
fixed_fps = 60
local_coords = true
process_material = ExtResource("3_1alqw")
process_material = SubResource("ParticleProcessMaterial_acw2w")
draw_pass_1 = SubResource("QuadMesh_0j7av")
[node name="Smoke" type="GPUParticles3D" parent="."]
visible = false
layers = 512
material_override = SubResource("ShaderMaterial_vkw8i")
cast_shadow = 0
emitting = false
amount = 1
lifetime = 0.25
fixed_fps = 60
local_coords = true
process_material = SubResource("ParticleProcessMaterial_pcbb8")
draw_pass_1 = SubResource("QuadMesh_0j7av")
amount = 2
lifetime = 2.0
one_shot = true
explosiveness = 1.0
process_material = SubResource("ParticleProcessMaterial_gjwvd")
draw_pass_1 = SubResource("QuadMesh_0kefl")

@ -160,7 +160,7 @@ func settle(hit_info:HitInfo) -> bool:
character_to.add_buff("hit_up",attack.hit_up_duration)
#受击特效
character_to.cast_particle(ResourceManager.particle_hit)
character_to.cast_particle(ResourceManager.particle_hit,false)
#抖动
character_to.add_buff("shake_x",0.2,true)

@ -93,4 +93,4 @@ func show_hit_text(value:String):SignalManager.character_hit_text.emit(id(),valu
func show_hit_damage(value:float):SignalManager.character_hit_damage.emit(id(),value)
func add_mp(value:float):battle.add_mp(value)
func set_target(target:int):set_status("target",target)
func cast_particle(resource:Resource):effect.cast_particle(resource)
func cast_particle(resource:Resource ,is_attach:bool):effect.cast_particle(resource,is_attach)

@ -58,7 +58,7 @@ func cast_corpse():cast_image(corpse)
func cast_attack_particle():_cast_attack_particle(true)
func cast_attack_particle_release():_cast_attack_particle(false)
func cast_particle(resource:Resource):_cast_particle(resource,false)
func cast_particle(resource:Resource ,is_attach:bool):_cast_particle(resource,is_attach)
func _cast_attack_particle(is_attach:bool):
if !status.skill_cfg:

Loading…
Cancel
Save