I am trying to disable backface culling in a simple shader but “Cull Off” seems to have no effect. It always culls one side. vertex buffer has no normals. version 2019.3.14f1. What could be the problem?
Shader "Custom/test" {
Properties {
_MainTex ("Texture", 2D) = "white" { }
}
SubShader {
Tags { "Queue" = "Transparent" }
Pass {
Blend SrcAlpha OneMinusSrcAlpha
Ztest always
ZWrite Off
Cull Off
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
sampler2D _MainTex;
struct appdata {
float4 vertex : POSITION;
float2 texcoord : TEXCOORD0;
fixed4 color : COLOR;
};
struct v2f {
float4 pos : SV_POSITION;
float2 texcoord : TEXCOORD0;
fixed4 color : COLOR;
};
float4 _MainTex_ST;
v2f vert (appdata v)
{
v2f o;
o.pos = UnityObjectToClipPos(v.vertex);
o.texcoord = TRANSFORM_TEX (v.texcoord, _MainTex);
o.color = v.color;
return o;
}
fixed4 frag (v2f i) : SV_Target
{
fixed4 texcol = tex2D (_MainTex, i.texcoord);
return texcol * i.color;
}
ENDCG
}
}
}