Hello guys, I'm new in shader programming and I don't know exactly how i do to overlay one texture to another without multiply them. To explain better i will use two images as examples. It's what is happening what i expect Any help we'll be useful, thank you!
You'd want to lerp (linearly interpolate) between the base colour and the overlay colour via the transparent value of the overlay colour. That means your overlay colour map would need an alpha channel, with white where you want it to appear and black where you don't (and shades of grey blend between those two extremes). Code (csharp): fixed3 baseColor; // This is whatever holds the base colour. fixed4 overlayColor; // This holds the overlay colour and it's transparency in the alpha channel. fixed3 result = lerp (baseColor, overlayColor.rgb, overlayColor.a);
Ok, i did that and it works, but it requires the overlay texture when i apply the result to the o.albedo. In this case I have to do a if statement or something else? How it would be?