i would like to achieve veins spreading based on the gradient texture. with a parameter i can control
how do i achieve this?
make a color appear based on a gradient and an alpha texture?
- Edited
I made shader to get a similar effect, but it's kinda janky. (I'd appreciate if someone who understands shaders better took a look at it )
shader_type spatial;
uniform sampler2D texture_skin;
uniform sampler2D texture_vein;
uniform vec2 vein_position;
uniform float test_offset_1 = 0;
uniform float test_offset_2 = 0;
uniform float radius : hint_range(0.0, 1.0) = 0.2;
void fragment() {
vec3 skin_albedo = texture(texture_skin, UV).rgb;
vec2 uv = vec2(vein_position.x - UV.x, vein_position.y - UV.y);
vec3 vein_albedo = skin_albedo * texture(texture_vein, UV).rgb;
ALBEDO = mix(vein_albedo, skin_albedo, smoothstep(0, radius, distance(uv-test_offset_1,uv*test_offset_2)));
}