I’m new to shader writing and I’ve been having a difficult time. I’m trying to create a shader that projects a portion of one texture according to an alpha map in a second texture onto a surface:
=
Here’s my pitiful attempt which seems to render the decal ok, but doesn’t mask it with the second texture:
The primary texture must have an alpha channel (go to channels tab next to layers in Photoshop and hit the “Create new Channel” icon
The masking texture can be a greyscale image, just select “Alpha from Grayscale” checkbox in the texture import settings when selecting the “Advanced” option from the Texture Type dropdown.
You never need to type “combine texture”; that’s the default behavior. Lerping is overkill if the lerp is to black; this is clearer and possibly faster:
Combine previous * texture alpha
There may be something else to simplify, but I don’t know what you’re doing with blending.