- Home /
Shader looks different in game than in scene view
I have a shader I made about a year ago, that worked fine then, but acts weird now. It's a front culling shader, and in the scene view it looks correct, but in the game view the frontfacing triangles cull the backfacing triangles.
Any idea what could cause this?
Edit:
the shader was made in unity 3.5 btw, and I'm using 4 now
I noticed it works when I swith to Deferred rendering instead of forward, or when I disable every post effect.
So it appears the problem only appears in combination with forward rendering and post effects. weird
here's the (simplified) shader:
Shader "Custom/Test"
{
Properties
{
_MainTex ("bidon bedrukking", 2D) = "bidon bedrukking" {}
}
Subshader
{
Tags
{
"RenderType" = "Opaque"
}
LOD 300
Cull Front
CGPROGRAM
#pragma surface surf Lambert
#pragma target 3.0
sampler2D _MainTex;
struct Input
{
float2 uv_MainTex;
};
void surf(Input IN, inout SurfaceOutput o)
{
float2 uv = IN.uv_MainTex;
fixed4 tex = tex2D(_MainTex, uv);
o.Albedo = tex;
o.Alpha = 1;
}
ENDCG
}
FallBack "Diffuse"
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613100815im_/https://answers.unity.com/themes/thub/images/avi.jpg)