Texture Blend
Blend two colors and/or textures together based on a greyscale mask.
Shader code
shader_type spatial;
uniform sampler2D mask_texture:hint_albedo;
uniform vec4 albedo_a:hint_color = vec4(1.0f);
uniform sampler2D texture_a:hint_albedo;
uniform vec4 albedo_b:hint_color = vec4(1.0f);
uniform sampler2D texture_b:hint_albedo;
void fragment() {
vec3 mask = texture(mask_texture, UV).rgb;
vec3 a = albedo_a.rgb * texture(texture_a, UV).rgb;
vec3 b = albedo_b.rgb * texture(texture_b, UV).rgb;
vec3 color = mix(a, b, mask);
ALBEDO = color;
}
tysm <3