mirror of
https://github.com/marinho/godot-visual-effects.git
synced 2025-09-19 12:16:22 +08:00
A mirage?
This commit is contained in:
14
camera-effects/mirage.gdshader
Normal file
14
camera-effects/mirage.gdshader
Normal file
@ -0,0 +1,14 @@
|
||||
shader_type canvas_item;
|
||||
|
||||
uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;
|
||||
uniform float blur_amount : hint_range(-2.0, 10.0) = .2;
|
||||
uniform float strength : hint_range(0.0, 1.0) = .01;
|
||||
|
||||
void fragment() {
|
||||
float yFromCenter = 1.0 - abs(UV.y - .5);
|
||||
float blurImpact = blur_amount * yFromCenter;
|
||||
vec2 uv = vec2(SCREEN_UV.x + sin(yFromCenter) * strength, SCREEN_UV.y);
|
||||
vec4 blurred = textureLod(SCREEN_TEXTURE, uv, blurImpact);
|
||||
|
||||
COLOR = blurred;
|
||||
}
|
Reference in New Issue
Block a user