- Home /
combining 2 textures in a shader
how to combine 2 textures in a shader ?
Answer by Bunny83 · Feb 23, 2018 at 10:00 PM
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?
Your answer
Follow this Question
Related Questions
Maya to Unity, Importing a model that uses Shader with Layered Texture node 0 Answers
solved: how to combine jpg + separate alpha in png? 1 Answer
A bit more texture detail in Vertex Lit 1 Answer
Change between 2 textures based on a variable 1 Answer
How can I edit Material Textures without creating a new Shader?,How to edit Material Texture 1 Answer