后处理特效 镜头拉近 摇晃 模糊 色移
@ -1,9 +1,10 @@
|
|||||||
[gd_resource type="ShaderMaterial" load_steps=3 format=3 uid="uid://tlhcll6fyp7q"]
|
[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="Shader" path="res://render/shader/effect_billboard.gdshader" id="1_jw6vt"]
|
||||||
[ext_resource type="Texture2D" uid="uid://bb0yfk0u4lqqn" path="res://render/texture/shape/flare.png" id="2_x6l5a"]
|
[ext_resource type="Texture2D" uid="uid://bb0yfk0u4lqqn" path="res://render/texture/particle/shape/flare.png" id="2_ax7mv"]
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
render_priority = 0
|
render_priority = 0
|
||||||
shader = ExtResource("1_jw6vt")
|
shader = ExtResource("1_jw6vt")
|
||||||
shader_parameter/tex_main = ExtResource("2_x6l5a")
|
shader_parameter/sheet_size = Vector2(1, 1)
|
||||||
|
shader_parameter/tex_main = ExtResource("2_ax7mv")
|
||||||
|
|||||||
@ -0,0 +1,34 @@
|
|||||||
|
shader_type canvas_item;
|
||||||
|
|
||||||
|
uniform float shift_strength : hint_range(0.0, 1.0);
|
||||||
|
uniform float blur_strength : hint_range(0.0, 1.0);
|
||||||
|
uniform float vignette_alpha : hint_range(0.0, 1.0);
|
||||||
|
uniform float vignette_inner : hint_range(0.0, 1.0) = 0.5;
|
||||||
|
uniform float vignette_outer : hint_range(0.0, 2.0) = 1.0;
|
||||||
|
|
||||||
|
void fragment() {
|
||||||
|
vec3 color = vec3(0);
|
||||||
|
|
||||||
|
//模糊+色移
|
||||||
|
float shift = 0.01 * shift_strength;
|
||||||
|
float blur = 0.01 * blur_strength;
|
||||||
|
vec2 direction = UV - vec2(0.5);
|
||||||
|
float f = 0.1;
|
||||||
|
color *= f;
|
||||||
|
for(int i=1; i < 10; i++) {
|
||||||
|
vec2 target_uv = UV - blur * direction * float(i);
|
||||||
|
vec3 target_color = vec3(0);
|
||||||
|
target_color.r = texture(TEXTURE, vec2(target_uv.x + shift, target_uv.y)).r;
|
||||||
|
target_color.g = texture(TEXTURE, target_uv).g;
|
||||||
|
target_color.b = texture(TEXTURE, vec2(target_uv.x - shift, target_uv.y)).b;
|
||||||
|
color += target_color * f;
|
||||||
|
}
|
||||||
|
|
||||||
|
//暗角
|
||||||
|
float x = abs(UV.r-.5)*2.0;
|
||||||
|
float y = abs(UV.g-.5)*2.0;
|
||||||
|
float q = 1.0-(1.0-sqrt(x*x+y*y)/vignette_outer)/(1.0-vignette_inner);
|
||||||
|
q = clamp(q*vignette_alpha,0.0,1.1);
|
||||||
|
color *= (1.0-q);
|
||||||
|
COLOR.rgb = color;
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 1021 B After Width: | Height: | Size: 1021 B |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 629 KiB After Width: | Height: | Size: 629 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 352 KiB After Width: | Height: | Size: 352 KiB |
|
Before Width: | Height: | Size: 255 KiB After Width: | Height: | Size: 255 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 7.2 KiB |
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://b0bmvub81xvmf"
|
||||||
|
path="res://.godot/imported/glow.png-c1c3cae4dab2d016ddc051279ee33301.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://render/texture/particle/shape/glow.png"
|
||||||
|
dest_files=["res://.godot/imported/glow.png-c1c3cae4dab2d016ddc051279ee33301.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
|
||||||
|
After Width: | Height: | Size: 62 KiB |
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://colhtjt8jon3v"
|
||||||
|
path="res://.godot/imported/smoke.png-34046474e6118af82d80752acc087514.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://render/texture/particle/shape/smoke.png"
|
||||||
|
dest_files=["res://.godot/imported/smoke.png-34046474e6118af82d80752acc087514.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
|
||||||
@ -1,7 +1,12 @@
|
|||||||
extends SubViewportContainer
|
extends SubViewportContainer
|
||||||
|
class_name ViewManager
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
|
Global.view_mgr = self
|
||||||
var camera = Global.camera_mgr as CameraManager
|
var camera = Global.camera_mgr as CameraManager
|
||||||
size = camera.stage_size
|
size = camera.stage_size
|
||||||
scale = camera.stage_scale
|
scale = camera.stage_scale
|
||||||
position.y = - camera.stage_offset_y
|
position.y = - camera.stage_offset_y
|
||||||
|
|
||||||
|
func set_post_processing(name:String,value:float):
|
||||||
|
material.set_shader_parameter(name,value)
|
||||||
|
|||||||