Skip to content

Instantly share code, notes, and snippets.

@efruchter
Created February 13, 2019 23:21
Show Gist options
  • Save efruchter/2426d68fced917a63444a76540d5d924 to your computer and use it in GitHub Desktop.
Save efruchter/2426d68fced917a63444a76540d5d924 to your computer and use it in GitHub Desktop.
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
Shader "Vertex Colors Only" {
Properties{
}
SubShader{
Tags { "RenderType" = "Opaque" }
LOD 200
Pass {
Tags { "LightMode" = "Always" }
Fog { Mode Off }
ZWrite On
ZTest LEqual
Cull Back
Lighting Off
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma fragmentoption ARB_precision_hint_fastest
fixed4 _Color;
struct appdata {
float4 vertex : POSITION;
float4 color : COLOR;
};
struct v2f {
float4 vertex : POSITION;
float4 vertexColor: TEXCOORD0;
};
v2f vert( appdata v ) {
v2f o;
o.vertex = UnityObjectToClipPos( v.vertex );
o.vertexColor = v.color;
return o;
}
fixed4 frag( v2f i ): COLOR {
return i.vertexColor;
}
ENDCG
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment