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.
|
|
|
|
shader_type spatial;
|
|
|
|
|
|
|
|
|
|
render_mode unshaded;
|
|
|
|
|
|
|
|
|
|
uniform sampler2D noise;
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
void fragment()
|
|
|
|
|
{
|
|
|
|
|
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;
|
|
|
|
|
}
|