Help with the differences between shader language of 2.0 to 3.0

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By brunosxs
:warning: Old Version Published before Godot 3 was released.

Hi guys, I have been trying to port this code:

To godot 3.0 but something seems wrong, and I don’t have any more ideas. I am a newbie at shaders, so I am kinda lost.

shader_type canvas_item;

uniform float height = 1.0;
uniform sampler2D displacement_1;
uniform float displace_factor_1 = 0.01;
uniform float speed_1 = 1;

uniform sampler2D displacement_2;
uniform float displace_factor_2 = 0.01;
uniform float speed_2 = 1;

void fragment(){

	vec2 offset_1 = vec2(TIME * speed_1,0);
	vec2 d_1 = texture(displacement_1, UV + offset_1).rg;
	
	vec2 offset_2 = vec2(TIME * speed_2,0);
	vec2 d_2 = texture(displacement_2, UV + offset_2).rg;
	
	vec2 r_uv = vec2(SCREEN_UV.x, SCREEN_UV.y + UV.y*height) + (d_1 * displace_factor_1 - d_2 * displace_factor_2);
	vec4 r_col = texture(SCREEN_TEXTURE, r_uv);
	
	COLOR.rgba = vec4(0,0,0,0);
	COLOR.rgb += r_col.xyz + vec3(d_1 * d_2, 0.0) * 0.1 - vec3(0.4,0.2,0.1) * (1.0-UV.y + 0.1);
	COLOR.rgb += vec3(0.3,0.2,0.1) * (1.0 - dot(d_1, d_2));
	COLOR.a = 1.0 - (UV.y*UV.y);
}

As it is, this is what I have: which is nowhere close of what I want.
shader