Help to troubleshoot basic Toon Ramp Shader

Here is what I have, everything should be straight our of the docs

Shader "Example/Diffuse" {
    Properties {
      _MainTex ("Texture", 2D) = "white" {}
    }
    SubShader {
      Tags { "RenderType" = "Opaque" }
      CGPROGRAM
      #pragma surface surf Ramp

    sampler2D _Ramp;

    half4 LightingRamp (SurfaceOutput s, half3 lightDir, half atten) {
        half NdotL = dot (s.Normal, lightDir);
        half diff = NdotL * 0.5 + 0.5;
        half3 ramp = tex2D (_Ramp, float2(diff)).rgb;
        half4 c;
        c.rgb = s.Albedo * _LightColor0.rgb * ramp * atten;
        c.a = s.Alpha;
        return c;
    }
    
      struct Input {
          float2 uv_MainTex;
      };
    
      sampler2D _MainTex;
    
      void surf (Input IN, inout SurfaceOutput o) {
          o.Albedo = tex2D (_MainTex, IN.uv_MainTex).rgb;
      }
      ENDCG
    }
    Fallback "Diffuse"
  }

I’m getting this error:
“Shader error in ‘Example/Diffuse’: incorrect number of arguments to numeric-type constructor at line 15 (on d3d11)”

Thoughts?

You’re adding a single half (diff) to a float2. It’s expecting 2 parameters.

Would you mind changing my code and reposting? I’m new to this, so any help would greatly be appreciated!

Change this line:

half3 ramp = tex2D (_Ramp, float2(diff)).rgb;

to this one:

half3 ramp = tex2D (_Ramp, float2(diff,diff)).rgb;

Thanks!