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;
glass, noise, normalmap, screen texture
The shader code and all code snippets in this post are under CC0 license and can be used freely without the author's permission. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

More from miskatonicstudio

Engine flame

UV light (2D and 3D)

Hexagon pattern

Related shaders

Simple 3D Glass

Glass Square Effect Shader

Procedural Stained-Glass Shader


Inline Feedbacks
View all comments