Announcement

Collapse
No announcement yet.

Possible to separate landscape distance field?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    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.
    Last edited by somawheels; 09-16-2018, 01:48 PM.

    #2
    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.

    Comment


      #3
      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.

      Comment


        #4
        Originally posted by somawheels View Post
        But the problem with this, is UE4 cannot read a 16bit heightmap at full precision.
        That is not true.

        Comment


          #5
          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.
          in the Kite demo it is on all of the river and lake materials and a few rocks. I don't have the kite demo installed right now to go get a screenshot showing where it is. All I have is old art meeting images like this:

          Click image for larger version

Name:	terrainblend.JPG
Views:	1
Size:	66.8 KB
ID:	1093401

          That was in debug mode showing the limits of the precision. The 'steps' are around 1 meter tall here and we only used a 2048 size texture to represent the entire terrain of 10km x 10 km. So the 'full' res of the whole map would be 16k so this is using quite a downsized map.
          https://forums.unrealengine.com/deve...eate-landscape
          Last edited by somawheels; 09-16-2018, 01:46 PM.

          Comment

          Working...
          X