expression left of ."worldRefl" is not a struct or array at line 41 (on d3d9)

Hi again, thread’s title is the error I get from the below code

    Shader "My_Shaders/FirstShader" {
       Properties {
         _Color ("Main Color", Color) = (1,1,1,0.5) // Tint
         _MainTex ("Texture", 2D) = "white" {}
         _BumpMap ("Bumpmap", 2D) = "bump" {}
         _RimColor ("Rim Color", Color) = (0.26,0.19,0.16,0.0)
         _RimPower ("Rim Power", Range(0.5,8.0)) = 3.0
         _Detail ("Detail", 2D) = "gray" {}
         _Cube ("Cubemap", CUBE) = "" {}
       }
   
       Subshader {
         Tags { "RenderType" = "Opaque" }
   
         CGPROGRAM
         #pragma surface surf Lambert
   
         struct Input {
           float4 color : COLOR; // Vertex Color
           float2 uv_MainTex;
           float2 uv_BumpMap;
            float3 viewDir;
            float2 uv_Detail;
             INTERNAL_DATA
         };
   
         float4 _Color; // Tint
         sampler2D _MainTex;
         sampler2D _BumpMap;
         float4 _RimColor;
      float _RimPower;
      sampler2D _Detail;
      samplerCUBE _Cube;
   
         void surf (Input IN, inout SurfaceOutput o) {
           o.Albedo = tex2D (_MainTex, IN.uv_MainTex).rgb * IN.color.rgb * _Color; // Texture * Vertex Color * Tint
           o.Normal = UnpackNormal (tex2D (_BumpMap, IN.uv_BumpMap));
           half rim = 1.0 - saturate(dot (normalize(IN.viewDir), o.Normal));
           o.Emission = _RimColor.rgb * pow (rim, _RimPower);
            o.Albedo *= tex2D (_Detail, IN.uv_Detail).rgb * 2;
            o.Emission = texCUBE (_Cube, WorldReflectionVector (IN, o.Normal)).rgb;
         }
         ENDCG
   
       }
       Fallback "Diffuse"
    }

I get an error that says
Shader error in ‘My_Shaders/FirstShader’: expression left of .“worldRefl” is not a struct or array at line 41 (on d3d9)

how did u resolve this ? can you please give me the soluion? i am currently stuck in same problem

So, we don’t even know what the problem is. Sweet.

I’ve reverted the post, please leave your problems and post your solutions to help other users!

So the solution is to add float3 worldRefl into Input structure

struct Input {
           float4 color : COLOR; // Vertex Color
           float2 uv_MainTex;
           float2 uv_BumpMap;
           float3 viewDir;
           float2 uv_Detail;
           float3 worldRefl;
           INTERNAL_DATA
};

It is described here: Unity - Manual: Writing Surface Shaders

^^^^^^^^^^^^
I was going to say that too, I can clearly see that the variable’s missing!