Varying tessellation multiplier causes cracks?

Hi!

I’ve been working on a custom tessellation shader that uses different heuristics than edge size to determine the tessellation factors. However when assigning varying tessellation multiplier I always get large cracks in the geometry when using displacement.
If I’ve understood things correctly I should not be getting cracks if I only use vertex data to determine the tessellation factors since each edge will receive the same tessellation factor for both primitives. This seems true for Unreal’s builtin adaptive tessellation.

Looking at the shader source code (Tessellation.usf and FlatTessellation.usf) it seems that the tessellation factors are calculated as the average of the given tessellation multipliers for each vertex which then should result in no cracks. I use the node Absolute World Position to obtain the vertex position, is this the correct node to use? I want to calculate the tessellation factor for each control point of the primitive using it’s position in world space.

I’ve tried all combinations of using Flat or PN-Triangles, adaptive tessellation and crack free displacement.

Example blueprint:


Results:


If anyone has any suggestions on how to achieve crack free tessellation with varying tessellation multipliers I would be very grateful! If I have to modify engine source code to achieve this that is no problem.

Thanks!

I solved this problem, it was caused by a bug in the tessellation shader. I submitted a pull request with a fix for anyone who might face the same problem:

https://github.com/EpicGames/UnrealEngine/pull/2238

EDIT: The pull request has been accepted in to the engine and should be available in 4.12.