Skip to content

Instantly share code, notes, and snippets.

@prucha
Last active April 1, 2016 17:38
Show Gist options
  • Save prucha/e1bb13929cc518bcc4905f4ff142c249 to your computer and use it in GitHub Desktop.
Save prucha/e1bb13929cc518bcc4905f4ff142c249 to your computer and use it in GitHub Desktop.
Bare-bones Unity Shader
Shader "Milan/Fixed Unlit"
{
Properties
{
_Color("Main Color", Color) = (1,1,1,1)
}
SubShader
{
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
struct appdata
{
float4 vertex : POSITION;
};
struct v2f
{
float4 pos : SV_POSITION;
};
fixed4 _Color;
//Vertex Shader Function
v2f vert(appdata IN)
{
v2f OUT;
OUT.pos = mul(UNITY_MATRIX_MVP, IN.vertex);
return OUT;
}
//Fragment Shader Function
fixed4 frag(v2f IN) : COLOR
{
return _Color; //fixed4(1,1,0,1);
}
ENDCG
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment