Disturbance effect
屏幕扰动效果,类似火焰灼烧空气
需要一张贴图
speed表示扰动的速度
size表示扰动的强度
Shader code
shader_type canvas_item;
uniform sampler2D smoke;
uniform float speed = 0.3;
uniform float size = 0.08;
void fragment(){
vec2 smoke_uv = UV + TIME * speed;
vec4 smoke_color = texture(smoke, fract(smoke_uv));
smoke_color = clamp(smoke_color * size, 0.0, 1.0);
vec4 img_color = texture(SCREEN_TEXTURE, SCREEN_UV + vec2(smoke_color.g - size/2.0,0.0));
COLOR = vec4(img_color);
}
感谢
I’m not sure what I’m doing wrong, but the sprite just becomes invisible
kinda works like this:
Great shader, thank you for fixing it
6