Last active
October 27, 2015 14:17
-
-
Save wtekteam/61a12932dc65f102ee74 to your computer and use it in GitHub Desktop.
A simple vertex color shader using CG.
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 "VertexColour" | |
{ | |
SubShader | |
{ | |
Pass | |
{ | |
CGPROGRAM | |
#pragma vertex vert | |
#pragma fragment frag | |
#include "UnityCG.cginc" | |
struct v2f | |
{ | |
float4 pos : SV_POSITION; | |
float3 color : COLOR0; | |
}; | |
v2f vert (appdata_full v) | |
{ | |
v2f o; | |
o.pos = mul (UNITY_MATRIX_MVP, v.vertex); | |
o.color = v.color; | |
return o; | |
} | |
half4 frag (v2f i) : COLOR | |
{ | |
return half4 (i.color, 1); | |
} | |
ENDCG | |
} | |
} | |
Fallback "VertexLit" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment