调整光效

master
chendian 1 year ago
parent beb01f0ea4
commit a20256cebd

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

@ -1,5 +1,5 @@
shader_type spatial;
render_mode depth_prepass_alpha,unshaded;
render_mode depth_prepass_alpha;
uniform sampler2D tex : source_color,filter_nearest;
uniform float flash_white;
@ -24,6 +24,7 @@ void fragment() {
if(col.a<0.5){discard;}
if(flash_white>0.0){
col.rgb = col.rgb * (flash_white + 1.0) * vec3(1,1,1);
EMISSION = col.rgb * 0.5;
}
ALBEDO = col.rgb;
ALPHA = 1.0;

@ -1,5 +1,4 @@
shader_type spatial;
render_mode unshaded;
uniform sampler2D tex_main : source_color;
@ -7,5 +6,5 @@ void fragment() {
vec4 col = texture(tex_main, UV);
ALBEDO = COLOR.rgb * col.r;
ALPHA = COLOR.a * col.r;
EMISSION = vec3(5.0,5.0,5.0);
EMISSION = COLOR.rgb;
}

@ -0,0 +1,22 @@
shader_type spatial;
render_mode blend_add,unshaded,depth_test_disabled;
uniform sampler2D noise;
uniform sampler2D tex_mask : source_color;
uniform float distortionView : hint_range(0.0, 0.3, 0.005) = 0.03;
uniform float speedView : hint_range(0.0, 1.0, 0.005) = 0.5;
uniform sampler2D screenTexture : hint_screen_texture;
void fragment()
{
vec4 col_mask = texture(tex_mask, UV);
float noiseValueX = (texture(noise, UV + (TIME * speedView)).r * 2.0) - 1.0; // Range: -1.0 to 1.0
float noiseValueY = (texture(noise, UV + (TIME * speedView)).r * 2.0) - 1.0; // Range: -1.0 to 1.0
vec2 noiseDistort = vec2(noiseValueX, noiseValueY) * distortionView * col_mask.r;;
vec3 distortedScreenTexture = vec3(texture(screenTexture, SCREEN_UV + noiseDistort).rgb);
ALBEDO = distortedScreenTexture;
ALPHA = col_mask.r * COLOR.a;
}

@ -12,5 +12,6 @@ shader_parameter/tex_gradient = ExtResource("2_kxo7s")
[resource]
material = SubResource("ShaderMaterial_od7xi")
size = 0.04
size = 0.03
section_length = 0.15
section_segments = 4

@ -12,4 +12,5 @@ shader_parameter/tex_gradient = ExtResource("2_juhic")
[resource]
material = SubResource("ShaderMaterial_bnn4j")
size = 0.04
size = 0.03
section_segments = 4

@ -13,3 +13,4 @@ shader_parameter/tex_gradient = ExtResource("2_5auki")
[resource]
material = SubResource("ShaderMaterial_k4bt0")
size = 0.1
section_segments = 4

Binary file not shown.

@ -0,0 +1,18 @@
[remap]
importer="MagicaVoxel.With.Extensions.To.Mesh"
type="Mesh"
uid="uid://cd3smnhcr7257"
path="res://.godot/imported/n_flower1.vox-1301f62d7d0dcd07b6ae652a7e3e57ba.mesh"
[deps]
source_file="res://resource/mesh_level/n_flower1.vox"
dest_files=["res://.godot/imported/n_flower1.vox-1301f62d7d0dcd07b6ae652a7e3e57ba.mesh"]
[params]
Scale=0.02
GreedyMeshGenerator=true
SnapToGround=false
FirstKeyframeOnly=true

@ -0,0 +1,18 @@
[remap]
importer="MagicaVoxel.With.Extensions.To.Mesh"
type="Mesh"
uid="uid://ceg2pppm13tcq"
path="res://.godot/imported/n_stone_path.vox-56d7f22717a90eecf159f9b753aab4a1.mesh"
[deps]
source_file="res://resource/mesh_level/n_stone_path.vox"
dest_files=["res://.godot/imported/n_stone_path.vox-56d7f22717a90eecf159f9b753aab4a1.mesh"]
[params]
Scale=0.02
GreedyMeshGenerator=true
SnapToGround=false
FirstKeyframeOnly=true

@ -0,0 +1,18 @@
[remap]
importer="MagicaVoxel.With.Extensions.To.Mesh"
type="Mesh"
uid="uid://b0fvoh82l42cw"
path="res://.godot/imported/n_stone_path1.vox-76d8f4517dcdeaf7a33bf7645dda9765.mesh"
[deps]
source_file="res://resource/mesh_level/n_stone_path1.vox"
dest_files=["res://.godot/imported/n_stone_path1.vox-76d8f4517dcdeaf7a33bf7645dda9765.mesh"]
[params]
Scale=0.02
GreedyMeshGenerator=true
SnapToGround=false
FirstKeyframeOnly=true

@ -0,0 +1,18 @@
[remap]
importer="MagicaVoxel.With.Extensions.To.Mesh"
type="Mesh"
uid="uid://4nppyw3eiy0q"
path="res://.godot/imported/n_stone_path2.vox-2a35713c00bb18d93a12781957483819.mesh"
[deps]
source_file="res://resource/mesh_level/n_stone_path2.vox"
dest_files=["res://.godot/imported/n_stone_path2.vox-2a35713c00bb18d93a12781957483819.mesh"]
[params]
Scale=0.02
GreedyMeshGenerator=true
SnapToGround=false
FirstKeyframeOnly=true

@ -0,0 +1,18 @@
[remap]
importer="MagicaVoxel.With.Extensions.To.Mesh"
type="Mesh"
uid="uid://d2m8rngv7wicv"
path="res://.godot/imported/n_stone_path3.vox-06d17b68621c2d00616f2149b6010d47.mesh"
[deps]
source_file="res://resource/mesh_level/n_stone_path3.vox"
dest_files=["res://.godot/imported/n_stone_path3.vox-06d17b68621c2d00616f2149b6010d47.mesh"]
[params]
Scale=0.02
GreedyMeshGenerator=true
SnapToGround=false
FirstKeyframeOnly=true

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -17,7 +17,7 @@ shader = ExtResource("4_ppovm")
shader_parameter/tex_main = ExtResource("5_ckrbk")
[sub_resource type="Curve" id="Curve_yx8ux"]
_data = [Vector2(0, 0.517052), 0.0, -0.517052, 0, 1, Vector2(1, 0), -0.517052, 0.0, 1, 0]
_data = [Vector2(0, 0.296703), 0.0, -0.296703, 0, 1, Vector2(1, 0), -0.296703, 0.0, 1, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_vgydt"]

@ -10,7 +10,7 @@ shader = ExtResource("4_riq1c")
shader_parameter/tex_main = ExtResource("5_feq6c")
[sub_resource type="Curve" id="Curve_ll1if"]
_data = [Vector2(0, 0.501218), 0.0, -0.501218, 0, 1, Vector2(1, 0), -0.501218, 0.0, 1, 0]
_data = [Vector2(0, 0.296703), 0.0, -0.296703, 0, 1, Vector2(1, 0), -0.296703, 0.0, 1, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_rq071"]

@ -1,4 +1,4 @@
[gd_scene load_steps=32 format=3 uid="uid://cdq8t46i51ur5"]
[gd_scene load_steps=43 format=3 uid="uid://cdq8t46i51ur5"]
[ext_resource type="Script" path="res://script/effect/particle.gd" id="1_oydbn"]
[ext_resource type="Shader" path="res://render/shader/particle.gdshader" id="2_j4418"]
@ -6,6 +6,9 @@
[ext_resource type="Texture2D" uid="uid://bslhqlcg8cw2l" path="res://render/texture/particle/shape/flare3.png" id="4_xpm5f"]
[ext_resource type="Texture2D" uid="uid://colhtjt8jon3v" path="res://render/texture/particle/shape/smoke.png" id="5_rp3hs"]
[ext_resource type="RibbonTrailMesh" uid="uid://cv0787wcswb6d" path="res://render/trail_mesh/flare_blunt.tres" id="6_j4o4n"]
[ext_resource type="Shader" path="res://render/shader/particle_shockwave.gdshader" id="7_frmt7"]
[ext_resource type="Texture2D" uid="uid://6c1yt0vihays" path="res://render/texture/common/common_noise.tres" id="8_fqumv"]
[ext_resource type="Texture2D" uid="uid://cq58273k05p4f" path="res://render/texture/particle/shape/circle1.png" id="9_mcr0a"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_dkmkb"]
render_priority = 0
@ -120,6 +123,43 @@ initial_velocity_min = 4.0
initial_velocity_max = 5.0
alpha_curve = SubResource("CurveTexture_wpjie")
[sub_resource type="ShaderMaterial" id="ShaderMaterial_j0rbf"]
render_priority = 0
shader = ExtResource("7_frmt7")
shader_parameter/distortionView = 0.03
shader_parameter/speedView = 0.5
shader_parameter/noise = ExtResource("8_fqumv")
shader_parameter/tex_mask = ExtResource("9_mcr0a")
[sub_resource type="Curve" id="Curve_3gyvw"]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(0.166154, 0.865408), -1.20613, -1.20613, 0, 0, Vector2(1, 0), 0.0806379, 0.0, 0, 0]
point_count = 3
[sub_resource type="CurveTexture" id="CurveTexture_3x8hj"]
curve = SubResource("Curve_3gyvw")
[sub_resource type="Gradient" id="Gradient_h5q87"]
offsets = PackedFloat32Array(0, 0.20202, 1)
colors = PackedColorArray(1, 1, 1, 1, 0.937017, 0.527629, 0.107744, 1, 0.929412, 0.470588, 0, 1)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_fjlbr"]
gradient = SubResource("Gradient_h5q87")
[sub_resource type="Curve" id="Curve_fp0wv"]
max_value = 4.0
_data = [Vector2(0, 0.758242), 0.0, 2.00769, 0, 0, Vector2(0.04, 1.50365), 0.0, 0.0, 0, 0, Vector2(1, 4), 0.0, 0.0, 0, 0]
point_count = 3
[sub_resource type="CurveTexture" id="CurveTexture_08ifa"]
curve = SubResource("Curve_fp0wv")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_kns0r"]
particle_flag_disable_z = true
gravity = Vector3(0, 0, 0)
scale_curve = SubResource("CurveTexture_08ifa")
color_ramp = SubResource("GradientTexture1D_fjlbr")
alpha_curve = SubResource("CurveTexture_3x8hj")
[node name="Particle" type="Node3D"]
script = ExtResource("1_oydbn")
@ -171,3 +211,16 @@ trail_enabled = true
trail_lifetime = 0.1
process_material = SubResource("ParticleProcessMaterial_5lomq")
draw_pass_1 = ExtResource("6_j4o4n")
[node name="Slash3" type="GPUParticles3D" parent="."]
layers = 512
material_override = SubResource("ShaderMaterial_j0rbf")
cast_shadow = 0
emitting = false
amount = 1
lifetime = 0.3
one_shot = true
fixed_fps = 60
local_coords = true
process_material = SubResource("ParticleProcessMaterial_kns0r")
draw_pass_1 = SubResource("QuadMesh_0j7av")

File diff suppressed because one or more lines are too long

@ -151,7 +151,7 @@ func refresh_mesh_library(path_list: Array, from_editor_tool: bool = false):
"h": item_shapes = default_shape_normal_half if not is_ground else default_shape_large_half
"s1": item_shapes = default_shape_normal_stair1 if not is_ground else default_shape_large_stair1
"s2": item_shapes = default_shape_normal_stair2 if not is_ground else default_shape_large_stair2
"c", "a": pass
"c", "a", "n": pass
_: item_shapes = [mesh.create_convex_shape(), Transform3D.IDENTITY]
if item_shapes:
mesh_library.set_item_shapes(mesh_id, item_shapes)

@ -293,9 +293,10 @@ func settle(from: int, to: int, dir: Vector2, attack: AttackCfg) -> HitResult:
character_to.add_buff("shake_x", 0.2, true)
#闪白
character_to.add_buff("flash_white", 0.1)
character_to.add_buff("flash_white", 0.05)
#卡帧
pause_time *= 0.6
if not is_bullet:
character_from.set_pause_time(pause_time)
character_to.set_pause_time(pause_time)

@ -16,7 +16,6 @@ class_name Effect
var rediness: Decal
var is_pause: bool
var is_right: bool
var temp_release_particle_list: Array[Variant] = []
func particle_list() -> Array[Variant]:
@ -70,10 +69,6 @@ func _process(delta) -> void:
var ret: Array[Variant] = particle_list()
for particle: Particle in ret:
particle.set_pause(is_pause)
if !is_pause:
for particle: Particle in temp_release_particle_list:
_release_effect(particle)
temp_release_particle_list.clear()
func cast_image(res: Resource, alpha: float):
@ -151,14 +146,12 @@ func _cast_particle(resource: Resource, is_attach: bool, offset: Vector3, scale:
new_particle.position = status.basic_offset
add_child(new_particle)
if !is_attach:
temp_release_particle_list.append(new_particle)
_release_effect(new_particle)
func release_effect():
for particle: Particle in particle_list():
_release_effect(particle)
temp_release_particle_list.clear()
func _release_effect(particle: Particle):
var pos: Vector3 = particle.get_global_position()

Loading…
Cancel
Save