Unity Community |

Hi
Anyone knows how to fix shadow sorting? I changed shader AlphaTest-BumpSpec by adding "Cull Off"
Code:
Properties { _MainTex ("Base (RGB) TransGloss (A)", 2D) = "white" {} _BumpMap ("Normalmap", 2D) = "bump" {} } SubShader { Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"} LOD 400 Cull Off CGPROGRAM #pragma surface surf BlinnPhong alphatest:_Cutoff sampler2D _MainTex; sampler2D _BumpMap; fixed4 _Color; half _Shininess; float2 uv_MainTex; float2 uv_BumpMap; }; fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); o.Albedo = tex.rgb * _Color.rgb; o.Gloss = tex.rgb * _Color.rgb; o.Alpha = tex.a * _Color.a; o.Specular = _Shininess; o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); } ENDCG } FallBack "Transparent/Cutout/VertexLit" }
Why would you think having culling off would work for something that takes lighting?
http://danielbrauer.com/files/archive-mar-2011.html
I did not think. I do not know much about programming, so I was looking for help![]()
"...There is an easy way around this, which is to split the shader into two passes. The first pass uses Cull Back, and treats each normal as usual. The second pass uses Cull Front, and inverts each normal in the vertex program. Now we have a shader that renders both sides of each triangle with correct lighting..."
How to do it?
Read to the end of the article. *Hint* you won't need to learn how to do it."...There is an easy way around this, which is to split the shader into two passes. The first pass uses Cull Back, and treats each normal as usual. The second pass uses Cull Front, and inverts each normal in the vertex program. Now we have a shader that renders both sides of each triangle with correct lighting..."
How to do it?