Created
March 21, 2022 05:29
-
-
Save went5/d9eaf47d68781514ea9ed98dce7189ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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