Skip to content

Instantly share code, notes, and snippets.

@prucha
Last active Apr 1, 2016
Embed
What would you like to do?
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