Hey Slapin,
I have implemented a procedurally generated terrain with splatmapping. So far however I have only implemented the simple version with 4 channels. For more channels my first approach would be to use 2 splatmap images, which should give you 4*4 channels. However maybe there are more clever way to do it (I haven't researched yet).
In case you haven't seen it, this video explains how to use splatmaps in Godot:
. The shader code might be outdated, so I'm posting the code that I'm currenty using:
shader_type spatial;
uniform sampler2D texture1;
uniform sampler2D texture2;
uniform sampler2D texture3;
uniform sampler2D texture4;
uniform sampler2D splatmap;
uniform float resolution = 16;
void fragment () {
vec3 result;
float mix1 = texture(splatmap, UV).r;
float mix2 = texture(splatmap, UV).g;
float mix3 = texture(splatmap, UV).b;
float mix4 = 1.0-texture(splatmap, UV).a;
vec3 color1 = texture(texture1, UV*resolution).rgb*mix1;
vec3 color2 = texture(texture2, UV*resolution).rgb*mix2;
vec3 color3 = texture(texture3, UV*resolution).rgb*mix3;
vec3 color4 = texture(texture4, UV*resolution).rgb*mix4;
result = color1 + color2 + color3 + color4;
ALBEDO = result;
}
I have also managed to implement navigation using Godot's Navmesh. I'm building the navigation mesh at together with the terrain mesh, but leave out vertices that are under water or an a location that is very steep. Characters are then able to find their way around lakes or up a hill using a reasonable path. I can post some example code if you're interested. The downside of this approach however is that it's hard to change the navmesh at runtime (or at least I'm not aware on how to do it). For example I'd like to be able to exclude an area after a building has been placed or a new tree has grown.
I'm setting the height of an object by calculating the height, not using the terrain mesh. And I'm not using a heightmap, but just create the terrain using SurfaceTool to create meshes.
I have not implemented collisions.