最终效果
Shader源码
Shader "QQ/Gradient/Bias"
{
Properties
{
_Color("Color",Color) = (.5,.5,.5,1)
_MainTex("Texture", 2D) = "white" {}
_Gradient("Gradient,x:slope,y:speed,zw:gradual",vector) = (-.1,5,.3,.01)
}
SubShader
{
Tags { "RenderType" = "Transparent"
"Queue" = "Transparent"
}
LOD 100
Pass
{
Zwrite Off
Blend SrcAlpha OneMinusSrcAlpha
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct a2v
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
float2 loc