World Position Offset (WPO): Math for surface displacement / better WPO controls

Hi all -

I have a quick question about WPO math. I’ve been playing around with some assets and using WPO to displace Nanite meshes.

One thing I’ve noticed is that using a heighmap with vertexNormalWS to make surface displacement can break meshes across seams. E.g. see here:

Note that the pre-tessellated mesh does not have seams at these regions where the mesh separates (the same thing happens with a rounded, catmull-clarke subD of the mesh):

In other 3D softwares, displacement often has a ‘midpoint’ function that will allow you to designate a middle point from which to displace, such that sections of the mesh as a whole do not move in the direction of their normal vectors (i.e., the mesh displaces in-place from the centre).

I’m wondering if anyone has any idea how to code a midpoint in UE for WPO?

Unfortunately the documentation is…well…useless in this regard (1.10 - World Position Offset | Unreal Engine Documentation and WorldPositionOffset | Unreal Engine Documentation).

This is what I’m playing with now:

The results are ok, but not perfect.

So mostly wondering if anyone has insights into a better midpoint control and anything for better/other general controls for WPO overall.

As I know, the problem comes when the UV mesh is separated, if you use parallax mapping you will get the same result. I think there is no way to fix it.

I figured a method that works ok but the above screenshots were in 5.1 built from source from github before it was released. Unfortunately Nanite displacement is only working for foliage, there are issues with shadows and self occlusion that make it impractical for normal meshes.

I was hoping to see a full implementation of displacement in 5.1 for the final release, but unfortunately that is not what was released. My understanding is that this works well for foliage because foliage is full of holes and does not easily self-occlude.