POM Materials in Layered Landscapes

Has anybody successfully used POM material in layered landscapes with some height factor to them. It seem to be working very well on flat surface but at certain angles there are strange artifacts where the POM material kind of “blurs/stretches” out while you are moving towards it and then once up by it looks normal.

Is this a known issue that there is a way to work around or just a limitation of current POM implementation?


It’s a known issue. POM can handle some angles but gets increasingly messed up with steeper angles. There are workarounds but they are costly. Ryan B is talking about it in this video: Paragon Feature Examples: Foliage & Parallax Occlusion Mapping | Feature Highlight | Unreal Engine - YouTube
I would say it’s not worth it or very suitable for landscapes and would recommend using Tessellation instead. In the upcoming 4.13 version there are going to be some improvements to tessellation on landscapes making it even more viable.

It is a limitation of any POM implementation, not just UE4-specific. Generally, the artifact you are mentioning manifests itself mostly at high slopes, and those should be usually covered by a layer without POM.

I have a slightly better way of working around that these days but it will cost. Basically you need to bake out the full transform of the terrain into a texture. I do this by storing the Tangent X vector and the Vertex normal. In order to store both of them, I convert them to octahedrons and write it so that RG = Tangent X and BA = Vertex normal. Octahedrons are used since the values must be worldspace and the octahedron is cheaper than trying to derive Z since the Z sign would have to be bit packed somewhere which also hurts precision.

Then the transform texture must be hooked up alongside the heightmap to the POM node. Then the POM code transforms the camera vector into the new tangent space once per iteration instead of just at the beginning or starting position. This allows the ray to be corrected as it moves through the curved tangent space. This is actually the standard way of handling curvature for cases where you aren’t slicing the mesh into prisms and handling it more using a geometry shader approach, but that method is far more complex and costly from what I gather.

I will try to post how I did that and some new code soon. If I do not get to it feel free to bump the thread or PM me since all of the work is done but I am jumping between lots of tasks right now so it is easy for me to forget about these things between workdays.

Hey did you ever get the opportunity to finish this?

I tried implementing what you described but the result was just wrong…

What I did was basically at the start of each iteration, I calculate the TangentSpace and do the following…

  float3 CameraVectorT=mul(TangentSpace,CameraVectorW);