combining 2 textures in a shader

how to combine 2 textures in a shader ?

There are countless ways how you could combine 2 or more textures. The simplest way is to blend them 50% : 50% by using “lerp”

finalColor = lerp(tex1Color, tex2Color, 0.5);

where “tex1Color” would be the color you sampled from your first texture and “tex2Color” from the second texture.

Though you could multiply the colors which generally would darken the result

finalColor = tex1Color * tex2Color;

It’s also possible to lerp between the two colors based on the alpha channel of one of the textures

finalColor = lerp(tex1Color, tex2Color, tex2Color.a);

To get an idea how many ways there are have a look at this page which introduces the photoshop blendmodes.

So the main question is how do you want the result to look like?