This terrain shader is based on the method that's already been used in the BGE, whereas you separate the vertex color map into its individual channels using nodes and then using them as masks to blend textures togetherI'll let the image explain things better (and yes, the part on the right is straight out of Godot's viewport).[url=http://theorysend.com/uploads/c21f29b57bbea0780a00324242a7f31c1301e17b][img width=760 height=380]http://theorysend.com/uploads/c21f29b57bbea0780a00324242a7f31c1301e17b[/img][/url]Along with that, I have provided a supplementary project file so you can use and adapt the shader for your own projecthttp://www.mediafire.com/download/3mucchbbonshdbz/Terrain%282%29.zipKeep in mind though that the textures here are larger than what you usually use in a game, that would be the result of me quickly slapping the example together and using textures I would otherwise use for 3D rendering (but it should be quite easy to replace the textures with your own).In part, this is a response to the initial attempts to create 3D games with terrains inside of Godot, this should help improve them significantly (by giving them the expected variation in texture) and this shader can be applied to any mesh with vertex colors.

Coolbeans ace! I've been working on a water shader, just managed to get refraction and vertex displacement working, so I'm about to post it. :)

Thanks very much,Great terrain shader,Ace!

That is nice, I'll have to remember this thread.

I am not got the whole procedure :), it must be set up in the Blender before export this vertex colors?edit: ??? I must look in to the BGE vertex color procedure :)

[quote author=Bishop link=topic=15383.msg15688#msg15688 date=1460497584]I am not got the whole procedure :), it must be set up in the Blender before export this vertex colors?[/quote]The mesh that is exported already must have vertex colors assigned (with the vertices colored either red, green, blue, or black).You can also use other colors if you want more arbitrary mixing values (yellow for instance will create a 50/50 blend between the texture for the green channel and the texture for the red channel).

13 days later

I added a new version.The main change is that there's now a vertex shader component (as opposed to just a fragment shader). This means there will be no unexpected shading changes when going through multiple scenes containing this material (but will remain consistent).

a year later

It is very convenient for the texturing of the landscape.

As it can be modified to the materials (PBR) Godot 3.0?

5 years later