Download

Possible to separate landscape distance field?

I have a situation where I want to conform objects to the landscape using world position offset, based on the landscape’s distance field. The problem is, I need to somehow separate out the landscape’s distance field from all the other distance fields in the scene. Does anyone have any ideas how i might do this?

I tried using a landscape heightmap instead of distancefield, but unfotunately UE4 does not do not support 16bit precision in materials so using a heightmap is not an option.

Landscapes don’t have distance fields. That’s why distance field shadows are not supported on landscapes. UE4 does support 16-bit heightfields for landscape: I think the landscape system itself saves the heightfield in 16-bit half-precision.

Landscape contributes to the “global” distance field, which is what my material samples to deform objects to the terrain surface.
UE4 landscape itself does indeed support 16bit precision, but landscape height data cannot be directly accesed from within a material. To get a representation of the landscape height data in the material, I have to import a texture of the landscape heightmap. But the problem with this, is UE4 cannot read a 16bit heightmap at full precision.

That is not true.

Ah right. I can read a heightmap at a higher precision if i set the texture compression setting to HDR. however precision is still a problem when the camera is upclose.

https://forums.unrealengine.com/deve…eate-landscape