通用攻击特效 - 环形空间扭曲效果

master
chendian 2 years ago
parent 188b18b8b1
commit 514c4e2cc1

@ -1,13 +1,13 @@
[gd_resource type="ShaderMaterial" load_steps=5 format=3 uid="uid://bkbuvtya3uk3x"]
[gd_resource type="ShaderMaterial" load_steps=4 format=3 uid="uid://bkbuvtya3uk3x"]
[ext_resource type="Shader" path="res://render/shader/effect_slash.gdshader" id="1_igfou"]
[ext_resource type="Texture2D" uid="uid://dd3e7ol8qa5eq" path="res://render/texture/noise/noise2.png" id="2_hohok"]
[ext_resource type="Texture2D" uid="uid://cksxjvafx2skm" path="res://render/texture/mask/mask5.png" id="3_mbqrk"]
[ext_resource type="Shader" path="res://render/shader/effect_skew1.gdshader" id="1_dcuof"]
[ext_resource type="Texture2D" uid="uid://csjm7d1tg6b50" path="res://render/texture/mask/mask6.png" id="3_p44lv"]
[ext_resource type="Texture2D" uid="uid://c4byf37he3mjt" path="res://render/texture/noise/noise1.png" id="4_vjpnf"]
[resource]
render_priority = 0
shader = ExtResource("1_igfou")
shader_parameter/tex_main = ExtResource("2_hohok")
shader_parameter/tex_noise = ExtResource("4_vjpnf")
shader_parameter/tex_mask = ExtResource("3_mbqrk")
shader = ExtResource("1_dcuof")
shader_parameter/distortionView = 0.06
shader_parameter/speedView = 0.5
shader_parameter/noise = ExtResource("4_vjpnf")
shader_parameter/tex_mask = ExtResource("3_p44lv")

@ -1,16 +1,22 @@
shader_type spatial;
render_mode blend_add,unshaded;
uniform sampler2D tex_noise : source_color;
render_mode unshaded;
uniform sampler2D noise;
uniform sampler2D tex_mask : source_color;
uniform sampler2D screen_texture : hint_screen_texture, repeat_disable, filter_nearest;
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() {
void fragment()
{
vec2 uv2 = UV - 1.0 * vec2(mod(TIME, 2.0) - 1.0, 0);
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_screen = textureLod(screen_texture, SCREEN_UV, 0.0);
vec4 col = col_screen;
ALBEDO = col.rgb;
ALPHA = col_mask.r;
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;
}

@ -6,7 +6,6 @@ uniform sampler2D tex_noise : source_color;
uniform sampler2D tex_mask : source_color;
void fragment() {
vec2 uv2 = UV - 1.0 * vec2(mod(TIME, 2.0) - 1.0, 0);
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);

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://csjm7d1tg6b50"
path="res://.godot/imported/mask6.png-bfc308add2dfa12fcdf95a205d0d505a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://render/texture/mask/mask6.png"
dest_files=["res://.godot/imported/mask6.png-bfc308add2dfa12fcdf95a205d0d505a.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

@ -4,3 +4,6 @@
[node name="Particle" instance=ExtResource("1_qyqjx")]
transform = Transform3D(1.5, 0, 0, 0, 1, 0, 0, 0, 1.2, 0, 0, 0)
[node name="Skew1" parent="." index="1"]
one_shot = false

@ -10,6 +10,7 @@
script = ExtResource("1_fx8ev")
[node name="Slash" type="GPUParticles3D" parent="."]
layers = 512
material_override = ExtResource("1_6c80n")
cast_shadow = 0
gi_mode = 0
@ -24,6 +25,8 @@ process_material = ExtResource("2_eq67i")
draw_pass_1 = ExtResource("3_idjnm")
[node name="Skew1" type="GPUParticles3D" parent="."]
transform = Transform3D(0.99, 0, 0, 0, 0.99, 0, 0, 0, 0.99, 0, 0, 0)
layers = 512
material_override = ExtResource("5_qg8g8")
cast_shadow = 0
gi_mode = 0

Loading…
Cancel
Save