So I have an old wireframe shader, that will not compile properly. I have marked the errorr but believe that there is nothing missing to add.
What exactly is wrong with the code and how do I fix it?
Shader "Custom/Wireframe" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_Gain ("Gain", Float) = 1.5
}
SubShader {
Tags { "RenderType"="Opaque" "LightMode"="Vertex" }
LOD 200
Pass {
CGPROGRAM
#pragma target 3.0
#pragma glsl
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
sampler2D _MainTex;
float _Gain;
struct appdata {
float4 vertex : POSITION;
float4 tangent : TANGENT;
float3 normal : NORMAL;
float2 uv : TEXCOORD0;
};
struct vs2ps {
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
float3 bary;
};
vs2ps vert(appdata IN) { //Shader error in 'Custom/Wireframe': 'vert': function return value missing semantics at line 34 (on d3d11)
vs2ps o;
o.vertex = mul(UNITY_MATRIX_MVP, IN.vertex);
o.bary = IN.tangent.xyz;
o.uv = IN.uv;
return o;
}
float4 frag(vs2ps IN) : COLOR {
float3 d = fwidth(IN.bary);
float3 a3 = smoothstep(float(0.0), _Gain * d, IN.bary);
float t = min(min(a3.x, a3.y), a3.z);
float4 c = tex2D(_MainTex, IN.uv);
return t * c;
}
ENDCG
}
}
FallBack "Diffuse"
}