You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
877 B
Plaintext

2 years ago
shader_type spatial;
render_mode blend_add,unshaded,depth_test_disabled;
uniform sampler2D noise;
2 years ago
uniform sampler2D tex_mask : source_color;
uniform float distortionView : hint_range(0.0, 0.3, 0.005) = 0.03;
uniform float speedView : hint_range(0.0, 1.0, 0.005) = 0.5;
uniform sampler2D screenTexture : hint_screen_texture;
2 years ago
void fragment()
{
2 years ago
vec2 uv2 = UV - 1.0 * vec2(mod(TIME, 2.0) - 1.0, 0);
vec4 col_mask = texture(tex_mask, UV);
float noiseValueX = (texture(noise, UV + (TIME * speedView)).r * 2.0) - 1.0; // Range: -1.0 to 1.0
float noiseValueY = (texture(noise, UV + (TIME * speedView)).r * 2.0) - 1.0; // Range: -1.0 to 1.0
vec2 noiseDistort = vec2(noiseValueX, noiseValueY) * distortionView * col_mask.r;;
vec3 distortedScreenTexture = vec3(texture(screenTexture, SCREEN_UV + noiseDistort).rgb);
ALBEDO = distortedScreenTexture;
ALPHA = col_mask.r;
}