Announcement

Collapse
No announcement yet.

Using 16bit heightmap in material to recreate landscape?

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

    Using 16bit heightmap in material to recreate landscape?

    Hello,

    I'm trying to recreate landscape displacement by using the heightmap texture inside a material (the end goal is to use the heightmap data to better match an ocean shader to the landscape).
    However there seems to be extreme terracing (or stepping? whatever it might be called ) which I'm assuming is because the heightmap texture is compressed as 8bit instead of 16.

    So I guess the question is.. can use a 16bit heightmap inside a material?

    I have tried using the "Displacementmap (8/16bit)" option under the compression settings (since this sounds like it's the only format that supports 16bit) but then the texture goes completely white.

    Any ideas or advice will be greatly appreciated
    Last edited by TK-Master; 11-15-2015, 01:07 PM.

    4.10 Update! -> [Community Project] WIP Weather & Ocean Water Shader
    WIP Interactive Water Shader, WIP 2D Water Sim
    WIP FFT Ocean w/ Foam, Quad-tree Infinite Ocean LOD

    #2
    For that you will need to use floatHDR format. But depending on the world size of the heightmap you may still experience some light stepping artifacts due to GPU precision.

    I actually used the same technique for the kite demo so that any meshes on the terrain had a grass transition before they hit the terrain. This ended up only working if the gradient was fairly large (~1 meter or so with modulation using heightmaps to sharpen) since the map had such a huge Z range. The blend modulation helped to break up the artifacts but there were still places where it didn't quite work as expected.

    I also used to so that lakes/rivers automatically got a rock edge where they intersected with the terrain. In that case the artifacts were much less noticeable because I used the rock/pebble heightmap to break it up and that pattern was so high frequency that it dominated any quantization artifacts.

    technically you could probably get by with less than HDR if your landscape has a fairly constrained z range. lets say your z range is 255 meters.... with 8 bit you will be able to represent 'terraces' 1 meter high and nothing more.
    Ryan Brucks
    Principal Technical Artist, Epic Games

    Comment


      #3
      Originally posted by RyanB View Post
      lakes/rivers automatically got a rock edge where they intersected with the terrain.
      Hi there, and sorry for off topic but didn't know that's doable. Can you please give me a hint where exactly that's done so I can take a look at the setup?
      Thanks.
      Artstation
      Join the support channel
      Gumroad Store

      Comment


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

        And here it is enabled:

        Click image for larger version

Name:	terrainblend2.JPG
Views:	1
Size:	133.8 KB
ID:	1093402


        A new technique that we are using now (but not at the time of kite demo) is to use Dither Temporal AA with a combination of constant and heightmap scaling to give blurry intersections. I recommend you try that before spending too much time on this blending stuff since IMO its far easier and looks almost as good.
        Ryan Brucks
        Principal Technical Artist, Epic Games

        Comment


          #5
          Thanks Ryan! HDR compression did the trick, no more stepping the technique adds about ~50 additional instructions to my shader, not bad at all... I think I will be using this a lot in the future.
          Here is the result link

          I didn't know kite demo used this technique, it looks like it works very well for rocks.

          Could you give us some example using Dither Temporal AA? sounds pretty interesting
          Last edited by TK-Master; 11-17-2015, 02:22 PM.

          4.10 Update! -> [Community Project] WIP Weather & Ocean Water Shader
          WIP Interactive Water Shader, WIP 2D Water Sim
          WIP FFT Ocean w/ Foam, Quad-tree Infinite Ocean LOD

          Comment


            #6
            Chiming in 3 years later here: With shaders in plugins, perhaps we could get direct access to the landscapes heightmap and expose it as a node (you'd specify the landscape actor in it).
            George Rolfe.
            Technical Coordinator at Orbit Solutions Pty Ltd.

            Comment

            Working...
            X