Frosted glass
A shader that creates an effect of a frosted glass surface. By default it works with a noise texture, but if a normalmap texture is used instead, it can create any glass surface type (e.g. lens).
Shader code
shader_type spatial;
uniform float distortion_size = 0.4;
uniform sampler2D glass;
void fragment() {
vec2 d = texture(glass, UV).xy - vec2(0.5);
ALBEDO = texture(SCREEN_TEXTURE, SCREEN_UV + d * distortion_size).rgb;
}
Nice! to make it work in godot 4 add the following line: