Skip to content

Instantly share code, notes, and snippets.

@went5
Created March 21, 2022 05:29
Show Gist options
  • Save went5/d9eaf47d68781514ea9ed98dce7189ba to your computer and use it in GitHub Desktop.
Save went5/d9eaf47d68781514ea9ed98dce7189ba to your computer and use it in GitHub Desktop.
Shader "Custom/VertexColorAnimation"
{
Properties {}
SubShader
{
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float4 color : COLOR;
};
struct v2f
{
float4 vertex: SV_POSITION;
float4 color: COLOR;
};
void vert(in appdata v, out v2f o)
{
o.vertex = UnityObjectToClipPos(v.vertex);
o.color = v.color;
}
void frag(in v2f i, out float4 col : SV_Target)
{
col = i.color + abs(_SinTime.z);
}
ENDCG
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment