Trying to create a 2D Rain Shader.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Nerdis

Hey guys,
I´m trying to recreate the following video in Godot Engine 3.1
Link: Youtube Video
But I´m failing. This is my shader code. It don´t shows the texture (yes I set it to the noise parameter)

shader_type canvas_item;

uniform sampler2D noise;
uniform float intensity = 0.05;

void fragment() {
	vec2 uv2 = vec2(SCREEN_UV);
	uv2 += (texture(noise, uv2 + vec2(TIME/10.0,TIME/1.0)).rgb.rb-vec2(.53))*intensity;
	COLOR = vec4(uv2, 1.0, 0.0);
}

I hope you can help me!

Greetings
Nerdis

:bust_in_silhouette: Reply From: Nerdis

Hey,

I´ve got the problem fixed with the help from clayjohn from the Godot Discord.

shader_type canvas_item;

uniform sampler2D noise;
uniform float intensity = 0.03;

void fragment() {
	vec2 uv = vec2(SCREEN_UV);
	uv += (texture(noise, uv + vec2(TIME/10.0,TIME/1.0)).rb-vec2(.53))*intensity;
	COLOR = vec4(texture(SCREEN_TEXTURE, uv).rgb, 1.0);
}