how do i make this shader only apply vertex offset on vertex color green?
shader_type spatial;
render_mode blend_mix, depth_prepass_alpha, cull_disabled, diffuse_burley, specular_schlick_ggx;
uniform float alphatreshold;
uniform float strenght : hint_range(0.0, 1.0, 0.05);
uniform float speed : hint_range(0.0, 3.0, 0.1);
uniform sampler2D colortex : source_color,filter_linear_mipmap,repeat_disable;
uniform sampler2D normaltex : hint_roughness_normal,filter_linear_mipmap,repeat_disable;
uniform sampler2D roughnesstex : hint_roughness_gray,filter_linear_mipmap,repeat_disable;
void vertex() {
float vertexcolorgreen = COLOR.g;
VERTEX.x += sin(TIME * speed + VERTEX.x + VERTEX.z ) * strenght;
VERTEX.y += sin(TIME * speed + VERTEX.y + VERTEX.x ) * strenght;
}
void fragment() {
// Place fragment code here.
ALPHA = texture(colortex,UV).a;
ALPHA_SCISSOR_THRESHOLD = alphatreshold;
ALBEDO= texture(colortex,UV).rgb;
NORMAL_MAP = texture(normaltex,UV).rgb;
SPECULAR = 0.5;
ROUGHNESS = texture(roughnesstex,UV).r;
}