Hi, I found the shader below on youtube in the comment section: https://youtube.com/watch?v=RLAG4RbT-5U
What I actually want is a "script/shader" that can use a Splat map and mix between 4 full materials (not just the diffuse textures)
but this would be a nice temporary way of doing it, until the other solution becomes available at some point.
The problem with this shader is that the material gets very bright (left side), it should look like the grass on the right side.
Hope someone has an idea why this happens.
Left side: Splatmap shader
Right side: Default Spatial material

shader_type spatial;
uniform float grassres = 1;
uniform float rockres = 1;
uniform float dirtres = 1;
uniform sampler2D grass;
uniform sampler2D rock;
uniform sampler2D dirt;
uniform sampler2D splatmap;
void fragment(){
float grassval = texture(splatmap, UV).g;
float rockval = texture(splatmap, UV).b;
float dirtval = texture(splatmap, UV).r;
vec3 grasstex = texture(grass, UV*grassres).rgb * grassval;
vec3 rocktex = texture(rock, UV*rockres).rgb * rockval;
vec3 dirttex = texture(dirt, UV*dirtres).rgb * dirtval;
vec3 result = grasstex+rocktex+dirttex;
ALBEDO = result;
}