I cant figure out why is this shader not working.(it is not moving it just displace the mesh once)
shader_type canvas_item;
uniform vec2 position = vec2(1.0, 1.0);
uniform float wind_speed = 1.0;
uniform float wind_strength = 2.0;
uniform float wind_texture_tile_size = 20.0;
uniform vec2 wind_direction = vec2(1.0, 1.0);
uniform sampler2D wind_noise : hint_default_black;
void vertex() {
vec2 world_vert = position + VERTEX;
vec2 noise_x_position = world_vert / wind_texture_tile_size + TIME * wind_speed;
vec2 noise_y_position = world_vert / wind_texture_tile_size + TIME * wind_speed + vec2(1.0, 1.0);
float noise_x = textureLod(wind_noise, noise_x_position, 0.0).r - 0.5;
float noise_y = textureLod(wind_noise, noise_y_position, 0.0).r - 0.5;
vec2 bump_wind = vec2(noise_x, noise_y);
bump_wind *= wind_strength;
float displacement_affect = (1.0 - UV.y);
VERTEX += bump_wind * displacement_affect;
}
I have set up the noise texture, and setting the position as I create the instance. I want to use noise so I can simulate the wind