Mesh triangles are clipped before tessellation

Background:
I’m using a surface shader with tessellation turned on in order to increase the resolution of a mesh and displace it with a heightmap. This pretty much works great except in one situation…

Problem:
It appears that the triangles of my mesh are being clipped before they are tesselated and displaced. So if the un-tessellated and un-displaced triangle is not within the view frustum, it is not rendered, even if it would be visible after tessellation and displacement.

Example:
Two identical meshes, one with the tessellation shader and one with a standard Diffuse shader (no tessellation/displacement). If the “base” mesh is completely visible, everything works great:

31265-1.jpg

However, if some triangle are not in the view frustum on the “base” mesh. They aren’t displayed, even though they will be visible after tessellation and displacement.

31266-3.jpg

Has anyone encountered this before? Have I done something wrong in my tessellation shader? I would expect clipping to occur after the tessellation and vertex fragments.

I realized what was wrong minutes after posting…

The problem is I was using UnityEdgeLengthBasedTessCull (v0, v1, v2, edgeLength, maxDisplacement) but had maxDisplacement set to 1.

Switching to UnityEdgeLengthBasedTess (v0, v1, v2, edgeLength) fixes it.