Why do clipped pixels still receive shadows (in a Surface Shader)?

The example shader in the docs, “Slices via World Space Position” (scroll down to find it), is supposed to clip pixels in horizontal stripes:

2447604--168018--SurfaceShaderSlices.png

However! When I use the exact same code, the object is receiving shadows in the clipped regions but applying the shadow darkening to whatever is behind the object:

2447604--168017--Screen Shot 2016-01-03 at 12.53.19 PM.png

You can see that the other distant shadows on the ground are erased, and new shadows are visible through the holes of the sphere where we should only see the ground. Turning off the light’s shadows makes the darkened regions go away.

Is this fixable (using clip() on an opaque object, in a Surface Shader)? If I need to use alpha cutout instead of opaque, what are the right tags, pragmas, etc?

I want the object’s cast shadow on the ground to be affected by the whole object as if it was not clipped, but I want to see through the object’s clipped holes. My real goal is to clip some pixels around the rim of the object to give it a more irregular silhouette.

EDIT: I found that putting “addshadow” in the pragma solves the shadows-in-the-holes problem, but it also causes the cast shadow to show the stripes instead of being a solid circle.

Here is the shader code from the doc example.

  Shader "Example/Slices" {
    Properties {
      _MainTex ("Texture", 2D) = "white" {}
      _BumpMap ("Bumpmap", 2D) = "bump" {}
    }
    SubShader {
      Tags { "RenderType" = "Opaque" }
      Cull Off
      CGPROGRAM
      #pragma surface surf Lambert
      struct Input {
          float2 uv_MainTex;
          float2 uv_BumpMap;
          float3 worldPos;
      };
      sampler2D _MainTex;
      sampler2D _BumpMap;
      void surf (Input IN, inout SurfaceOutput o) {
          clip (frac((IN.worldPos.y+IN.worldPos.z*0.1) * 5) - 0.5);
          o.Albedo = tex2D (_MainTex, IN.uv_MainTex).rgb;
          o.Normal = UnpackNormal (tex2D (_BumpMap, IN.uv_BumpMap));
      }
      ENDCG
    }
    Fallback "Diffuse"
  }

This is because the shadow receiver (for the main directional shadow) and the shadow caster are the same shader. If you want a different shadow receiver and shadow caster there’s no way to do this with a surface shader and there’s no good way to do it with vert/frag shaders either.

Thanks!
I got what I wanted by making two copies of the object. One is visible and the other is invisible but casts a shadow.

Copy 1: use the shader from the docs with “addshadow” added to the pragma. Mesh renderer has Cast Shadows: Off.
Copy 2: use a normal shader. Mesh renderer has Cast Shadows: Shadows Only.

2447817--168037--Screen Shot 2016-01-03 at 03.51.12 PM.png

(The small blue sphere is only there to test if a shadow can be cast onto the main object)