Does anyone know a good way of blending two textures together. I am working on making a tiled terrain mesh in 3D. Right now I am using a mix shader were I use 3 pictures. The first and second image are the images I want to blend together. The third image is the blending image were I use its red value as the mix amount. My terrain mesh has 12800 triangles and 38400 vertecies. The thing is. It is really slow. I am getting around 30 fps on the new iPad Pro 9.7in.
This is what I have so far:
//
// A basic fragment shader
//
//Default precision qualifier
precision highp float;
uniform lowp sampler2D texture;
uniform lowp sampler2D texture2;
uniform lowp sampler2D blendtexture;
varying lowp vec4 vColor;
varying highp vec2 vTexCoord;
void main()
{
lowp vec4 col1 = texture2D(texture,vTexCoord);
lowp vec4 col2 = texture2D(texture2,vTexCoord);
lowp vec4 col3 = texture2D(blendtexture,vTexCoord);
gl_FragColor = mix(col1, col2, col3.r);
}
Does anyone have a good blending shader?
I want it to do something like this: