Hyluss icon

[Shader] Transparent with background color tint

Hyluss | PRO | 10/18/19 11:20:12 AM UTC | 0 ⭐ | 511 👁️ | Never ⏰ | []
C# |

2.04 KB

|

None

|

0 👍

/

0 👎

Shader "Unlit/UnlitAlphaWithFade"
{
    Properties
    {
      
        _Color("Color Tint", Color) = (1,1,1,1)
     //   _Color2("Color Tint2", Color) = (1,1,1,1)
        _MainTex("Base (RGB) Alpha (A)", 2D) = "white"
    }
 
    Category
    {
        Tags { "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Opaque" "DisableBatching" = "True" }
        Lighting Off
        ZWrite Off
        //ZWrite On  // uncomment if you have problems like the sprite disappear in some rotations.
        Cull back
        Blend SrcAlpha OneMinusSrcAlpha
       
        //AlphaTest Greater 0.001  // uncomment if you have problems like the sprites or 3d text have white quads instead of alpha pixels.
        Tags {Queue = Transparent}
 
      
 
        SubShader
        {
           
 
                Pass
                {
             
                        SetTexture[_MainTex]
                        {
                            ConstantColor[_Color]
                            Combine Texture * constant
                        }
                }
 
                Pass
                {
                        SetTexture[_MainTex]
                        {
                            ConstantColor[_Color2]
                            Combine Texture * constant
                        }
                }
 
                      
 
                  
 
                         // Use texture alpha to blend up to white (= full illumination)
 
                         /*
                           SetTexture [_MainTex]
                        {
                           ConstantColor[_Color]
                           
                              Combine Texture * constant
                        }
 
                        SetTexture [_MainTex] {
                            constantColor (1,1,1,1)
                            combine constant lerp(texture) previous
                        }
                        // Multiply in texture
 
                          SetTexture [_MainTex] {
                           
                            combine constant lerp(texture) previous
                        }
                        */
                      
                
        }
    }
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎