Shadows on displaced vert/frag shader only show up with certain camera angles

Hi, I’m pretty new at understanding shaders. I’ve been following along with the shader examples and checking out other demos/tutorials. I’m trying to build a shader that does vertex displacement, and I have been able to get everything working how I like it in the editor, with one exception. When I rotate my camera in scene view above a certain angle, the shadows disappear and everything goes matte.

After intense debugging and failed attempts at making any progress, and massive amounts of googling, I think I found the answer to my problem, but I can’t tell for certain. Here is the post that gave me the “aha” moment and I’m hoping someone can confirm my suspicions:

The mesh that I am using for my shader while I work on it is just a plane, and if I understand this post, the shadows are disappearing because the mesh, being a plane, has a planar bounds, which means I am displacing the verticies outside the bounds of the shadowmap.

Does that sound right? And, if so, does that means that even if I applied this shader to a different mesh form, I could experience the same issue if the vertex gets displaced beyond the bounding box of the mesh?

Here is are some screen shots of what I’m seeing happen:

Shadows look nice:

Slight tilt of the camera in scene view:

Hmm, I’m thinking that this might not be the issue after all. I tried changing the bounds of the mesh to be large enough to contain the whole displaced area and it is still doing this. My shader code is just the “Lit/Diffuse With Shadows” one from the examples with vertex displacement added to the vert function and to the shadowcaster following this post .

The vertex displacement in my vert function is done by sampling a noise texture.

float height = tex2Dlod(_NoiseTex, float4(v.texcoord.xy, 0, 0)) * _ScaleFactor;
float3 vertexPosition = float3(0, height, 0);
v.vertex.xyz += mul(unity_WorldToObject, vertexPosition);

And my shadowcaster vert function:

float height = tex2Dlod(_NoiseTex, float4(v.texcoord.xy, 0, 0)) * _ScaleFactor;
float3 vertexPosition = float3(0, height, 0);
v.vertex = mul(unity_WorldToObject, float4(vertexPosition, 1));
TRANSFER_SHADOW_CASTER_NORMALOFFSET(o);

Everything else is just the same as the example shader “Lit/Diffuse With Shadows”

I’m stuck on thinking it has to do with the plane mesh, or something. Any help appreciated.