My shader code can't display on phone.I want to achieve "RimLight"(Enlarge model‘s normal).I don't know why.
No code No help - -! Code (csharp): Shader "TrueRim" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {} _Color("Color",color)=(1,1,1,1) _Width("Width",range(0.01,0.1))= 0.01 _ModeColor("Mode Color",color)=(1,1,1,1) } SubShader { pass { Tags { "Queue" = "Transparent" } lighting off ZWrite off CGPROGRAM #pragma vertex vert #pragma fragment frag sampler2D _MainTex; float _RandomC; fixed4 _Color; float _Size; float _Width; struct input { float4 pos:position; float3 normal :Normal; }; struct v2f { float4 rimpos:position; }; v2f vert(input i) { v2f v; v.rimpos = mul(UNITY_MATRIX_MVP,i.pos); float3 tempNor = mul((float3x3)UNITY_MATRIX_MV,i.normal); float2 offset = float2(tempNor.x*UNITY_MATRIX_P[0][0], tempNor.y*UNITY_MATRIX_P[1][1]); v.rimpos.xy += offset*_Width; return v; } fixed4 frag(v2f v):color { return _Color; } ENDCG } Pass { ZWrite On ZTest LEqual lighting on Material { Diffuse [_ModeColor] } SetTexture [_MainTex] { Combine texture } SetTexture [_MainTex] { Combine previous * primary double } } } fallBack "Diffuse" }