[WITH PIC] Projector makes image on wrong side :)

Hi, All!

I have an issue with the standard projector. The projector makes an image on the side at front of it and, by some unknown reason, on the far back wrong side of the mesh (regular Unity cube)!!! Is this a normal behaviour?

Take a look at the picture, I created simple Cube primitive (from unity) and projected an image to it. Suddenly, the projected image appear on the back side of the primitive. The Near or Far clip plane did not help with this issue.

My first idea was that everyone side of Cube (from Unity primitive) lay one by one on UV map, so I create the cube with 6 distinct slices on UV map for each side and this did not help with the problem too. The wrong image from the projector still appears on back side of the cube :(((((

Then I tried to modify standard Projector shader and you can see this on the shader name (Projector MultiplyCG) but with no luck again.

The question is: How to make projected image appears only on one side of a mesh without this mesh deconstruction?

There is some midisuccefus way to do right projection:

Shader "Projector"
{ 
 Properties
 {
  _Color ("Main Colour", Color) = (1,1,1,1)
  _MainTex ("Cookie", 2D) = "gray" { TexGen ObjectLinear }
  //_FalloffTex ("FallOff", 2D) = "white" { TexGen ObjectLinear   }
  //_far("FarClip", float) = 1
 }

 SubShader
 {
  Tags { "RenderType"="Transparent"  "Queue"="Transparent+100"}
  Pass
  {
   Lighting Off
   Cull Off
   ZWrite Off
   Offset -1, -1
   
   Tags { "Queue" = "Transparent" "RenderType"="Opaque" }
   //Fog { Mode Off }
   AlphaTest Greater 0
   ColorMask RGB
   Blend SrcAlpha OneMinusSrcAlpha
   CGPROGRAM
   #pragma vertex vert
   #pragma fragment frag
   #pragma fragmentoption ARB_fog_exp2
   #pragma fragmentoption ARB_precision_hint_fastest
   #include "UnityCG.cginc"

   struct Input
   {
    float4 vertex : SV_POSITION;
    float3 normal : NORMAL;
    //float4 color : COLOR;
   };
   
   struct v2f
   {
    float4 pos : SV_POSITION;
    float4 uv_Main  : TEXCOORD0;
    //float4 color : COLOR0;
    float koef : COLOR;
   };

   sampler2D _MainTex;
   //sampler2D _FalloffTex;
   float4 _Color;
   float4x4 _Projector;
   //float4x4 _ProjectorClip;
   //float _far;

   v2f vert(Input v)
   {
    v2f o;
    o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
    o.uv_Main = mul (_Projector, v.vertex);
    
    float3 normView = normalize(float3(_Projector[2][0],_Projector[2][1], _Projector[2][2]));
    float d = dot(v.normal, normView);
    
    o.koef = d < 0 ? 1 : 0;
    
    return o;
   }

   half4 frag (v2f i) : COLOR
   {
    half4 tex = tex2Dproj(_MainTex, UNITY_PROJ_COORD(i.uv_Main)) * _Color * i.koef;
    //tex.a = (1 - tex.a);
    return tex;
   }
   ENDCG
  }
 }
}

this is not working for me any idea???

Change vert function to

   v2f vert(appdata_full v)
   {
    v2f o;
    o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
    o.uv_Main = mul (_Projector, v.vertex);
  
    float3 normView = normalize(float3(_Projector[2][0],_Projector[2][1], _Projector[2][2]));
    float d =dot(v.normal, normView);
    o.koef = d < 0 ? 1 : 0;
  
    return o;
   }

works for me