I have a standard unlit alpha shader that I am using that looks like this.
Shader "Unlit/Game Piece"
{
Properties
{
_Color ("Color Tint", Color) = (1,1,1,1)
_MainTex ("Base (RGB) Alpha (A)", 2D) = "white"
}
Category
{
Lighting Off
ZWrite Off
Cull back
Blend SrcAlpha OneMinusSrcAlpha
Tags {"Queue"="Transparent"}
SubShader
{
Pass
{
SetTexture [_MainTex]
{
ConstantColor [_Color]
Combine Texture * constant
}
}
}
}
}
When a game piece that is drawn with this shader is selected I want it to be highlighted. For that, I would like essentially a layer of white (or any color) applied on top of the image (only where the image is non-transparent) with an additive/screen blending mode to make it brighter. Ideally, I would like it to pulse, so it should be possible to adjust the amount of visibility of the highlight color through a script.
So, I thought about adding a _HiColor definition to the properties section for the highlight color, but I have no idea how I would apply it to the image because I am not sure how a second blend mode would be implemented in a shader like this.
Can someone please tell me what I’d have to do to achieve this? I can’t seem to find any info on this.