Hello. I’m on Unity 5 following a tutorial, but I’ve gotten to the creating a shader part and it says to do an Unlit Shader.
I have done exactly what appears in the image but creating the Shader does not display that list of options and just creates a custom Shader. How can I create an Unlit shader?
Here is the code for the shader I want to create:
Shader "Unlit/CircleShader"
{
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 100
Pass
{
Zwrite on
Blend SrcAlpha OneMinusSrcAlpha
AlphaToMask on
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
float4 col : COLOR;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
float4 color : COLOR;
};
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
o.color = v.col;
return o;
}
fixed4 frag (v2f i) : SV_Target
{
fixed4 col = i.color;
float2 newUV;
newUV.x = i.uv.x * 2 - 1;
newUV.y = i.uv.y * 2 - 1;
if ((newUV.x*newUV.x + newUV.y*newUV.y) > 1) {
col.a = 0;
}
return col;
}
ENDCG
}
}
}
